Pkg.jl
Pkg.jl copied to clipboard
prevent overridden artifacts from downloading
fixes https://github.com/JuliaLang/Pkg.jl/issues/2664
I think this needs a bit of thinking though. For example, if you use PackageCompiler you want that ensure_artifact_installed
to download the artifact even if it is overridden. So it probably needs an option.
cc @carstenbauer, @staticfloat (who is on vacation AFAIU).
I think we should use the same option naming as the rest of the Artifacts
functions, which is to add an honor_overrides::Bool
parameter. Note that some methods, such as artifact_paths()
default to honor_overrides = true
, while other methods such as verify_artifact()
default to honor_overrides = false
.
In this case, I think if honor_overrides
is true
, then any overridden artifact is considered already downloaded. If honor_overrides
is false
, then overriding is ignored and ensure_artifact_installed()
will download the "normal" artifact. We default to honor_overrides=true
.
Could we resurrect this? Or has an alternate solution already been implemented?
When we locally precompile an artifact with BinaryBuilder.jl, the url fields in the Artifacts.toml
of the *_jll
package generated are wrong and we can't reinstall the .tar.gz
archives that contain the shared library because Pkg.jl
try to download the artifact even if it is overridden.
[[MyJLL]]
arch = "x86_64"
git-tree-sha1 = "904cd5f02f75dbfeda9d13e5384446c3bce28535"
libc = "glibc"
libgfortran_version = "5.0.0"
os = "linux"
[[MyJLL.download]]
sha256 = "e660371139a1f7711ec60aff90ffde00696c0ea4f4438ac3889ea4376e13a235"
url = "https://github.com/local/releases/download/MyJLL-v2023.3.1+0/MyJLL.v2023.3.1.x86_64-linux-gnu-libgfortran5.tar.gz"
This PR could solve the issue.