Summary
--@rules_rust//rust/settings:pipelined_compilation currently runs rustc --emit=metadata,link and kills the process when the .rmeta artifact is written. This is fragile (races rustc's output), doesn't match Buck2's implementation, and leaves dep-info/incremental steps unrun.
The new implementation runs rustc -Zno-codegen --emit=link=<path> to completion, producing a Buck2-style hollow rlib. Since -Zno-codegen is unstable, this requires RUSTC_BOOTSTRAP=1 on the pipelined actions (set automatically; must be set on both metadata and full actions because it participates in SVH).
See PR #3870.
Change
A new incompatible flag incompatible_use_unstable_no_codegen_for_pipelining has been introduced (defaulting to false) that switches the pipelining implementation to -Zno-codegen/hollow-rlib and sets RUSTC_BOOTSTRAP=1 on pipelined actions.
Only has an effect when pipelined_compilation is also enabled.
Migration
Opt in with:
--@rules_rust//rust/settings:incompatible_use_unstable_no_codegen_for_pipelining=true
If you cannot adopt RUSTC_BOOTSTRAP=1, leave this flag false until the old path is removed, or disable pipelined_compilation.
Summary
--@rules_rust//rust/settings:pipelined_compilationcurrently runsrustc --emit=metadata,linkand kills the process when the.rmetaartifact is written. This is fragile (races rustc's output), doesn't match Buck2's implementation, and leaves dep-info/incremental steps unrun.The new implementation runs
rustc -Zno-codegen --emit=link=<path>to completion, producing a Buck2-style hollow rlib. Since-Zno-codegenis unstable, this requiresRUSTC_BOOTSTRAP=1on the pipelined actions (set automatically; must be set on both metadata and full actions because it participates in SVH).See PR #3870.
Change
A new incompatible flag
incompatible_use_unstable_no_codegen_for_pipelininghas been introduced (defaulting tofalse) that switches the pipelining implementation to-Zno-codegen/hollow-rlib and setsRUSTC_BOOTSTRAP=1on pipelined actions.Only has an effect when
pipelined_compilationis also enabled.Migration
Opt in with:
If you cannot adopt
RUSTC_BOOTSTRAP=1, leave this flagfalseuntil the old path is removed, or disablepipelined_compilation.