Should cargo config get
print warning if proxy config found in git/libcurl ?
#12572
Labels
A-configuration
Area: cargo config files and env vars
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
E-medium
Experience: Medium
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Z-cargo-config
Nightly: cargo config subcommand
Problem
In #12566 it was slightly challenging to diagnose the issue as
cargo +nightly -Zunstable-options config get http.proxy
would sayerror: config value
http.proxyis not set
while proxy value was read from git configuration.Proposed Solution
cargo config get
already have logic andmaybe_env
utils function to print things like:pub fn http_proxy_exists(http: &CargoHttpConfig, config: &Config) -> bool
also exists and has a more reliable logic as to wether a proxy is set.In
pub fn get
I suggest to peak at the requested key and if it is eitherhttp
orhttp.proxy
do something similar atmaybe_env
, and print a warning like:Notes
We can even likely modify
proxy.rs
, with crate-private functions to tell us where the proxy is set and have--show-origin
works as well.The text was updated successfully, but these errors were encountered: