-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Show files produced by --emit foo
in json artifact notifications
#122597
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Some changes occurred in compiler/rustc_codegen_gcc |
This comment has been minimized.
This comment has been minimized.
Seems reasonable. |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
973a0fb
to
50538e5
Compare
I changed the documentation a bit, now it mentions that notifications can have file of the same type mentioned several times, added support for all the files that can be emitted (I hope), changed Now I'm getting something like this:
Error messages are wrong - I'm not passing an emit path, ticket is here #122509 - I think I'll just make a fix later. Now I'm trying to figure out how to run parser from cargo-metadata on this output... |
This comment has been minimized.
This comment has been minimized.
Well, failing tests are asking to emit obj files, directly or indirectly as well as json information about artifacts. test runner finds unexpected new information about the obj files and fails. This new information is kind of the whole point of this pull request so saving this as expected output makes sense, but I'm not sure about how stable random looking parts of the name are - I don't want to introduce flaky tests. I think my options are
Went with the normalization approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind also adding this to rustc_codegen_cranelift?
The changes in this PR LGTM minus the couple of small changes below. I don't think I can approve an insta-stable change like myself this though. Maybe put it behind an unstable flag?
Is it actually producing intermediate artifacts? I didn't add it because I couldn't find any apart from
fixed
Hmm... Should we poke somebody else then? It's not really a behavior change, more like extending existing diagnostic that you have to ask specifically for with two separate flags - emit intermediates and emit artifact notifications. |
It produces object files. Bitcode doesn't exist for Cranelift (and LTO isn't supported either) |
You could ask on zulip in |
I'm still not sure where it produces those object files or how to compile and run rustc with cranelift. If you can point me at exact line/function - I'll try to add the support, otherwise - I'll pass. |
The object files for a cgu are all emitted right before
modules at
though as you have access to the Session there and object files are copied from the incr comp cache just a bit earlier in this function. By the way are you emitting artifact notifications for object files copied from the incr comp cache for the LLVM backend?
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
Okay, at least I was looking in the right file :) Added, seem to work.
Added this as well. Now I'm wondering how notifications for asm/llvm are interacting with incremental cache... |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
@bors r+ |
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
Rollup of 7 pull requests Successful merges: - rust-lang#122597 (Show files produced by `--emit foo` in json artifact notifications) - rust-lang#125886 (Migrate run make issue 15460) - rust-lang#125893 (Handle all GVN binops in a single place.) - rust-lang#125903 (rustc_span: Inline some hot functions) - rust-lang#125909 (rustdoc: add a regression test for a former blanket impl synthesis ICE) - rust-lang#125917 (Create `run-make` `env_var` and `env_var_os` helpers) - rust-lang#125919 (Remove stray "this") r? `@ghost` `@rustbot` modify labels: rollup
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#122597 (Show files produced by `--emit foo` in json artifact notifications) - rust-lang#124486 (Add tracking issue and unstable book page for `"vectorcall"` ABI) - rust-lang#125380 (Make `WHERE_CLAUSES_OBJECT_SAFETY` a regular object safety violation) - rust-lang#125690 (ARM Target Docs Update) - rust-lang#125865 (Fix ICE caused by ignoring EffectVars in type inference) - rust-lang#125893 (Handle all GVN binops in a single place.) - rust-lang#125909 (rustdoc: add a regression test for a former blanket impl synthesis ICE) - rust-lang#125918 (Revert: create const block bodies in typeck via query feeding) - rust-lang#125919 (Remove stray "this") r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#122597 (Show files produced by `--emit foo` in json artifact notifications) - rust-lang#124486 (Add tracking issue and unstable book page for `"vectorcall"` ABI) - rust-lang#125380 (Make `WHERE_CLAUSES_OBJECT_SAFETY` a regular object safety violation) - rust-lang#125690 (ARM Target Docs Update) - rust-lang#125865 (Fix ICE caused by ignoring EffectVars in type inference) - rust-lang#125893 (Handle all GVN binops in a single place.) - rust-lang#125909 (rustdoc: add a regression test for a former blanket impl synthesis ICE) - rust-lang#125918 (Revert: create const block bodies in typeck via query feeding) - rust-lang#125919 (Remove stray "this") r? `@ghost` `@rustbot` modify labels: rollup
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#122597 (Show files produced by `--emit foo` in json artifact notifications) - rust-lang#124486 (Add tracking issue and unstable book page for `"vectorcall"` ABI) - rust-lang#125690 (ARM Target Docs Update) - rust-lang#125865 (Fix ICE caused by ignoring EffectVars in type inference) - rust-lang#125893 (Handle all GVN binops in a single place.) - rust-lang#125909 (rustdoc: add a regression test for a former blanket impl synthesis ICE) - rust-lang#125918 (Revert: create const block bodies in typeck via query feeding) - rust-lang#125919 (Remove stray "this") - rust-lang#125927 (Ignore `vec_deque_alloc_error::test_shrink_to_unwind` test on non-unwind targets) r? `@ghost` `@rustbot` modify labels: rollup
☀️ Test successful - checks-actions |
Finished benchmarking commit (1689a5a): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (secondary 3.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.059s -> 673.132s (0.31%) |
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
Right now it is possible to ask
rustc
to save some intermediate representation into one or more files with--emit=foo
, but figuring out what exactly was produced is difficult. This pull request adds information aboutllvm_ir
andasm
intermediate files into notifications produced by--json=artifacts
.Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477
Motivation -
cargo-show-asm
parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35This pull request introduces a new behavior: now
rustc
will emit a new artifact notification for every artifact type user asked to--emit
, for example for--emit asm
those will include all the.s
files.Most users won't notice this behavior, to be affected by it all of the following must hold:
rustc
binary directly (whencargo
invokesrustc
- it consumes artifact notifications and doesn't emit anything)--emit xxx
and--json artifacts
save-temps
) in order not to hit --emit=llvm-bc in workspaces #88829 / Failure on subsequent builds when--emit asm
used without-C save-temps
. #89149