Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"x.py check" dirties the build cache for "x.py build" #120768

Closed
RalfJung opened this issue Feb 8, 2024 · 4 comments · Fixed by #120803
Closed

"x.py check" dirties the build cache for "x.py build" #120768

RalfJung opened this issue Feb 8, 2024 · 4 comments · Fixed by #120803
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@RalfJung
Copy link
Member

RalfJung commented Feb 8, 2024

To reproduce, run

./x.py test ui --test-args pat
./x.py check compiler/rustc
./x.py test ui --test-args pat

The last command should finish immediately and not do any work. This worked fine until a few weeks ago.

However, now, this leads to rebuilds:

$ ./x.py test ui --test-args pat --bless
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.02s
Building stage0 library artifacts (x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.07s
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
   Compiling psm v0.1.21
   Compiling rustc_llvm v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_llvm)
   Compiling stacker v0.1.15
   Compiling rustc_data_structures v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_data_structures)
   Compiling rustc_span v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_span)
   Compiling rustc_abi v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_abi)
   Compiling rustc_type_ir v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_type_ir)
   Compiling rustc_feature v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_feature)
   Compiling rustc_error_messages v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_error_messages)
   Compiling rustc_target v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_target)
   Compiling rustc_ast v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_ast)
   Compiling rustc_next_trait_solver v0.0.0 (/home/r/src/rust/rustc/compiler/rustc_next_trait_solver)

I don't know what this "psm" crate it but it seems to be where the problem starts.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 8, 2024
@Zalathar
Copy link
Contributor

Zalathar commented Feb 8, 2024

I tried bisecting this behaviour, and it seems to have been introduced by #120060.

@RalfJung
Copy link
Member Author

RalfJung commented Feb 8, 2024

Cc @saethlin

@Zalathar
Copy link
Contributor

Zalathar commented Feb 8, 2024

Perhaps configure_linker not being called in check builds has something to do this. If Cargo ends up seeing different environment variables, maybe it decides to invalidate its caches even though those variables (theoretically) shouldn't matter for a check build.

@fmease fmease added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 8, 2024
@onur-ozkan
Copy link
Member

cross-ref to the reason of this issue: #120060 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants