Description
Problem
You can pass --json=artifacts
to rustc
and it will emit json messages like {"$message_type":"artifact","artifact":"/path/to/target/release/deps/libsample-fb5d74408737397e.rlib","emit":"link"}
to stderr
.
cargo
then parses them and mostly ignores:
cargo/src/cargo/core/compiler/mod.rs
Lines 1803 to 1810 in a59aba1
later emitting its own version:
cargo/src/cargo/core/compiler/mod.rs
Line 563 in a59aba1
I'm extending --json=artifacts
in rustc
to include files produced by --emit
(rust-lang/rust#122597) to avoid doing fragile guesswork in cargo-show-asm
, but right now this information won't be accessible when rustc
is invoked via cargo
.
Proposed Solution
cargo
should collect this information when present and output it as part of its own notifications, including cases where rustc
wasn't actually invoked if source files staid the same.
Notes
The alternative is for me to invoke rustc
directly - fragile or to do nothing - currently I have to pass codegen-units=1
- potentially confusing behavior.
If approved - I can look into implementing required change myself.