Skip to content
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

Pkg.upgrade_manifest broke my Manifest #2609

Closed
vtjnash opened this issue Jun 9, 2021 · 5 comments · Fixed by #2610
Closed

Pkg.upgrade_manifest broke my Manifest #2609

vtjnash opened this issue Jun 9, 2021 · 5 comments · Fixed by #2610
Assignees
Labels

Comments

@vtjnash
Copy link
Member

vtjnash commented Jun 9, 2021

julia> using Pkg; Pkg.upgrade_manifest()
     Updated Format of manifest file at `/home/vtjnash/.julia/environments/v1.1/Manifest.toml` updated from v1.0 to v2.0

(@v1.1) pkg> up
ERROR: ArgumentError: invalid version string: nothing
Stacktrace:
  [1] parse
    @ ./version.jl:126 [inlined]
  [2] VersionNumber(v::String)
    @ Base ./version.jl:130
  [3] Pkg.Types.Manifest(raw::Dict{String, Any}, f_or_io::String)
    @ Pkg.Types /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/manifest.jl:134
  [4] read_manifest(f_or_io::String)
    @ Pkg.Types /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/manifest.jl:198
  [5] Pkg.Types.EnvCache(env::Nothing)
    @ Pkg.Types /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Types.jl:338
  [6] EnvCache
    @ /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Types.jl:317 [inlined]
  [7] Pkg.Types.Context()
    @ Pkg.Types ./util.jl:471
  [8] up(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:145
  [9] up(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:144
 [10] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:407
 [11] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:385
 [12] do_cmd
    @ /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:376 [inlined]
 [13] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:549
 [14] #invokelatest#2
    @ ./essentials.jl:716 [inlined]
 [15] invokelatest
    @ ./essentials.jl:714 [inlined]
 [16] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/REPL/src/LineEdit.jl:2493
 [17] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:1227
 [18] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:411
$ head Manifest.toml 
# This file is machine-generated - editing it directly is not advised

julia_version = "nothing"
manifest_format = "2.0"

[[deps.ATK_jll]]
deps = ["Artifacts", "Glib_jll", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "a5a8f114e4d70bee6cf82ed28b488d57f1fa9467"
uuid = "7b86fcea-f67b-53e1-809c-8f1719c154e8"
version = "2.36.0+0"
@vtjnash
Copy link
Member Author

vtjnash commented Jun 9, 2021

Tried deleting that line, but then failed with:

julia> using Pkg; Pkg.upgrade_manifest()
ERROR: KeyError: key "julia_version" not found
Stacktrace:
 [1] getindex
   @ ./dict.jl:481 [inlined]
 [2] Pkg.Types.Manifest(raw::Dict{String, Any}, f_or_io::String)
   @ Pkg.Types /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/manifest.jl:134
 [3] read_manifest(f_or_io::String)
   @ Pkg.Types /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/manifest.jl:198
 [4] Pkg.Types.EnvCache(env::Nothing)
   @ Pkg.Types /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Types.jl:338
 [5] EnvCache
   @ /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Types.jl:317 [inlined]
 [6] Pkg.Types.Context()
   @ Pkg.Types ./util.jl:471
 [7] upgrade_manifest()
   @ Pkg.API /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1673
 [8] top-level scope
   @ REPL[1]:1

@DilumAluthge
Copy link
Member

DilumAluthge commented Jun 9, 2021

Should be relatively easy to fix, I think we can just change a parse to a tryparse or something like that. I'll make a PR and ping Ian for review.

@StefanKarpinski
Copy link
Member

How about just leaving that entry out when we don't have a value instead of using "nothing" as a value?

@IanButterworth
Copy link
Member

I responded to your other message here #2610 (comment)


That sounds good to me. It wouldn't break the base heuristic
https://github.com/JuliaLang/julia/blob/15c19c8a6b1c1a87e6dd24fd058de5192826b250/base/loading.jl#L560-L570

But we would want to get that change out before people start generating manifests with julia_version = "nothing" in it, so could block the 1.7 beta?

@IanButterworth
Copy link
Member

Proposed implementation #2612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants