`incompatible_use_unstable_no_codegen_for_pipelining`

Open
#3,977 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
build-system

Research direction

Start by reading PR #3870 and tracing the pipelined_compilation implementation and the incompatible_use_unstable_no_codegen_for_pipelining setting. Verify the no-codegen/hollow-rlib path and RUSTC_BOOTSTRAP behavior for both metadata and full actions, then confirm the migration setting works as described.

Written by the indexing model from the issue text.

Description

pipelining

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.

Dominant language
Starlark
Stars
857
Forks
701
Avg merge
4d 7h
Merged PRs (30d)
46

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/rules_rust

All issues in bazelbuild/rules_rust

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.