Skip to content

tests/ui/bootstrap/rustc_bootstap.rs fails in post-PGO/opt-dist tests #133503

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

Closed
jieyouxu opened this issue Nov 26, 2024 · 3 comments · Fixed by #134528
Closed

tests/ui/bootstrap/rustc_bootstap.rs fails in post-PGO/opt-dist tests #133503

jieyouxu opened this issue Nov 26, 2024 · 3 comments · Fixed by #134528
Assignees
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. P-high High priority T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Nov 26, 2024

No idea why it's failing in the beta bump #133447 (comment) (probably because //@ only-nightly is still active but presumably the rustc under test is a beta or something).

cc @Kobzol

@jieyouxu jieyouxu added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 26, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 26, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 26, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Nov 26, 2024

(Also I spelled "bootstrap" as "bootstap" 😆)

@Noratrieb Noratrieb added the P-high High priority label Nov 26, 2024
@Noratrieb
Copy link
Member

This blocks the current release, but it will work around it by just adding the test to the ignored list. But this should really be fixed for the next one.

@jieyouxu jieyouxu self-assigned this Nov 26, 2024
@bors bors closed this as completed in cfb7a56 Dec 23, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 23, 2024
Rollup merge of rust-lang#134528 - jieyouxu:fix-rustc-bootstrap-test, r=Kobzol

opt-dist: propagate channel info to bootstrap

Fixes rust-lang#133503.

Previously, `tests/ui/bootstrap/rustc_bootstap.rs` [sic] failed during [beta bump](rust-lang#133447 (comment)) in opt-dist tests. This is because:

- `opt-dist` tried to run `./x test` against beta-channel dist `rustc` through `bootstrap`.
- The dist build produced during the beta bump produces a `rustc` which correctly thinks that it is a beta compiler based on `src/ci/channel` info.
- `opt-dist` tries to run `./x test` on the beta `rustc` from the dist build, but without specifying channel through a synthetic `config.toml`, so `bootstrap` tells `compiletest` that we're on the `nightly` channel (by default).
- Now there's a channel mismatch: `compiletest` believes the `rustc` under test is a *nightly* rustc, but the `rustc` under test actually considers itself a *beta* rustc. This means that `//@ only-nightly` will be satisfied yet the test will fail as the *beta* rustc is not a *nightly* rustc.

This PR:

- Fixes the test failure during beta bump (i.e. rust-lang#133503) by having `opt-dist` faithfully report the channel of the dist `rustc` being tested (i.e. "beta" in a beta bump PR). This will properly make the test be ignored during beta bump as the `rustc` under test is not a *nightly* rustc.
- Fixes the test name `rustc_bootstap.rs` -> `rustc_bootstrap.rs`. No more stapping.
- Slightly adjusts the doc comment in the test to make it more clear.

I ran a try-job against the beta branch (explicitly running the opt-dist tests by modifying the job definition) with these changes in rust-lang#134131, and it appears that the try-job was [successful](rust-lang#134131 (comment)). The two commits in this PR are cherry-picked from rust-lang#134131, with the test commit slightly modified (to also adjust the test comments).

r? `@Kobzol` (or compiler or bootstrap or infra I guess?)
@weihanglo
Copy link
Member

Somehow I also need to ignore those tests to bootstrap rustc for myself 😢. But great job people you've fixed it! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. P-high High priority 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.

4 participants