fix: redirect tracing output to stderr to avoid breaking PEP 517#3131
Conversation
When RUST_LOG is set, tracing output must go to stderr so it doesn't corrupt the PEP 517 protocol's stdout channel that pip relies on for metadata discovery.
tracing_subscriber::fmt::layer() defaults to stdout, which corrupts the PEP 517 protocol when RUST_LOG is set — pip reads stdout to find metadata directory names and fails when tracing lines are mixed in.
|
Thanks for the PR, I thought tracing subscriber was added years ago? |
|
Thanks for the quick review.
Maybe I've misdiagnosed exactly what the origin of the break is. The symptom which triggered this was that this CI job started failing with the latest maturin release: https://github.com/prefix-dev/pixi/actions/runs/24230829818/job/70744566427 Regardless, I think this is still the correct fix. |
|
It would be great if you can test this so we can verify it actually fixes the issue (maybe dropping |
|
I'm fairly confident this fixes the issue as dropping |
Since v1.13.0,
pip install --no-build-isolationhas been broken whenRUST_LOGis set. The tracing subscriber added in v1.13.0 usesfmt::layer(), which defaults to stdout. PEP 517 uses stdout as a structured channel (pip reads the last line to find metadata directory names) so tracing output corrupts the path.This PR fixes the issue by:
.with_writer(std::io::stderr)to the tracing subscriber setup