Skip to content

Commit 9895a2c

Browse files
committed
Remove compiler_for from dist::Miri
1 parent 27362d9 commit 9895a2c

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ impl Step for Clippy {
14171417

14181418
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
14191419
pub struct Miri {
1420-
pub build_compiler: Compiler,
1420+
pub compilers: RustcPrivateCompilers,
14211421
pub target: TargetSelection,
14221422
}
14231423

@@ -1433,11 +1433,7 @@ impl Step for Miri {
14331433

14341434
fn make_run(run: RunConfig<'_>) {
14351435
run.builder.ensure(Miri {
1436-
build_compiler: run.builder.compiler_for(
1437-
run.builder.top_stage,
1438-
run.builder.config.host_target,
1439-
run.target,
1440-
),
1436+
compilers: RustcPrivateCompilers::new(run.builder, run.builder.top_stage, run.target),
14411437
target: run.target,
14421438
});
14431439
}
@@ -1450,10 +1446,8 @@ impl Step for Miri {
14501446
return None;
14511447
}
14521448

1453-
let compilers =
1454-
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, self.target);
1455-
let miri = builder.ensure(tool::Miri::from_compilers(compilers));
1456-
let cargomiri = builder.ensure(tool::CargoMiri::from_compilers(compilers));
1449+
let miri = builder.ensure(tool::Miri::from_compilers(self.compilers));
1450+
let cargomiri = builder.ensure(tool::CargoMiri::from_compilers(self.compilers));
14571451

14581452
let mut tarball = Tarball::new(builder, "miri", &self.target.triple);
14591453
tarball.set_overlay(OverlayKind::Miri);
@@ -1463,6 +1457,10 @@ impl Step for Miri {
14631457
tarball.add_legal_and_readme_to("share/doc/miri");
14641458
Some(tarball.generate())
14651459
}
1460+
1461+
fn metadata(&self) -> Option<StepMetadata> {
1462+
Some(StepMetadata::dist("miri", self.target).built_by(self.compilers.build_compiler()))
1463+
}
14661464
}
14671465

14681466
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -1668,7 +1666,7 @@ impl Step for Extended {
16681666
add_component!("rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target });
16691667
add_component!("llvm-components" => LlvmTools { target });
16701668
add_component!("clippy" => Clippy { compilers: rustc_private_compilers, target });
1671-
add_component!("miri" => Miri { build_compiler: compiler, target });
1669+
add_component!("miri" => Miri { compilers: rustc_private_compilers, target });
16721670
add_component!("analysis" => Analysis { build_compiler: compiler, target });
16731671
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {
16741672
build_compiler: compiler,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ install!((self, builder, _config),
244244
install_sh(builder, "clippy", self.compiler.stage, Some(self.target), &tarball);
245245
};
246246
Miri, alias = "miri", Self::should_build(_config), IS_HOST: true, {
247-
if let Some(tarball) = builder.ensure(dist::Miri { build_compiler: self.compiler, target: self.target }) {
247+
if let Some(tarball) = builder.ensure(dist::Miri { compilers: RustcPrivateCompilers::from_build_compiler(builder, self.compiler, self.target) , target: self.target }) {
248248
install_sh(builder, "miri", self.compiler.stage, Some(self.target), &tarball);
249249
} else {
250250
// Miri is only available on nightly

src/bootstrap/src/core/builder/tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,7 @@ mod snapshot {
11341134
[dist] rustc 1 <host> -> clippy 2 <host>
11351135
[build] rustc 1 <host> -> miri 2 <host>
11361136
[build] rustc 1 <host> -> cargo-miri 2 <host>
1137+
[dist] rustc 1 <host> -> miri 2 <host>
11371138
");
11381139
}
11391140

@@ -1466,6 +1467,7 @@ mod snapshot {
14661467
[dist] rustc 1 <host> -> clippy 2 <target1>
14671468
[build] rustc 1 <host> -> miri 2 <target1>
14681469
[build] rustc 1 <host> -> cargo-miri 2 <target1>
1470+
[dist] rustc 1 <host> -> miri 2 <target1>
14691471
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>
14701472
[doc] rustc 2 <target1> -> std 2 <target1> crates=[]
14711473
");
@@ -2253,6 +2255,7 @@ mod snapshot {
22532255
[dist] rustc 2 <host> -> clippy 3 <host>
22542256
[build] rustc 2 <host> -> miri 3 <host>
22552257
[build] rustc 2 <host> -> cargo-miri 3 <host>
2258+
[dist] rustc 2 <host> -> miri 3 <host>
22562259
[dist] src <>
22572260
");
22582261
}

0 commit comments

Comments
 (0)