bootstrap: validate rust.codegen-backends & target.<triple>.codegen-backends#142212
bootstrap: validate rust.codegen-backends & target.<triple>.codegen-backends#142212bors merged 1 commit intorust-lang:masterfrom
rust.codegen-backends & target.<triple>.codegen-backends#142212Conversation
|
rustbot has assigned @albertlarsan68. Use |
|
This PR modifies If appropriate, please update |
| if !VALID_CODEGEN_BACKENDS.contains(&&**backend) { | ||
| let section = section(); | ||
| panic!( | ||
| "Invalid value '{backend}' for '{section}.codegen-backends'. Permitted values: {VALID_CODEGEN_BACKENDS:?}." |
There was a problem hiding this comment.
mh, I remember a PR deliberately introduce the fallthrough to the previous else if this condition fails to obtain? it was about using an out-of-tree codegen backend, I believe.
There was a problem hiding this comment.
I suspect the intent was to panic for codegen backend names starting with rustc_codegen_, while only warning for unknown backends. As written before this PR however it would only panic/warn when the name starts with rustc_codegen_ and don't check the name otherwise however.
There was a problem hiding this comment.
I am not very familiar with this part of the compiler, but, to be honest, I don't see why we should panic on an unknown backend. If I am understanding things correctly, then this will warn people about unknown codegen backends anyway.
My backend in particular does not strictly need this to function(I can override the backend using RUSTFLAGS), but I still think a warning may be better than an outright error here.
There was a problem hiding this comment.
The panic is for when we know for sure that the backend is specified wrong. Backends should never be specified with the rustc_codegen_ prefix. That is already implicitly added, so you would end up with a path like compiler/rustc_codegen_rustc_codegen_foo if you specified rustc_codegen_foo. Do note that we already panic on other invalid config options.
There was a problem hiding this comment.
I agree with everything above, I think. Panic on rustc_codegen_ prefix makes sense, but checking for known values (llvm/cranelift/gcc) is annoying for out-of-tree backends like my employer's.
rust.codegen-backends & targer.<triple>.codegen-backendsrust.codegen-backends & target.<triple>.codegen-backends
|
r? bootstrap |
Kobzol
left a comment
There was a problem hiding this comment.
Left two nits, otherwise LGTM.
|
Thanks! @bors r+ rollup |
Rollup of 11 pull requests Successful merges: - #131923 (Derive `Copy` and `Hash` for `IntErrorKind`) - #138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore) - #141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`) - #142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`) - #142237 (Detect more cases of unused_parens around types) - #142964 (Attribute rework: a parser for single attributes without arguments) - #143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself) - #143235 (Assemble const bounds via normal item bounds in old solver too) - #143261 (Feed `explicit_predicates_of` instead of `predicates_of`) - #143276 (loop match: handle opaque patterns) - #143306 (Add `track_caller` attributes to trace origen of Clippy lints) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
Rollup of 11 pull requests Successful merges: - #131923 (Derive `Copy` and `Hash` for `IntErrorKind`) - #138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore) - #141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`) - #142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`) - #142237 (Detect more cases of unused_parens around types) - #142964 (Attribute rework: a parser for single attributes without arguments) - #143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself) - #143235 (Assemble const bounds via normal item bounds in old solver too) - #143261 (Feed `explicit_predicates_of` instead of `predicates_of`) - #143276 (loop match: handle opaque patterns) - #143306 (Add `track_caller` attributes to trace origen of Clippy lints) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
Rollup merge of #142212 - GrigorenkoPV:codegens, r=Kobzol bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends` As per #142184 (comment). Closes #142184.
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#131923 (Derive `Copy` and `Hash` for `IntErrorKind`) - rust-lang#138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore) - rust-lang#141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`) - rust-lang#142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`) - rust-lang#142237 (Detect more cases of unused_parens around types) - rust-lang#142964 (Attribute rework: a parser for single attributes without arguments) - rust-lang#143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself) - rust-lang#143235 (Assemble const bounds via normal item bounds in old solver too) - rust-lang#143261 (Feed `explicit_predicates_of` instead of `predicates_of`) - rust-lang#143276 (loop match: handle opaque patterns) - rust-lang#143306 (Add `track_caller` attributes to trace origen of Clippy lints) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
As per #142184 (comment).
Closes #142184.