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

Avoid re-cloning registries with Pkg.Registry.add #3753

Open
omus opened this issue Jan 9, 2024 · 1 comment
Open

Avoid re-cloning registries with Pkg.Registry.add #3753

omus opened this issue Jan 9, 2024 · 1 comment

Comments

@omus
Copy link
Member

omus commented Jan 9, 2024

If you use Pkg.Registry.add to add an already existing registry the entire registry will be downloaded first before the conflict is noticed:

$ mkdir -p /tmp/julia-depot
$ export JULIA_DEPOT_PATH=/tmp/julia-depot JULIA_PKG_SERVER=""
$ time julia -e 'using Pkg; Pkg.Registry.add("General")'
     Cloning registry from "https://github.com/JuliaRegistries/General.git"
       Added registry `General` to `/tmp/julia-depot/registries/General`
julia -e 'using Pkg; Pkg.Registry.add("General")'  26.10s user 7.72s system 80% cpu 41.826 total

$ time julia -e 'using Pkg; Pkg.Registry.add("General")'
     Cloning registry from "https://github.com/JuliaRegistries/General.git"
Registry `General` already exists in `/tmp/julia-depot/registries/General`.
julia -e 'using Pkg; Pkg.Registry.add("General")'  26.37s user 11.05s system 86% cpu 43.262 total
@omus
Copy link
Member Author

omus commented Jan 9, 2024

Mainly this is an issue for CI. Specifically if you were to use julia-actions/cache with registry caching and later use julia-actions/julia-buildpkg the Pkg.Registry.add("General") call in that action can result in wasting time cloning a repository that is already present on disk.

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

1 participant