Skip to content

Conversation

GuillaumeGomez
Copy link
Member

It fixes a bug we encountered in our last GCC backend sync: https://github.com/rust-lang/rustc_codegen_gcc/actions/runs/17214525469/job/48834700055?pr=753#step:18:595

In short, we used to have in bootstrap.toml an empty rust.codegen-backends = [], triggering the unwrap. We fixed it in rust-lang/rustc_codegen_gcc@ad99858.

r? @Kobzol

@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2025

Kobzol is not on the review rotation at the moment.
They may take a while to respond.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 26, 2025
@Kobzol
Copy link
Member

Kobzol commented Aug 26, 2025

Hmm, having the array empty should IMO be treated as wrong configuration. But treating that as having a LLVM default is probably fine. But we should then uphold that default everywhere. Please move the .unwrap_or(&CodegenBackendKind::Llvm) part to default_codegen_backend and make it return the codegen backend directly, without Option.

Then you can r=me.

@GuillaumeGomez
Copy link
Member Author

I was thinking about erroring early on but wasn't sure it was better or not. I would prefer this solution though if you're fine with it.

@Kobzol
Copy link
Member

Kobzol commented Aug 26, 2025

Yeah, fine by me, just move it inside the shared function to make it consistent across bootstrap.

@GuillaumeGomez GuillaumeGomez force-pushed the bootstrap-codegen-backends branch from d2ff920 to 2261968 Compare August 26, 2025 15:13
@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2025

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@GuillaumeGomez
Copy link
Member Author

Sure, done!

@Kobzol
Copy link
Member

Kobzol commented Aug 26, 2025

Thanks, you can r=me once CI is green.

@GuillaumeGomez
Copy link
Member Author

@bors r=Kobzol rollup

@bors
Copy link
Collaborator

bors commented Aug 26, 2025

📌 Commit 2261968 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2025
bors added a commit that referenced this pull request Aug 26, 2025
Rollup of 9 pull requests

Successful merges:

 - #144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`)
 - #145790 (Improve dist for gnullvm hosts)
 - #145792 (Use attribute name in message for "outer attr used as inner attr" errors)
 - #145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags)
 - #145876 (Enable building/disting standard library in stage 0)
 - #145887 (bootstrap: Don't panic if codegen-backends is set to empty)
 - #145888 (platform-support: Fix LoongArch32 host column)
 - #145892 (add a flag to codegen fn attrs for foreign items)
 - #145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e84b354 into rust-lang:master Aug 27, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 27, 2025
rust-timer added a commit that referenced this pull request Aug 27, 2025
Rollup merge of #145887 - GuillaumeGomez:bootstrap-codegen-backends, r=Kobzol

bootstrap: Don't panic if codegen-backends is set to empty

It fixes a bug we encountered in our last GCC backend sync: https://github.com/rust-lang/rustc_codegen_gcc/actions/runs/17214525469/job/48834700055?pr=753#step:18:595

In short, we used to have in `bootstrap.toml` an empty `rust.codegen-backends = []`, triggering the `unwrap`. We fixed it in rust-lang/rustc_codegen_gcc@ad99858.

r? `@Kobzol`
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 27, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`)
 - rust-lang/rust#145790 (Improve dist for gnullvm hosts)
 - rust-lang/rust#145792 (Use attribute name in message for "outer attr used as inner attr" errors)
 - rust-lang/rust#145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags)
 - rust-lang/rust#145876 (Enable building/disting standard library in stage 0)
 - rust-lang/rust#145887 (bootstrap: Don't panic if codegen-backends is set to empty)
 - rust-lang/rust#145888 (platform-support: Fix LoongArch32 host column)
 - rust-lang/rust#145892 (add a flag to codegen fn attrs for foreign items)
 - rust-lang/rust#145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
@GuillaumeGomez GuillaumeGomez deleted the bootstrap-codegen-backends branch August 27, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants