I decided to try using LocalRegistry.jl for some private packages we have. I created a registry and added one package to it, and that appears to have pushed correctly. However, trying to use it doesn’t appear to be working. Is it because my repo’s main branch is called main
rather than master
? Here’s how things went down.
I created LocalRegistryTest in GitHub as a bare repo. By default now, the main branch is main
.
Back over here on my local machine, I ran:
julia> using LocalRegistry
julia> create_registry("LocalRegistryTest", "git@github.com:tuckermcclure/LocalRegistryTest.git", description = "A test registry in Tucker's personal GitHub")
I have SSH keys set up so private repo stuff all just works.
I have a package called EulerParameters. I have it checked out locally, so I navigated there, activated it, imported it, and registered it:
cmd> julia --project=.
julia> using EulerParameters
julia> register(EulerParameters, branch = "main")
┌ Info: Registering package
│ package_path = "/Users/tucker/Dev/EulerParameters.jl"
│ registry_path = "/Users/tucker/.julia/registries/LocalRegistryTest"
│ package_repo = "git@github.com:[redacted]/EulerParameters.jl.git"
│ uuid = UUID("7d4c595f-83da-47b2-93f6-2989baeee392")
│ version = v"0.1.0"
│ tree_hash = "cbece3366d59efdf532e84d24a1e3391a82a2d1b"
└ subdir = ""
Switched to a new branch 'main'
Enumerating objects: 12, done.
Counting objects: 100% (12/12), done.
Delta compression using up to 10 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (12/12), 1.25 KiB | 1.25 MiB/s, done.
Total 12 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To github.com:tuckermcclure/LocalRegistryTest.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
Switched to branch 'master'
warning: deleting branch 'main' that has been merged to
'refs/remotes/origin/main', but not yet merged to HEAD.
Deleted branch main (was 2ecd1c3).
That “switched to branch ‘master’” part made me a bit nervous. Just to try it out though, I started a new project somewhere and tried to add EulerParameters.
(@v1.8) pkg> activate .
Activating new project at `~/whatever`
(whatever) pkg> add EulerParameters
Updating registry at `~/.julia/registries/LocalRegistryTest`
Updating git-repo `git@github.com:tuckermcclure/LocalRegistryTest.git`
Updating registry at `~/.julia/registries/General.toml`
┌ Error: Some registries failed to update:
│ — /Users/tucker/.julia/registries/LocalRegistryTest — branch origin/master not found
└ @ Pkg.Registry /Users/administrator/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-1.0/build/default-macmini-aarch64-1-0/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Pkg/src/Registry/Registry.jl:449
ERROR: The following package names could not be resolved:
* EulerParameters (not found in project, manifest or registry)
That “branch origin/master not found” part leaves me wondering if the name master
is baked in somewhere. Did I miss a configuration step? Must the main branch be master
? Thank you for any help! I’m trying to get to a “proper” workflow for private repos in an organization.