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

Bootstrap test ci_rustc_if_unchanged_logic fails locally #138239

Open
ehuss opened this issue Mar 8, 2025 · 5 comments · May be fixed by #138245
Open

Bootstrap test ci_rustc_if_unchanged_logic fails locally #138239

ehuss opened this issue Mar 8, 2025 · 5 comments · May be fixed by #138245
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@ehuss
Copy link
Contributor

ehuss commented Mar 8, 2025

Summary

The test ci_rustc_if_unchanged_logic fails if you are working on a branch that has any changes to library or compiler with:

---- core::builder::tests::ci_rustc_if_unchanged_logic stdout ----
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
Building stage2 library artifacts (x86_64-unknown-linux-gnu)

thread 'core::builder::tests::ci_rustc_if_unchanged_logic' panicked at src/bootstrap/src/core/builder/tests.rs:267:9:
CI-rustc can't be used with 'if-unchanged' while there are changes in compiler and/or library.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    core::builder::tests::ci_rustc_if_unchanged_logic

This makes it difficult to run tests locally. For example, running the x86_64-gnu docker image fails with this message.

I'm not entirely clear how this test works in CI, but it would be helpful if it didn't fail for local testing.

Command used

./x test bootstrap

or

 cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu

Expected behaviour

Command should pass.

Actual behaviour

Test fails.

Bootstrap configuration (config.toml)

No config (use all defaults), or use the config in the x86_64-gnu image.

Operating system

Any

HEAD

39d5d92

@ehuss ehuss added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 8, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 8, 2025
@onur-ozkan onur-ozkan added A-download-rustc Area: The `rust.download-rustc` build option. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 8, 2025
@onur-ozkan
Copy link
Member

The error message is pretty clear and it should never trigger when you have changes on compiler or library tree. I tried to reproduce it by adding dummy commit on compiler tree but x test bootstrap still did not fail.

@ehuss
Copy link
Contributor Author

ehuss commented Mar 8, 2025

Hm, the following exact steps fail for me:

git clone https://github.com/rust-lang/rust.git
cd rust
git checkout -b bootstrap-test
echo "// test" >> library/std/src/lib.rs
git add library/std/src/lib.rs
git commit -m test
./x test bootstrap

Does that not fail for you?

@onur-ozkan
Copy link
Member

That failed, yeah. I think the reason is that we allow using ci-rustc in non-CI environments when the library changes but the compiler doesn't (to make library development easier). I will stabilize the test and send a fix PR in couple minutes.

@onur-ozkan
Copy link
Member

If you can confirm that #138245 fixes this issue, that would be great.

@ehuss
Copy link
Contributor Author

ehuss commented Mar 8, 2025

Yea, that works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-download-rustc Area: The `rust.download-rustc` build option. 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.

3 participants