Skip to content

[release-1.6] Add manifest julia_version difference warning #2666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

IanButterworth
Copy link
Member

As discussed in #2665 I think it would be helpful for 1.6.2 to have something like this. Otherwise the user will get unactionable errors with no warning.

This is a 1.6-appropriate modification of the warning that was omitted in #2620 when backported in #2628

@KristofferC
Copy link
Member

I think this is a bit too late to go into 1.6.2 but could go into 1.6.3.

@IanButterworth
Copy link
Member Author

Fair

@DilumAluthge
Copy link
Member

Is this good to go? So we can get it into the next 1.6.x?

@DilumAluthge
Copy link
Member

Can we get this into 1.6.6?

@IanButterworth
Copy link
Member Author

I think that's a good idea. Just added some tests.

@IanButterworth
Copy link
Member Author

IanButterworth commented Jan 17, 2022

To illustrate with this Manifest.toml

1.6.5

(@v1.6) pkg> activate ~/.julia/environments/v1.7
  Activating environment at `~/.julia/environments/v1.7/Project.toml`

(@v1.7) pkg> instantiate
ERROR: AssertionError: sourcepath !== nothing
Stacktrace:
  [1] is_package_downloaded(ctx::Pkg.Types.Context, pkg::Pkg.Types.PackageSpec)
    @ Pkg.Operations ~/Documents/GitHub/Pkg.jl/src/Operations.jl:1789
  [2] #13
    @ ~/Documents/GitHub/Pkg.jl/src/Operations.jl:131 [inlined]
  [3] _all
    @ ./reduce.jl:923 [inlined]
  [4] #all#698
    @ ./reducedim.jl:886 [inlined]
  [5] all
    @ ./reducedim.jl:886 [inlined]
  [6] is_instantiated(ctx::Pkg.Types.Context)
    @ Pkg.Operations ~/Documents/GitHub/Pkg.jl/src/Operations.jl:131
  [7] instantiate(ctx::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Base.BinaryPlatforms.Platform, allow_build::Bool, allow_autoprecomp::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API ~/Documents/GitHub/Pkg.jl/src/API.jl:1360
  [8] instantiate
    @ ~/Documents/GitHub/Pkg.jl/src/API.jl:1325 [inlined]
  [9] #instantiate#252
    @ ~/Documents/GitHub/Pkg.jl/src/API.jl:1321 [inlined]
 [10] instantiate()
    @ Pkg.API ~/Documents/GitHub/Pkg.jl/src/API.jl:1321
 [11] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:405
 [12] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:386
 [13] do_cmd
    @ ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:377 [inlined]
 [14] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:550
 [15] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [16] invokelatest
    @ ./essentials.jl:706 [inlined]
 [17] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/LineEdit.jl:2441
 [18] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:1126
 [19] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:411

This PR on 1.6.5

(@v1.6) pkg> activate ~/.julia/environments/v1.7
  Activating environment at `~/.julia/environments/v1.7/Project.toml`

(@v1.7) pkg> instantiate
┌ Warning: The active manifest file has dependencies that were resolved with a different julia version (1.7.0). Unexpected behavior may occur.
└ @ ~/.julia/environments/v1.7/Manifest.toml:0
ERROR: AssertionError: sourcepath !== nothing
Stacktrace:
  [1] is_package_downloaded(ctx::Pkg.Types.Context, pkg::Pkg.Types.PackageSpec)
    @ Pkg.Operations ~/Documents/GitHub/Pkg.jl/src/Operations.jl:1789
  [2] #13
    @ ~/Documents/GitHub/Pkg.jl/src/Operations.jl:131 [inlined]
  [3] _all
    @ ./reduce.jl:923 [inlined]
  [4] #all#698
    @ ./reducedim.jl:886 [inlined]
  [5] all
    @ ./reducedim.jl:886 [inlined]
  [6] is_instantiated(ctx::Pkg.Types.Context)
    @ Pkg.Operations ~/Documents/GitHub/Pkg.jl/src/Operations.jl:131
  [7] instantiate(ctx::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Base.BinaryPlatforms.Platform, allow_build::Bool, allow_autoprecomp::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API ~/Documents/GitHub/Pkg.jl/src/API.jl:1360
  [8] instantiate
    @ ~/Documents/GitHub/Pkg.jl/src/API.jl:1325 [inlined]
  [9] #instantiate#252
    @ ~/Documents/GitHub/Pkg.jl/src/API.jl:1321 [inlined]
 [10] instantiate()
    @ Pkg.API ~/Documents/GitHub/Pkg.jl/src/API.jl:1321
 [11] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:405
 [12] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:386
 [13] do_cmd
    @ ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:377 [inlined]
 [14] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode ~/Documents/GitHub/Pkg.jl/src/REPLMode/REPLMode.jl:550
 [15] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [16] invokelatest
    @ ./essentials.jl:706 [inlined]
 [17] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/LineEdit.jl:2441
 [18] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:1126
 [19] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:411

@IanButterworth IanButterworth merged commit d51745b into JuliaLang:release-1.6 Feb 1, 2022
@IanButterworth IanButterworth deleted the ib/16_manifest_julia_version_warning branch February 1, 2022 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants