Skip to content

Commit dfc66f0

Browse files
committed
Remove compiler_for from dist::CraneliftCodegenBackend
1 parent 1f7f7f5 commit dfc66f0

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ impl Step for Miri {
14741474

14751475
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
14761476
pub struct CraneliftCodegenBackend {
1477-
pub build_compiler: Compiler,
1477+
pub compilers: RustcPrivateCompilers,
14781478
pub target: TargetSelection,
14791479
}
14801480

@@ -1498,11 +1498,7 @@ impl Step for CraneliftCodegenBackend {
14981498

14991499
fn make_run(run: RunConfig<'_>) {
15001500
run.builder.ensure(CraneliftCodegenBackend {
1501-
build_compiler: run.builder.compiler_for(
1502-
run.builder.top_stage,
1503-
run.builder.config.host_target,
1504-
run.target,
1505-
),
1501+
compilers: RustcPrivateCompilers::new(run.builder, run.builder.top_stage, run.target),
15061502
target: run.target,
15071503
});
15081504
}
@@ -1516,8 +1512,6 @@ impl Step for CraneliftCodegenBackend {
15161512
}
15171513

15181514
let target = self.target;
1519-
let compilers =
1520-
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, target);
15211515
if !target_supports_cranelift_backend(target) {
15221516
builder.info("target not supported by rustc_codegen_cranelift. skipping");
15231517
return None;
@@ -1528,6 +1522,7 @@ impl Step for CraneliftCodegenBackend {
15281522
tarball.is_preview(true);
15291523
tarball.add_legal_and_readme_to("share/doc/rustc_codegen_cranelift");
15301524

1525+
let compilers = self.compilers;
15311526
let stamp = builder.ensure(compile::CraneliftCodegenBackend { compilers });
15321527

15331528
if builder.config.dry_run() {
@@ -1557,8 +1552,8 @@ impl Step for CraneliftCodegenBackend {
15571552

15581553
fn metadata(&self) -> Option<StepMetadata> {
15591554
Some(
1560-
StepMetadata::dist("rustc_codegen_cranelift", self.build_compiler.host)
1561-
.built_by(self.build_compiler),
1555+
StepMetadata::dist("rustc_codegen_cranelift", self.target)
1556+
.built_by(self.compilers.build_compiler()),
15621557
)
15631558
}
15641559
}
@@ -1678,7 +1673,7 @@ impl Step for Extended {
16781673
add_component!("miri" => Miri { compilers: rustc_private_compilers, target });
16791674
add_component!("analysis" => Analysis { build_compiler: compiler, target });
16801675
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {
1681-
build_compiler: compiler,
1676+
compilers: rustc_private_compilers,
16821677
target
16831678
});
16841679
add_component!("llvm-bitcode-linker" => LlvmBitcodeLinker {

src/bootstrap/src/core/build_steps/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ install!((self, builder, _config),
282282
};
283283
RustcCodegenCranelift, alias = "rustc-codegen-cranelift", Self::should_build(_config), IS_HOST: true, {
284284
if let Some(tarball) = builder.ensure(dist::CraneliftCodegenBackend {
285-
build_compiler: self.compiler,
285+
compilers: RustcPrivateCompilers::new(builder, builder.top_stage, self.target),
286286
target: self.target
287287
}) {
288288
install_sh(builder, "rustc-codegen-cranelift", self.compiler.stage, Some(self.target), &tarball);

0 commit comments

Comments
 (0)