Skip to content

Commit 5338503

Browse files
committed
Remove compiler_for from dist::CraneliftCodegenBackend
1 parent 9895a2c commit 5338503

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
@@ -1465,7 +1465,7 @@ impl Step for Miri {
14651465

14661466
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
14671467
pub struct CraneliftCodegenBackend {
1468-
pub build_compiler: Compiler,
1468+
pub compilers: RustcPrivateCompilers,
14691469
pub target: TargetSelection,
14701470
}
14711471

@@ -1489,11 +1489,7 @@ impl Step for CraneliftCodegenBackend {
14891489

14901490
fn make_run(run: RunConfig<'_>) {
14911491
run.builder.ensure(CraneliftCodegenBackend {
1492-
build_compiler: run.builder.compiler_for(
1493-
run.builder.top_stage,
1494-
run.builder.config.host_target,
1495-
run.target,
1496-
),
1492+
compilers: RustcPrivateCompilers::new(run.builder, run.builder.top_stage, run.target),
14971493
target: run.target,
14981494
});
14991495
}
@@ -1507,8 +1503,6 @@ impl Step for CraneliftCodegenBackend {
15071503
}
15081504

15091505
let target = self.target;
1510-
let compilers =
1511-
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, target);
15121506
if !target_supports_cranelift_backend(target) {
15131507
builder.info("target not supported by rustc_codegen_cranelift. skipping");
15141508
return None;
@@ -1519,6 +1513,7 @@ impl Step for CraneliftCodegenBackend {
15191513
tarball.is_preview(true);
15201514
tarball.add_legal_and_readme_to("share/doc/rustc_codegen_cranelift");
15211515

1516+
let compilers = self.compilers;
15221517
let stamp = builder.ensure(compile::CraneliftCodegenBackend { compilers });
15231518

15241519
if builder.config.dry_run() {
@@ -1548,8 +1543,8 @@ impl Step for CraneliftCodegenBackend {
15481543

15491544
fn metadata(&self) -> Option<StepMetadata> {
15501545
Some(
1551-
StepMetadata::dist("rustc_codegen_cranelift", self.build_compiler.host)
1552-
.built_by(self.build_compiler),
1546+
StepMetadata::dist("rustc_codegen_cranelift", self.target)
1547+
.built_by(self.compilers.build_compiler()),
15531548
)
15541549
}
15551550
}
@@ -1669,7 +1664,7 @@ impl Step for Extended {
16691664
add_component!("miri" => Miri { compilers: rustc_private_compilers, target });
16701665
add_component!("analysis" => Analysis { build_compiler: compiler, target });
16711666
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {
1672-
build_compiler: compiler,
1667+
compilers: rustc_private_compilers,
16731668
target
16741669
});
16751670
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)