JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
621 stars 268 forks source link

installing packages runs into a keyerror: key UUID("...") not found #2554

Open Duskhorn opened 3 years ago

Duskhorn commented 3 years ago

Freshly installed Julia 1.6.1 Portable on Windows, I run into problems using the REPL package manager.

Minimal riproducible example on my machine

julia> ] add <any package>

Expected behaviour: package gets installed

Actual output:

    Updating registry at `C:\Users\rinal\.julia\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General`
   Resolving package versions...
ERROR: KeyError: key UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f") not found
Stacktrace:
  [1] getindex
    @ .\dict.jl:482 [inlined]
  [2] deps_graph(ctx::Pkg.Types.Context, uuid_to_name::Dict{Base.UUID, String}, reqs::Dict{Base.UUID, Pkg.Types.VersionSpec}, fixed::Dict{Base.UUID, Pkg.Resolve.Fixed})
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:474
  [3] resolve_versions!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:404
  [4] targeted_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1210
  [5] tiered_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1182
  [6] _resolve
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1216 [inlined]
  [7] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Vector{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1231
  [8] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Iterators.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:203
  [9] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:79
 [10] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:77
 [11] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\REPLMode\REPLMode.jl:408
 [12] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\REPLMode\REPLMode.jl:386
 [13] do_cmd
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\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 C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\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 C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\LineEdit.jl:2441
 [18] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\buildbot\worker\package_win64\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

My versioninfo():

 Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, znver1)
KristofferC commented 3 years ago

Can you try pkg> rm registry General; add registry General and try again.

Duskhorn commented 3 years ago

@KristofferC thanks for the response, I tried removing and adding the registry back but the error persists.

I tried again on a fresh reinstall of Julia, downloading the portable app again, but it gives me the same error

KristofferC commented 3 years ago

The UUID is for Mmap which is a stdlib. So there might be some problem with the portable app or how Pkg interacts with the portable app. That setup is not very well tested. What does Pkg.Types.stdlibs() say?

Duskhorn commented 3 years ago

@KristofferC sorry for the very late response. Upon further investigation, meaning I tried to just import Pkg, Julia propmted the follwing (and rather hilarious, in my opinion) error:

julia> import Pkg
ERROR: ArgumentError: Package Pkg not found in current path:
- Run `import Pkg; Pkg.add("Pkg")` to install the Pkg package.

Which made me believe I set up my JULIA_LOAD_PATH incorrectly. Referring to a very old issue (#29513) I tried to edit my variable and adding the missing semicolon. That did not fix the issue and I can't provide you with the Pkg.Types.stdlibs().

Frankly, I'm stuck

KristofferC commented 3 years ago

You can get Pkg via:

julia> Pkg = Base.loaded_modules[Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg")]
Pkg

and then run Pkg.Types.stdlibs()

Duskhorn commented 3 years ago

@KristofferC Thank you so much for your help and sorry again for my very late responses! I managed to call the Pkg.Types.stdlibs() function, here's the full output:

UUID("4af54fe1-eca0-43a8-85a7-787d91b784e3") => "LazyArtifacts"
UUID("37e2e46d-f89d-539d-b4ee-838fcccc9c8e") => "LinearAlgebra"
UUID("0dad84c5-d112-42e6-8d28-ef12dabb789f") => "ArgTools"
UUID("10745b16-79ce-11e8-11f9-7d13ad32a3b2") => "Statistics"
UUID("fa267f1f-6049-4f14-aa54-33bafae1ed76") => "TOML"
UUID("3a97d323-0669-5f0c-9066-3539efd106a3") => "MPFR_jll"
UUID("14a3606d-f60d-562e-9121-12d972cd8159") => "MozillaCACerts_jll"
UUID("76f85450-5226-5b5a-8eaa-529ad045b433") => "LibGit2"
UUID("8bb1440f-4735-579b-a4ab-409b98df4dab") => "DelimitedFiles"
UUID("9e88b42a-f829-5b0c-bbe9-9e923198166b") => "Serialization"
UUID("3fa0cd96-eef1-5676-8a61-b3b8758bbffb") => "REPL"
UUID("ca575930-c2e3-43a9-ace4-1e988b2c1908") => "NetworkOptions"
UUID("8f399da3-3557-5675-b5ff-fb832c97cbdb") => "Libdl"
UUID("a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e") => "Tar"
UUID("29816b5a-b9ab-546f-933c-edad1886dfa8") => "LibSSH2_jll"
UUID("745a5e78-f969-53e9-954f-d19f2f74f4e3") => "LibUnwind_jll"
UUID("e66e0078-7015-5450-92f7-15fbd957f2ae") => "CompilerSupportLibraries_jll"
UUID("9a3f8284-a2c9-5f02-9a11-845980a1fd5c") => "Random"
UUID("781609d7-10c4-51f6-84f2-b8444358ff6d") => "GMP_jll"
UUID("bea87d4a-7f5b-5778-9afe-8cc45184846c") => "SuiteSparse_jll"
UUID("cf7118a7-6976-5b1a-9a39-7adc72f591a4") => "UUIDs"
UUID("4607b0f0-06f3-5cda-b6b1-a6196a1729e9") => "SuiteSparse"
UUID("ea8e919c-243c-51af-8825-aaa63cd721ce") => "SHA"
UUID("8dfed614-e22c-5e08-85e1-65c5234f0b40") => "Test"
UUID("efcefdf7-47ab-520b-bdef-62a2eaa19f15") => "PCRE2_jll"
UUID("c8ffd9c3-330d-5841-b78e-0817d7145fa1") => "MbedTLS_jll"
UUID("a83860b7-747b-57cf-bf1f-3e79990d037f") => "LibOSXUnwind_jll"
UUID("1a1011a3-84de-559e-8e89-a11a2f7dc383") => "SharedArrays"
UUID("6462fe0b-24de-5631-8697-dd941f90decc") => "Sockets"
UUID("56f22d72-fd6d-98f1-02f0-08ddc0907c33") => "Artifacts"
UUID("05ff407c-b0c1-5878-9df8-858cc2e60c36") => "dSFMT_jll"
UUID("3f19e933-33d8-53b3-aaab-bd5110c3b7a0") => "p7zip_jll"
UUID("83775a58-1f1d-513f-b197-d71354ab007a") => "Zlib_jll"
UUID("02250abe-2050-11e9-017e-b301a2b5bcc4") => "Pkg"
UUID("183b4373-6708-53ba-ad28-60e28bb38547") => "LibUV_jll"
UUID("4536629a-c528-5b80-bd46-f80d51c5b363") => "OpenBLAS_jll"
UUID("8bf52ea8-c179-5cab-976a-9e18b702a9bc") => "CRC32c"
UUID("f43a241f-c20a-4ad4-852c-f6b1247861c6") => "Downloads"
UUID("2f01184e-e22b-5df5-ae63-d93ebab69eaf") => "SparseArrays"
UUID("de0858da-6303-5e67-8744-51eddeeeb8d7") => "Printf"
UUID("d6f4376e-aef5-505a-96c1-9c027394607a") => "Markdown"
UUID("ade2ca70-3891-5945-98fb-dc099432e06a") => "Dates"
UUID("7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee") => "FileWatching"
UUID("56ddb016-857b-54e1-b83d-db4d58db5568") => "Logging"
UUID("e37daf67-58a4-590a-8e99-b0245dd2ffc5") => "LibGit2_jll"
UUID("b77e0a4c-d291-57a0-90e8-8db25a27a240") => "InteractiveUtils"
UUID("4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5") => "Unicode"
UUID("9abbd945-dff8-562f-b5e8-e1ebf5ef1b79") => "Profile"
UUID("2a0f44e3-6c83-55bd-87e4-b1978d98bd5f") => "Base64"
UUID("b27032c2-a3e7-50c8-80cd-2d36dbcbfd21") => "LibCURL"
UUID("a63ad114-7e13-5084-954f-fe012c677804") => "Mmap"
UUID("8e850ede-7688-5339-a07c-302acd2aaf8d") => "nghttp2_jll"
UUID("05823500-19ac-5b8b-9628-191a04bc5112") => "OpenLibm_jll"
UUID("9fa8497b-333b-5362-9e8d-4d0656e87820") => "Future"
UUID("8f36deef-c2a5-5394-99ed-8e07531fb29a") => "libLLVM_jll"
UUID("8ba89e20-285c-5b6f-9357-94700520ee1b") => "Distributed"
UUID("deac9b47-8bc7-5906-a0fe-35ac56dc84c0") => "LibCURL_jll"
jagot commented 3 years ago

I see the same error in CI, but only on nightly: https://github.com/JuliaApproximation/CompactBases.jl/runs/2771496296?check_suite_focus=true#step:6:11

KristofferC commented 3 years ago

That has something to do with the code for CompatHelper:

[ Info: This is a Dependabot/CompatHelper job, so `force_latest_compatible_version` has been set to `true`

Best to open a new issue for that.