Skip to content

Tracking Issue for bootstrap spurious rebuilds #131726

Open
@jieyouxu

Description

@jieyouxu

This is a tracking issue for collecting spurious rebuild issues in bootstrap. Spurious rebuilds refer to rebuilds that seem unnecessary, e.g. if running ./x test run-make twice in a row without modifying any sources rebuilds cargo. Note that is this not always the case, e.g. at the time when this issue was created, mir-opt tests build a special std with mir-opt RUSTFLAGS, which will need to be rebuilt if trying to go to stage2 because a stage2 rustc will expect a stage1 "standard" std build without mir-opt RUSTFLAGS (there are other solutions to that, not in the scope of this issue).

Categories

NOTE: There is only currently one category of spurious rebuilds that I am acutely aware of, it's entirely possible to have other classes of causes for spurious rebuilds.

Differing RUSTFLAGS

While some of these issues are closed, the fixes are usually stopgap solutions.

Preventing spurious rebuilds due to differing RUSTFLAGS

To solve the class of spurious rebuilds due to differing RUSTFLAGS, we will need to properly handle them. Specifically, we need to (#131636 (comment)):

  • Centralize RUSTFLAGS handling to forbid naive "conditional" RUSTFLAGS.
  • Conditional RUSTFLAGS should be propagated to bootstrap shims using environment variable (something like IMPLICIT_RUSTFLAGS) so they can't invalidate the build cache.
  • Ensure bootstrap should never set any conditional rustflag explicitly on cargo.

Discussion

https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Mechanism.20for.20better.20RUSTFLAGS.20handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.E-needs-investigationCall for partcipation: This issues needs some investigation to determine current statusT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions