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

users function not working on Julia v1.7.1 #36

Open
simonschoelly opened this issue Jan 29, 2022 · 2 comments
Open

users function not working on Julia v1.7.1 #36

simonschoelly opened this issue Jan 29, 2022 · 2 comments

Comments

@simonschoelly
Copy link

There seems to be something broken with the users function with PkgDeps v0.6.2 and Julia v1.7.1. I can reproduce the issues with my local Julia installation,, as well as with the official julia:1.7.1 docker image. In contrast they do not occur with the julia:1.6.0 docker image.

julia> using PkgDeps

julia> users("Flux")
ERROR: ArgumentError: Collection is empty, must contain exactly 1 element
Stacktrace:
 [1] only
   @ ./iterators.jl:1354 [inlined]
 [2] _get_pkg_uuid(pkg_name::String, registry_name::String; depots::Vector{String})
   @ PkgDeps ~/.julia/packages/PkgDeps/afXc8/src/utilities.jl:101
 [3] _get_pkg_uuid
   @ ~/.julia/packages/PkgDeps/afXc8/src/utilities.jl:101 [inlined]
 [4] #users#18
   @ ~/.julia/packages/PkgDeps/afXc8/src/PkgDeps.jl:112 [inlined]
 [5] users (repeats 2 times)
   @ ~/.julia/packages/PkgDeps/afXc8/src/PkgDeps.jl:112 [inlined]
 [6] top-level scope
   @ REPL[7]:1

julia> users(Base.UUID("587475ba-b771-5e3f-ad9e-33799f191a9c"))  # UUID of Flux.jl
String[]

Tests fail as well:


(@v1.7) pkg> test PkgDeps
     Testing PkgDeps
      Status `/tmp/jl_Wwxymf/Project.toml`
  [34da2185] Compat v3.41.0
  [839e9fc8] PkgDeps v0.6.2
  [44cfe95a] Pkg `@stdlib/Pkg`
  [3fa0cd96] REPL `@stdlib/REPL`
  [fa267f1f] TOML `@stdlib/TOML`
  [8dfed614] Test `@stdlib/Test`
  [cf7118a7] UUIDs `@stdlib/UUIDs`
      Status `/tmp/jl_Wwxymf/Manifest.toml`
  [34da2185] Compat v3.41.0
  [839e9fc8] PkgDeps v0.6.2
  [0dad84c5] ArgTools `@stdlib/ArgTools`
  [56f22d72] Artifacts `@stdlib/Artifacts`
  [2a0f44e3] Base64 `@stdlib/Base64`
  [ade2ca70] Dates `@stdlib/Dates`
  [8bb1440f] DelimitedFiles `@stdlib/DelimitedFiles`
  [8ba89e20] Distributed `@stdlib/Distributed`
  [f43a241f] Downloads `@stdlib/Downloads`
  [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
  [b27032c2] LibCURL `@stdlib/LibCURL`
  [76f85450] LibGit2 `@stdlib/LibGit2`
  [8f399da3] Libdl `@stdlib/Libdl`
  [37e2e46d] LinearAlgebra `@stdlib/LinearAlgebra`
  [56ddb016] Logging `@stdlib/Logging`
  [d6f4376e] Markdown `@stdlib/Markdown`
  [a63ad114] Mmap `@stdlib/Mmap`
  [ca575930] NetworkOptions `@stdlib/NetworkOptions`
  [44cfe95a] Pkg `@stdlib/Pkg`
  [de0858da] Printf `@stdlib/Printf`
  [3fa0cd96] REPL `@stdlib/REPL`
  [9a3f8284] Random `@stdlib/Random`
  [ea8e919c] SHA `@stdlib/SHA`
  [9e88b42a] Serialization `@stdlib/Serialization`
  [1a1011a3] SharedArrays `@stdlib/SharedArrays`
  [6462fe0b] Sockets `@stdlib/Sockets`
  [2f01184e] SparseArrays `@stdlib/SparseArrays`
  [10745b16] Statistics `@stdlib/Statistics`
  [fa267f1f] TOML `@stdlib/TOML`
  [a4e569a6] Tar `@stdlib/Tar`
  [8dfed614] Test `@stdlib/Test`
  [cf7118a7] UUIDs `@stdlib/UUIDs`
  [4ec0a83e] Unicode `@stdlib/Unicode`
  [e66e0078] CompilerSupportLibraries_jll `@stdlib/CompilerSupportLibraries_jll`
  [deac9b47] LibCURL_jll `@stdlib/LibCURL_jll`
  [29816b5a] LibSSH2_jll `@stdlib/LibSSH2_jll`
  [c8ffd9c3] MbedTLS_jll `@stdlib/MbedTLS_jll`
  [14a3606d] MozillaCACerts_jll `@stdlib/MozillaCACerts_jll`
  [4536629a] OpenBLAS_jll `@stdlib/OpenBLAS_jll`
  [83775a58] Zlib_jll `@stdlib/Zlib_jll`
  [8e850b90] libblastrampoline_jll `@stdlib/libblastrampoline_jll`
  [8e850ede] nghttp2_jll `@stdlib/nghttp2_jll`
  [3f19e933] p7zip_jll `@stdlib/p7zip_jll`
     Testing Running tests...
exception: Test Failed at /root/.julia/packages/PkgDeps/afXc8/test/runtests.jl:44
  Expression: PkgDeps._get_pkg_uuid("PkgDepsFakePackage", "General")
    Expected: PackageNotInRegistry
      Thrown: ArgumentError
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/PkgDeps/afXc8/test/runtests.jl:44 [inlined]
 [2] macro expansion
   @ /usr/local/julia/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/PkgDeps/afXc8/test/runtests.jl:44 [inlined]
 [4] macro expansion
   @ /usr/local/julia/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [5] macro expansion
   @ ~/.julia/packages/PkgDeps/afXc8/test/runtests.jl:28 [inlined]
 [6] macro expansion
   @ /usr/local/julia/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [7] top-level scope
   @ ~/.julia/packages/PkgDeps/afXc8/test/runtests.jl:14
Test Summary:                   | Pass  Fail  Total
internal functions              |   16     1     17
  _get_pkg_name                 |    2            2
  _get_pkg_uuid                 |    5     1      6
    name to uuid                |    2            2
    Same name in two registries |    2            2
    exception                   |    1     1      2
  _get_latest_version           |    1            1
  _find_alternative_packages    |    1            1
  `_find_latest_pkg_entry`      |    7            7
ERROR: LoadError: Some tests did not pass: 16 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /root/.julia/packages/PkgDeps/afXc8/test/runtests.jl:13
ERROR: Package PkgDeps errored during testing
@simonschoelly
Copy link
Author

From Julia v1.7.0 NEWS.md:

Registries downloaded from the Pkg Server (not git) are no longer uncompressed into files but instead read directly from the compressed tarball into memory. This improves performance on filesystems which do not handle a large number of files well. To turn this feature off, set the environment variable JULIA_PKG_UNPACK_REGISTRY=true.

It seems as if the registries directory for the General repository does not contain a General subdirectory anymore, but rather a compressed General.tar.gz file. Therefore the reachable_registries function does not find the General registry for Julia >= v1.7.0, while it does on older Julia versions.

@ericphanson
Copy link
Member

as a workaround, one could clone General themselves, or mess with the env variables to get Pkg to do it. I think the long term solution is to help get https://github.com/GunnarFarneback/RegistryInstances.jl going as a stable interface in front of Pkg internals and then rely on that.

(FYI, PackageAnalyzer.jl and similar packages also face this same issue)

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

No branches or pull requests

2 participants