Hi all, I want to propose adding a `rust_rmeta` tool type for toolchain definitions, and an associated target type such as `rust_metadata`.
The addition would allow us to experiment with Rust build pipelining: rlib targets may depend on a library's .rmeta instead of the complete .rlib, which in theory should be available earlier and unblock dependent build steps faster. This could enable more build parallelism even though the complete .rlibs are needed eventually (when linking a complete artifact like a binary).
Cargo uses pipelining, but it is tightly integrated with rustc. It asks rustc to pass messages over stdout for each output file, so it can call rustc once per library but start further invocations as soon as an .rmeta file is output. This approach unambiguously has build time benefits, but I don't think it's possible with ninja, or any make-like build system for that matter.
A build pipelining approach by invoking rustc twice per library may still have some benefit. The proposed GN change would enable such an experiment.
Does this sound reasonable?