Open fredrikekre opened 3 years ago
Reproducer:
$ cd $(mktemp -d)
$ export JULIA_DEPOT_PATH=$PWD
$ export JULIA_LOAD_PATH=$PWD/Project.toml
$ jlpkg add JSON &> /dev/null
$ rm -rf packages/JSON Project.toml
$ jlpkg add Crayons
Resolving package versions...
Installed Crayons ─ v4.0.4
Installed JSON ──── v0.21.1
Updating `/tmp/tmp.NKv4yx8IEc/Project.toml`
[a8cc5b0e] + Crayons v4.0.4
Updating `/tmp/tmp.NKv4yx8IEc/Manifest.toml`
[a8cc5b0e] + Crayons v4.0.4
[682c06a0] - JSON v0.21.1
[69de0a69] - Parsers v1.0.12
[ade2ca70] - Dates
[a63ad114] - Mmap
[de0858da] - Printf
[4ec0a83e] - Unicode
ERROR: LoadError: could not find entry with uuid 682c06a0-de6a-54ab-a142-c8b1cf79cde6 in manifest /tmp/tmp.NKv4yx8IEc/Manifest.toml
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] build_versions(::Pkg.Types.Context, ::Array{Base.UUID,1}; might_need_to_resolve::Bool, verbose::Bool) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:898
[3] build_versions at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:888 [inlined]
[4] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Linux) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:1145
[5] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Linux, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:188
[6] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:139
[7] add(::Array{Pkg.Types.PackageSpec,1}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:67
[8] add(::Array{Pkg.Types.PackageSpec,1}) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:67
[9] do_cmd!(::Pkg.REPLMode.Command, ::Pkg.REPLMode.MiniREPL) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/REPLMode.jl:404
[10] do_cmd(::Pkg.REPLMode.MiniREPL, ::String; do_rethrow::Bool) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/REPLMode.jl:382
[11] pkgstr(::String) at /home/fredrik/julia15/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/REPLMode.jl:464
[12] top-level scope at /usr/local/bin/jlpkg:192
[13] include(::Function, ::Module, ::String) at ./Base.jl:380
[14] include(::Module, ::String) at ./Base.jl:368
[15] exec_options(::Base.JLOptions) at ./client.jl:296
[16] _start() at ./client.jl:506
in expression starting at /usr/local/bin/jlpkg:191
So what I think happens:
This should be fixable by just pruning the manifest on the creation of the EnvCache
.
The second problem is the whole Vector{::PackageSpec}
we have going around everywhere. When this gets desynced with the environment, weird things happen. I have some local work that only uses PackageSpec
as an input to the resolver step, which returns a new environment and then the environment is used everywhere, but that is quite a bit away from PR-ing.
I verified that I did not have a project file before, but I guess from the output that I must have had a manifest. On
add Crayons
, why was JSON@0.19.0 installed in the first place leading to a failure later where it was (rightfully) missing from the manifest?