GunnarFarneback/LocalRegistry.jl

repo path varies for different users when registering a new package

mmiller-max opened this issue · 3 comments

When I register a package, the Package.toml entry in the private registry looks like this:

name = "PackageName"
uuid = "--"
repo = "ssh://git@url.git"
subdir = "libs/PackageName"

When a different user does it, it looks likes this

name = "PackageName"
uuid = "--"
repo = "ssh://url.git"
subdir = "libs/PackageName"

The missing git@ in the repo url causes the following error when trying to add the package

Cloning [--] PackageName from ssh://../.git
ERROR: LoadError: failed to clone from ssh://../.git, error: GitError(Code:EAUTH, Class:None, No errors)

Which can be worked around by

Pkg.GitTools.setprotocol!(domain="registry/domain", protocol="ssh",user="user")

The question is why is there a different in the repo path? Is this a bug or is it something in git credentials/how the original repository was cloned?

UPDATE: this is pulled from the repository settings it seems. Is there a way we can flag this up when registering a package or do something to prevent the above error happening?

Yes, by default the repo address is found by querying the git remote of the package when you register it the first time. If you want it set to something else, use the repo keyword argument of register.

This is documented in the docstring, so I don't see anything actionable here.

That's great, thanks @GunnarFarneback