GunnarFarneback / LocalRegistry.jl

Create and maintain local registries for Julia packages.
Other
222 stars 22 forks source link

cannot find name corresponding to UUID #79

Closed jonathanBieler closed 7 months ago

jonathanBieler commented 7 months ago

I setup a local registry, and I can add packages from it and General, but for one package in particular I'm getting :

pkg> add MyPackage
   Resolving package versions...
ERROR: cannot find name corresponding to UUID 614c35df-70c2-513b-9342-7afe5867205d in a registry

I can see both General and my local registry with registry st. The UUI in the registry match the one in the package's Project.toml so I'm not sure what's the issue. Any idea ?

GunnarFarneback commented 7 months ago

That's a kind of weird error. Apparently the package manager has managed to translate MyPackage into a UUID somehow, which it should have done from registry information. It seems like something must be inconsistent in some way.

You can try running the RegistryCI integrity tests on your registry, something like

using RegistryCI
RegistryCI.test(path_to_your_registry, registry_deps = ["General"])

and see if that gives any hint.

jonathanBieler commented 7 months ago

Hum it fails with :

julia> RegistryCI.test("/mnt/ssd_disk/.julia/registries/jbieler_registry", registry_deps = ["General"])
(Registry|Package|Versions|Deps|Compat).toml: Error During Test at /mnt/ssd_disk/.julia/packages/RegistryCI/MNA6P/src/registry_testing.jl:151
  Got exception outside of a @test
  "/tmp/jl_ky1yqD/registries/General.toml/Registry.toml": No such file

It's this line : https://github.com/JuliaRegistries/RegistryCI.jl/blob/master/src/registry_testing.jl#L66

And spec is (after running RegistryCI.test) :

julia> spec = Pkg.Registry.reachable_registries()

julia> spec[1].path
"/tmp/jl_K89MqG/registries/General.toml"

shell> ls /tmp/jl_K89MqG/registries/
General.tar.gz  General.toml

If I run Pkg.Registry.reachable_registries in a fresh REPL I see the path of general ending in General.toml and the path to my local registry being a folder.

I'm on v1.10, to note I moved my .julia folder but it doesn't seem to be the issue here.

GunnarFarneback commented 7 months ago

Right, I forgot that RegistryCI requires an unpacked registry (which once was the default). You can get that by removing the General registry and setting the environment variable JULIA_PKG_UNPACK_REGISTRY=true before adding it again.

Note, instead of moving .julia, you can point the environment variable JULIA_DEPOT_PATH to an empty directory.

jonathanBieler commented 7 months ago

Ha, I think that did it. The faulty package gave me a "Error: It is not the case that all dependencies exist in the General registry", although the issue that it was depending on a private package that I forgot to add in my local registry (it seems the message here isn't quite accurate : https://github.com/JuliaRegistries/RegistryCI.jl/blob/a3ceb69a1369a3cc28047294b9028e7dd110e4e3/src/registry_testing.jl#L191)

Adding the missing dependency seems to have solved the issue. Thanks!

Maybe RegistryCI could be mentioned in the docs.

GunnarFarneback commented 7 months ago

Good idea. See #80 (which has better instructions than given in this issue).