-
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
Don't print opt fuel messages to stdout because it breaks Rustbuild #55495
Conversation
Rustbuild passes `--message-format json` to the compiler invocations which causes JSON to be emitted on stdout. Printing optimization fuel messages to stdout breaks the json and causes Rustbuild to fail. Work around this by emitting optimization fuel related messages on stderr instead.
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
This is another instance of #43855. I'm using the same workaround as found in that issue. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors r+ |
📌 Commit a7bea73 has been approved by |
@bors r- |
Wait, some tests are failing... |
Yeah, there's a UI test that's still expecting the output on stdout. I'll fix that tonight. |
Hmm... I'm not sure what to do with this test. If I leave the Thoughts? |
Make it a compile fail test and use |
Hmm.. That doesn't seem to have done anything:
Looks like there's also some
Does the test harness not actually capture |
Let me take a look at this |
Thanks. If you can't figure it out either, I'll just close this. I don't think it's worth sinking a lot of time into. |
Well if nothing else, its making me discover things that I consider bugs. E.g. the fact that the timestamp system used by |
Ah, I see the problem. By default we expect errors to be fed via The optimization fuel stuff does not seem to be respecting that flag; instead of printing in a JSON format, it just spits to stderr. And then the json parsing subsequently throws that away, yielding an empty string for what it thinks the stderr was. I think you can get around this by adding an explicit I think I'll probably just push such a commit to this branch in a jiffy. |
…ep compiletests presumption of JSON. As a driveby, rename the stdout files to stderr, which should have been part of the earlier commit.
That's probably my fault. Is there a better way to print something to |
@bors r=nikomatsakis |
📌 Commit 22b571d has been approved by |
…ikomatsakis Don't print opt fuel messages to stdout because it breaks Rustbuild Rustbuild passes `--message-format json` to the compiler invocations which causes JSON to be emitted on stdout. Printing optimization fuel messages to stdout breaks the json and causes Rustbuild to fail. Work around this by emitting optimization fuel related messages on stderr instead.
Hmm, are there more like these? Does |
@eddyb rust/src/librustc/session/code_stats.rs Line 83 in 8315b11
|
@wesleywiser I think that should get changed too, then. |
Rollup of 14 pull requests Successful merges: - #55377 (Slight copy-editing for `std::cell::Cell` docs) - #55441 (Remove unused re import in gdb_rust_pretty_printing) - #55453 (Choose predicates without inference variables over those with them) - #55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild) - #55501 (Make `process_obligations`' computation of `completed` optional.) - #55510 (Fix feature gate only being checked on first repr attr.) - #55609 (Run name-anon-globals after LTO passes as well) - #55645 (do not print wrapping ranges like normal ranges in validity diagnostics) - #55688 (Standardised names and location of ui issue tests) - #55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n") - #55702 (Add `aarch64-pc-windows-msvc` to deployed targets) - #55728 (Update lldb) - #55730 (Use trait impl method span when type param mismatch is due to impl Trait) - #55734 (refactor: use shorthand fields)
Rollup of 14 pull requests Successful merges: - rust-lang#55377 (Slight copy-editing for `std::cell::Cell` docs) - rust-lang#55441 (Remove unused re import in gdb_rust_pretty_printing) - rust-lang#55453 (Choose predicates without inference variables over those with them) - rust-lang#55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild) - rust-lang#55501 (Make `process_obligations`' computation of `completed` optional.) - rust-lang#55510 (Fix feature gate only being checked on first repr attr.) - rust-lang#55609 (Run name-anon-globals after LTO passes as well) - rust-lang#55645 (do not print wrapping ranges like normal ranges in validity diagnostics) - rust-lang#55688 (Standardised names and location of ui issue tests) - rust-lang#55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n") - rust-lang#55702 (Add `aarch64-pc-windows-msvc` to deployed targets) - rust-lang#55728 (Update lldb) - rust-lang#55730 (Use trait impl method span when type param mismatch is due to impl Trait) - rust-lang#55734 (refactor: use shorthand fields)
Rustbuild passes
--message-format json
to the compiler invocationswhich causes JSON to be emitted on stdout. Printing optimization fuel
messages to stdout breaks the json and causes Rustbuild to fail.
Work around this by emitting optimization fuel related messages on
stderr instead.