-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustbuild: print out env vars on verbose rustc invocations #82403
rustbuild: print out env vars on verbose rustc invocations #82403
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Can you double check that this allows running the rustc command x.py prints without getting "variable not set" errors? |
…vocations. Fix issue 38686. (update: placated tidy.)
3bc06e9
to
9fafffd
Compare
@jyn514 it won't work out of the box, the output isn't parsable by a shell script in the manner it is currently printed. Do you just mean "double-check that this is a sufficiently large set of environment variables for a typical case" ? I can do that, I'm actually in the midst of doing it now, in fact. :) |
(also, if people want the output to be parsable by a shell script, I can do that too. I was following existing precedent for how the "DYLD_LIBRARY_PATH" key is printed currently (namely, with double-quotes around it), but I would be happy to revise that printing as part of this work so that the key is printed without surrounding double-quotes.) |
Yes, that's what I meant :) |
Okay. It seemed to work for me, and I didn't include any of the |
Since this worked for you locally, I'm going to go ahead and r+, since it seems like a strict improvement to me. We can continue to iterate (e.g., moving more variables over to a RUST_ prefix) over time if necessary. Thanks! @bors r+ rollup |
📌 Commit 9fafffd has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#82309 (Propagate RUSTDOCFLAGS in the environment when documenting) - rust-lang#82403 (rustbuild: print out env vars on verbose rustc invocations) - rust-lang#82507 (Rename the `tidy` binary to `rust-tidy`) - rust-lang#82531 (Add GUI tests) - rust-lang#82532 (Add `build.print_step_rusage` to config.toml) - rust-lang#82543 (fix env var name in CI) - rust-lang#82622 (Propagate `--test-args` for `x.py test src/tools/cargo`) - rust-lang#82628 (Try to clarify GlobalAlloc::realloc documentation comment.) - rust-lang#82630 (Fix a typo in the `find_anon_type` doc) - rust-lang#82643 (Add more proc-macro attribute tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Print out environment variables related to Rust on sufficiently verbose rustc invocations.
Output is filtered via heuristic of only printing environment variables whose keys start with "RUST" or "CARGO." This filtering is mostly motivated by my not caring to see e.g. "PATH" in my own output, though it is also motivated as a way to try to avoid printing out personal secrets like github keys that people might have stored in their environments for better or for worse, especially since build output is often pasted into bug reports or gists.
Fix #38686.
Click here to see sample output
Sample output looks like: