Skip to content

Commit 1f7f7f5

Browse files
committed
Remove compiler_for from dist::Miri
1 parent 693e2ae commit 1f7f7f5

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
@@ -1426,7 +1426,7 @@ impl Step for Clippy {
14261426

14271427
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
14281428
pub struct Miri {
1429-
pub build_compiler: Compiler,
1429+
pub compilers: RustcPrivateCompilers,
14301430
pub target: TargetSelection,
14311431
}
14321432

@@ -1442,11 +1442,7 @@ impl Step for Miri {
14421442

14431443
fn make_run(run: RunConfig<'_>) {
14441444
run.builder.ensure(Miri {
1445-
build_compiler: run.builder.compiler_for(
1446-
run.builder.top_stage,
1447-
run.builder.config.host_target,
1448-
run.target,
1449-
),
1445+
compilers: RustcPrivateCompilers::new(run.builder, run.builder.top_stage, run.target),
14501446
target: run.target,
14511447
});
14521448
}
@@ -1459,10 +1455,8 @@ impl Step for Miri {
14591455
return None;
14601456
}
14611457

1462-
let compilers =
1463-
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, self.target);
1464-
let miri = builder.ensure(tool::Miri::from_compilers(compilers));
1465-
let cargomiri = builder.ensure(tool::CargoMiri::from_compilers(compilers));
1458+
let miri = builder.ensure(tool::Miri::from_compilers(self.compilers));
1459+
let cargomiri = builder.ensure(tool::CargoMiri::from_compilers(self.compilers));
14661460

14671461
let mut tarball = Tarball::new(builder, "miri", &self.target.triple);
14681462
tarball.set_overlay(OverlayKind::Miri);
@@ -1472,6 +1466,10 @@ impl Step for Miri {
14721466
tarball.add_legal_and_readme_to("share/doc/miri");
14731467
Some(tarball.generate())
14741468
}
1469+
1470+
fn metadata(&self) -> Option<StepMetadata> {
1471+
Some(StepMetadata::dist("miri", self.target).built_by(self.compilers.build_compiler()))
1472+
}
14751473
}
14761474

14771475
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -1677,7 +1675,7 @@ impl Step for Extended {
16771675
add_component!("rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target });
16781676
add_component!("llvm-components" => LlvmTools { target });
16791677
add_component!("clippy" => Clippy { compilers: rustc_private_compilers, target });
1680-
add_component!("miri" => Miri { build_compiler: compiler, target });
1678+
add_component!("miri" => Miri { compilers: rustc_private_compilers, target });
16811679
add_component!("analysis" => Analysis { build_compiler: compiler, target });
16821680
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {
16831681
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
@@ -1211,6 +1211,7 @@ mod snapshot {
12111211
[dist] rustc 1 <host> -> clippy 2 <host>
12121212
[build] rustc 1 <host> -> miri 2 <host>
12131213
[build] rustc 1 <host> -> cargo-miri 2 <host>
1214+
[dist] rustc 1 <host> -> miri 2 <host>
12141215
");
12151216
}
12161217

@@ -1543,6 +1544,7 @@ mod snapshot {
15431544
[dist] rustc 1 <host> -> clippy 2 <target1>
15441545
[build] rustc 1 <host> -> miri 2 <target1>
15451546
[build] rustc 1 <host> -> cargo-miri 2 <target1>
1547+
[dist] rustc 1 <host> -> miri 2 <target1>
15461548
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>
15471549
[doc] rustc 2 <target1> -> std 2 <target1> crates=[]
15481550
");
@@ -2330,6 +2332,7 @@ mod snapshot {
23302332
[dist] rustc 2 <host> -> clippy 3 <host>
23312333
[build] rustc 2 <host> -> miri 3 <host>
23322334
[build] rustc 2 <host> -> cargo-miri 3 <host>
2335+
[dist] rustc 2 <host> -> miri 3 <host>
23332336
[dist] src <>
23342337
");
23352338
}

0 commit comments

Comments
 (0)