Skip to content

incompatible_use_unstable_no_codegen_for_pipelining #3977

@walter-zeromatter

Description

@walter-zeromatter

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions