-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add convenience debugging for HTTP requests in Cargo #6166
Conversation
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
r? @ehuss |
An example of this for normal noop builds looks like -- https://gist.github.com/alexcrichton/fa637aa0a15eb948eb972b535d2dbc40 |
Nice! Is there any risk this may leak sensitive information like access tokens? I'd be remiss if I asked someone to post it to help debug something and it included too much info. |
Ah yes there is indeed! In general though I think that's largely only applicable to the registry calls which are rarely the ones being debugged. Do you think though a blurb in the docs would be good enough to warn against this? |
Yea, I think that is plenty sufficient! |
This is something we probably should have added long long ago given the number of network issues that arise over time. This adds a new configuration setting for Cargo, `http.debug`, which activates curl's `verbose` interface which prints out information like redirects and headers flying back and forth. This is by default routed through Cargo's normal debug logging facilities, meaning one way to use this could be: CARGO_HTTP_DEBUG=true \ RUST_LOG=cargo::ops::registry \ cargo build and you should get lots of nice verbose logs as a result! This should hopefully make it much easier to remotely debug HTTP issues as we can in theory do a lot less guessing and a lot more manual inspection.
cd9f483
to
ba37581
Compare
Updated! |
@bors r+ |
📌 Commit ba37581 has been approved by |
Add convenience debugging for HTTP requests in Cargo This is something we probably should have added long long ago given the number of network issues that arise over time. This adds a new configuration setting for Cargo, `http.debug`, which activates curl's `verbose` interface which prints out information like redirects and headers flying back and forth. This is by default routed through Cargo's normal debug logging facilities, meaning one way to use this could be: CARGO_HTTP_DEBUG=true \ RUST_LOG=cargo::ops::registry \ cargo build and you should get lots of nice verbose logs as a result! This should hopefully make it much easier to remotely debug HTTP issues as we can in theory do a lot less guessing and a lot more manual inspection.
☀️ Test successful - status-appveyor, status-travis |
This is something we probably should have added long long ago given the
number of network issues that arise over time. This adds a new
configuration setting for Cargo,
http.debug
, which activates curl'sverbose
interface which prints out information like redirects andheaders flying back and forth. This is by default routed through Cargo's
normal debug logging facilities, meaning one way to use this could be:
and you should get lots of nice verbose logs as a result! This should
hopefully make it much easier to remotely debug HTTP issues as we can in
theory do a lot less guessing and a lot more manual inspection.