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

pop-os//cosmic-protocols is not a valid repository name #258

Open
doughsay opened this issue Feb 3, 2025 · 5 comments
Open

pop-os//cosmic-protocols is not a valid repository name #258

doughsay opened this issue Feb 3, 2025 · 5 comments

Comments

@doughsay
Copy link

doughsay commented Feb 3, 2025

Steps to reproduce:

git clone git@github.com:pop-os/launcher.git
cd launcher
just build-release

Fails to build because it tries to fetch the git repo git@github.com:pop-os//cosmic-protocols which is not valid, because it has two slashes in it.

Fails with both built-in client and with CARGO_NET_GIT_FETCH_WITH_CLI=true

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/chris/.rustup

stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
rustc 1.84.1 (e71f9a9a9 2025-01-27)
@Drakulix
Copy link
Member

Drakulix commented Feb 4, 2025

This is an intended workaround for rust-lang/cargo#5478.

If recent cargo version break this, that is very unfortunate. Thanks for raising this issue

@doughsay
Copy link
Author

doughsay commented Feb 4, 2025

Yeah, that seems to be the case, just for some more info, here's the full output I get with my version of cargo:

$ cargo --version
cargo 1.84.1 (66221abde 2024-11-19)
$ cargo fetch
    Updating git repository `https://github.com/pop-os//cosmic-protocols`
warning: spurious network error (3 tries remaining): remote error: 
 pop-os//cosmic-protocols is not a valid repository name
Visit https://support.github.com/ for help; class=Net (12)
warning: spurious network error (2 tries remaining): remote error: 
 pop-os//cosmic-protocols is not a valid repository name
Visit https://support.github.com/ for help; class=Net (12)
warning: spurious network error (1 tries remaining): remote error: 
 pop-os//cosmic-protocols is not a valid repository name
Visit https://support.github.com/ for help; class=Net (12)
error: failed to load source for dependency `cosmic-client-toolkit`

Caused by:
  Unable to update https://github.com/pop-os//cosmic-protocols#d218c76b

Caused by:
  failed to fetch into: /home/chris/.cargo/git/db/cosmic-protocols-61fa4f46d3645fec

Caused by:
  revision d218c76b58c7a3b20dd5e7943f93fc306a1b81b8 not found

Caused by:
  failed to authenticate when downloading repository: git@github.com:pop-os//cosmic-protocols

  * attempted ssh-agent authentication, but no usernames succeeded: `git`

  if the git CLI succeeds then `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  remote error: 
   pop-os//cosmic-protocols is not a valid repository name
  Visit https://support.github.com/ for help; class=Net (12)

and similarly, using CARGO_NET_GIT_FETCH_WITH_CLI=true doesn't work as a workaround because github complains:

$ CARGO_NET_GIT_FETCH_WITH_CLI=true cargo fetch                 chris@ouroboros
    Updating git repository `https://github.com/pop-os//cosmic-protocols`
fatal: remote error: 
 pop-os//cosmic-protocols is not a valid repository name
Visit https://support.github.com/ for help
error: failed to load source for dependency `cosmic-client-toolkit`

Caused by:
  Unable to update https://github.com/pop-os//cosmic-protocols#d218c76b

Caused by:
  failed to fetch into: /home/chris/.cargo/git/db/cosmic-protocols-61fa4f46d3645fec

Caused by:
  revision d218c76b58c7a3b20dd5e7943f93fc306a1b81b8 not found

Caused by:
  process didn't exit successfully: `git fetch --no-tags --force --update-head-ok 'https://github.com/pop-os//cosmic-protocols' '+d218c76b58c7a3b20dd5e7943f93fc306a1b81b8:refs/commit/d218c76b58c7a3b20dd5e7943f93fc306a1b81b8'` (exit status: 128)

Trying the git command on its own:

git fetch --no-tags --force --update-head-ok 'https://github.com/pop-os//cosmic-protocols' '+d218c76b58c7a3b20dd5e7943f93fc306a1b81b8:refs/commit/d218c76b58c7a3b20dd5e7943f93fc306a1b81b8'
fatal: remote error: 
 pop-os//cosmic-protocols is not a valid repository name
Visit https://support.github.com/ for help

and now after writing all this out I realize that I don't think it's cargo that changed, it's GitHub that changed 😅 it seems GitHub no longer accepts repo names with extra slashes in them...

@yaim
Copy link

yaim commented Feb 7, 2025

I'm not sure if it has a side effect on other parts of project or not, but I could bypass the error using a git config rewrite workaround:

git config --global url."https://github.com/pop-os/".insteadOf "https://github.com/pop-os//"

I know workaround for a workaround is not the best idea 😅

@codevski
Copy link

codevski commented Mar 3, 2025

git config didnt seem to have worked for a work around :( why does cargo use urls with // ?

@yaim
Copy link

yaim commented Mar 5, 2025

@codevski it's not used by cargo, it's used in this project as a workaround for a cargo limitation referenced in #258 (comment).

Are you getting the same error after the git config? Do you know if you have configs that have conflict with this one?

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

4 participants