Skip to content

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

@omus

Description

@omus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions