-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Should cargo use git proxies for other http requests? #14952
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
Comments
Thank you for the issue report. The config doc of I am not seeing any reason of this design in #541. Maybe it was because crates.io registry index was mainly downloaded via Git from Cargo has sparse registry support since 1.68. If people are not using any git dependencies, it is surprising that git proxy settings affect HTTP requests for normal cargo operations. Having some possible approaches here:
|
To me, since we want to rely less on a specific external, I am a bit inclined to remove the support, though the middle ground solution is not bad at all, and is consistent when |
should keep it only for |
it seems not all |
See also #8327. |
I believe this is documented in This behavior was added in 1.51 via #8986. It was intended to work that way from the early days via #725, but it was broken at the time. The current behavior was also requested in #8327. The cargo team discussed this, and I wanted to summarize some different ideas. Background: Cargo currently chooses the proxy for both git and HTTP network traffic in priority order:
To some degree, this is done as a convenience so that you can have a single place to configure a proxy. However, as evidence from this issue it does seem like some proxies configured for git will be configured to only access certain sites, and may not be appropriate for all http traffic. Since we can't really change this in a backwards compatible way, we felt like the best approach would be to have some kind of config setting to be able to disable things in some way. This would likely be a change to the
We also discussed the possibility of showing a warning if cargo implicitly falls back to the git config, and tell the user to switch cargo's I don't know what, if any of those options we should add. There's also some consideration about how difficult the implementation would be, since the proxy choice is done at a very low-level and may be difficult to switch based on usage. |
Personally prefer this with a config enabling the old behavior. |
then every thing is fine. |
Problem
when a global git https/http proxy config is set.
cargo install will fail with the following errors:
after removing git config, cargo install will be normal again.
Steps
cargo install
Possible Solution(s)
remove git proxy config for http/https.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: