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

Cargo is missing the .git from the crates io repo url #8174

Closed
gilescope opened this issue Apr 28, 2020 · 3 comments
Closed

Cargo is missing the .git from the crates io repo url #8174

gilescope opened this issue Apr 28, 2020 · 3 comments
Labels
C-bug Category: bug

Comments

@gilescope
Copy link
Contributor

With the removal of CARGO_REGISTRY_INDEX we have to find another workaround for a problem we've been having living behind an enterprise proxy.

In order to escape through the proxy cargo needs to request
https://github.com/rust-lang/crates.io-index.git rather than the default of
https://github.com/rust-lang/crates.io-index.

I'm sure we can find another work-around, but I'm just wondering if the more standard thing is to have the .git on the end - I need to add that for normal personal repos that I clone, so I'm thinking that's the more standard approach?

Thoughts?

@gilescope gilescope added the C-bug Category: bug label Apr 28, 2020
@ehuss
Copy link
Contributor

ehuss commented Apr 29, 2020

AFAIK this hasn't ever come up with github or the crates.io index. I believe GitHub treats the two URLs identically. Some services, like gitlab, use a redirect, but I don't think that is relevant here.

I think it would be very risky to change it at this time, as existing setups may be depending on the exact URL, and probably not worth the churn. In the distant future we're looking at alternate ways to serve the index, so we may have to put more consideration into how to differentiate different protocols, but that's a ways off.

In terms of workarounds, one option is source replacement. Something like the following should work:

[source.crates-io-git]
registry = "https://github.com/rust-lang/crates.io-index.git"

[source.crates-io]
replace-with = "crates-io-git"

@gilescope
Copy link
Contributor Author

Yep that work around works well for us. Just thought I should mention it as others might come across the same problem.

Sent with GitHawk

@gilescope
Copy link
Contributor Author

Btw I can see that adding .git on the end changes the hash dir name that it's stored as - I can see how that might be disruptive so let's leave as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants