Skip to content

rust.codegen-backends interacts confusingly with paths #109610

Closed
@jyn514

Description

@jyn514

I tried this code:

x build rustc_codegen_cranelift

I expected this to happen: Bootstrap builds cranelift, since I named it explicitly.
Instead, this happened: Nothing, since I didn't have cranelift configured in codegen-backends:

rust/src/bootstrap/compile.rs

Lines 998 to 1009 in ce6adcc

impl Step for CodegenBackend {
type Output = ();
const ONLY_HOSTS: bool = true;
// Only the backends specified in the `codegen-backends` entry of `config.toml` are built.
const DEFAULT: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.paths(&["compiler/rustc_codegen_cranelift", "compiler/rustc_codegen_gcc"])
}
fn make_run(run: RunConfig<'_>) {
for &backend in &run.builder.config.rust_codegen_backends {

At a minimum, I would expect this to give an error or warning that I need to configure codegen-backends. It would be even nicer if we could treat codegen-backends as only controlling the defaults, instead of as a hard-off switch, like how rust.compiler-docs works. That should be possible to do by looking at the run.paths we're passed.

cc @bjorn3

Metadata

Metadata

Assignees

Labels

A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions