Pkg.jl: `Pkg.add("GMP_jll"; julia_version=v"1.6")` doesn't install `GMP_jll` for v1.6

Created on 2 Apr 2021  Â·  10Comments  Â·  Source: JuliaLang/Pkg.jl

julia> Pkg.add("GMP_jll"; julia_version=v"1.5")
  [...]

(jl_uYNCOr) pkg> st
      Status `/tmp/jl_uYNCOr/Project.toml`
  [781609d7] GMP_jll v6.1.2+6

julia> Pkg.add("GMP_jll"; julia_version=v"1.6")
   Resolving package versions...
    Updating `/tmp/jl_uYNCOr/Project.toml`
  [781609d7] ~ GMP_jll v6.1.2+6 ⇒ 
    Updating `/tmp/jl_uYNCOr/Manifest.toml`
  [...]

(jl_uYNCOr) pkg> st
      Status `/tmp/jl_uYNCOr/Project.toml`
  [781609d7] GMP_jll

Pkg.add("GMP_jll"; julia_version=v"1.6") doesn't work as expected, I guess because GMP_jll is a standard library in v1.6. As you can guess, this is needed for BinaryBuilder :upside_down_face:

Spotted in https://github.com/JuliaPackaging/BinaryBuilderBase.jl/pull/129#issuecomment-812259489

Most helpful comment

We've been toying with the idea of storing stdlib versions in manifests as well; perhaps we should actually do that for v1.7, which will allow us to flesh this feature out more. This is important because it will give us a shot at actually instantiating e.g. GMP_jll for v1.6 when we're running Julia v1.7, where they're both stdlibs.

All 10 comments

😬

Could this be related to why the 1.6.1 backport branch is failing? https://github.com/JuliaLang/Pkg.jl/pull/2425

Pkg was tested against nightly before the 1.6.0 release. Have the stdlibs deviated between 1.6 and nightly?

Test Summary:               | Pass  Total
is_stdlib() across versions |   12     12
┌ Error: STDLIBS_BY_VERSION out of date!  Re-run generate_historical_stdlibs.jl!
â”” @ Main.PkgTests.NewTests ~/work/Pkg.jl/Pkg.jl/test/new.jl:2524
STDLIBS_BY_VERSION up-to-date: Test Failed at /home/runner/work/Pkg.jl/Pkg.jl/test/new.jl:2526
  Expression: test_result
Stacktrace:
 [1] macro expansion
   @ ~/work/Pkg.jl/Pkg.jl/test/new.jl:2526 [inlined]
 [2] macro expansion
   @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
 [3] top-level scope
   @ ~/work/Pkg.jl/Pkg.jl/test/new.jl:2522

Have the stdlibs deviated between 1.6 and nightly?

GMP in v1.6.0 is 6.2.0, in nightly it's 6.2.1

I'm guessing that because Pkg was tested against nightly, the generate_historical_stdlibs stuff was unaware of 1.6?
Emphasis on the "guessing"

Okay, this is going to be tough.

On the one hand, we want things to resolve as if it were Julia v1.6. On the other hand, we don't record versions for stdlibs. I can update the historical stdlib generator to record the version field in the Project.toml for any stdlib that has it, but so much of our Pkg code assumes that stdlibs don't have versions that I'm not sure how we're going to do this.

EDIT: I updated the HSG on this WIP branch: https://github.com/JuliaLang/Pkg.jl/tree/sf/versioned_historical_stdlibs

We've been toying with the idea of storing stdlib versions in manifests as well; perhaps we should actually do that for v1.7, which will allow us to flesh this feature out more. This is important because it will give us a shot at actually instantiating e.g. GMP_jll for v1.6 when we're running Julia v1.7, where they're both stdlibs.

This would be really useful in particular for libLLVM_jll? Are we using the version number of that for resolution? Or are we relying on the Julia compat for resolving that?

Resolution in what context? For stdlibs, Julia's Pkg doesn't resolve stdlibs at all.

Ah, quite. Yes, it is important that we do that and don't rely on Julia compat entries, as that will get very difficult to manage.

Was this page helpful?
0 / 5 - 0 ratings