-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Artifacts: avoid reflection hacks to access ensure_artifact_installed
Packages should never access Base.loaded_modules() to call functions from it, so instead we require the user to explicitly provide this function, if they wish to use it (for lazy artifacts).
- Loading branch information
Showing
5 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Artifacts: with_artifacts_directory | ||
# using Pkg.Artifacts: ensure_all_artifacts_installed | ||
using Pkg.Artifacts: load_artifacts_toml, ensure_artifact_installed | ||
let | ||
tempdir = joinpath(@__DIR__, "artifacts") | ||
rm(tempdir; recursive=true, force=true) | ||
toml = joinpath(@__DIR__, "Artifacts.toml") | ||
unused = Base.BinaryPlatforms.Platform(string(Sys.ARCH), "linux") | ||
with_artifacts_directory(tempdir) do | ||
# ensure_all_artifacts_installed(toml; include_lazy=false) | ||
dict = load_artifacts_toml(toml) | ||
for (name, meta) in dict | ||
if meta isa Array | ||
for meta in meta | ||
get(meta, "lazy", false) && continue | ||
ensure_artifact_installed(name, meta, toml; platform=unused) | ||
end | ||
else; meta::Dict | ||
get(meta, "lazy", false) && continue | ||
ensure_artifact_installed(name, meta, toml; platform=unused) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters