JuliaLang / Pkg.jl

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

`pkg> registry add https://github.com/staticfloat/General#sf/foo` does not work properly #3918

Open staticfloat opened 3 weeks ago

staticfloat commented 3 weeks ago

Attempting to add a specific branch of a registry using the same form as add for a package results in cloning the right repository, but with an invalid fetch refspec:

(@v1.10) pkg> registry add https://github.com/staticfloat/General#bb2/bb2
     Cloning registry from "https://github.com/staticfloat/General#bb2/bb2"
       Added registry `General` to `./registries/General`

This kind of looks like it works, but if you inspect the registry:

sabae@bb8:/tmp/foo$ cd registries/General/
sabae@bb8:/tmp/foo/registries/General$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

No such luck, and looking at the remote, we can see it's clearly not what I wanted:

$ git remote show origin
fatal: https://github.com/staticfloat/General#bb2/bb2/info/refs not valid: is this a git repository?
staticfloat commented 3 weeks ago

As far as a motivating reason for this, BinaryBuilder2 will push up registry branches with stacks of new JLLs built and registered within it, like this. Eventually, I would like to make it very easy for users to test out Yggdrasil PRs by just running something like:

$ JULIA_DEPOT_PATH=/tmp/deleteme julia
...
pkg> registry add https://github.com/JuliaBinaryWrappers/General#bb2/pr/1234
pkg> add Foo_jll
julia> using Foo_jll
julia> run_my_test()
KristofferC commented 3 weeks ago

I don't think there is any support att all for branches in the regsitry and it just sets the URL field as that string:

https://github.com/JuliaLang/Pkg.jl/blob/4e43058c264e0117478f901e36b2be563418f7d3/src/REPLMode/argument_parsers.jl#L199-L200