Pkg.jl icon indicating copy to clipboard operation
Pkg.jl copied to clipboard

prevent overridden artifacts from downloading

Open KristofferC opened this issue 2 years ago • 1 comments

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).

KristofferC avatar May 03 '22 14:05 KristofferC

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.

staticfloat avatar May 18 '22 02:05 staticfloat

Could we resurrect this? Or has an alternate solution already been implemented?

smartalecH avatar Feb 16 '23 16:02 smartalecH

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.

amontoison avatar Mar 02 '23 19:03 amontoison