Remove compiler_for from dist::Miri

This commit is contained in:
Jakub Beránek 2025-08-15 20:11:45 +02:00
parent 693e2aec4e
commit 1f7f7f55a8
No known key found for this signature in database
GPG key ID: 909CD0D26483516B
3 changed files with 13 additions and 12 deletions

View file

@ -1426,7 +1426,7 @@ impl Step for Clippy {
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct Miri {
pub build_compiler: Compiler,
pub compilers: RustcPrivateCompilers,
pub target: TargetSelection,
}
@ -1442,11 +1442,7 @@ impl Step for Miri {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Miri {
build_compiler: run.builder.compiler_for(
run.builder.top_stage,
run.builder.config.host_target,
run.target,
),
compilers: RustcPrivateCompilers::new(run.builder, run.builder.top_stage, run.target),
target: run.target,
});
}
@ -1459,10 +1455,8 @@ impl Step for Miri {
return None;
}
let compilers =
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, self.target);
let miri = builder.ensure(tool::Miri::from_compilers(compilers));
let cargomiri = builder.ensure(tool::CargoMiri::from_compilers(compilers));
let miri = builder.ensure(tool::Miri::from_compilers(self.compilers));
let cargomiri = builder.ensure(tool::CargoMiri::from_compilers(self.compilers));
let mut tarball = Tarball::new(builder, "miri", &self.target.triple);
tarball.set_overlay(OverlayKind::Miri);
@ -1472,6 +1466,10 @@ impl Step for Miri {
tarball.add_legal_and_readme_to("share/doc/miri");
Some(tarball.generate())
}
fn metadata(&self) -> Option<StepMetadata> {
Some(StepMetadata::dist("miri", self.target).built_by(self.compilers.build_compiler()))
}
}
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@ -1677,7 +1675,7 @@ impl Step for Extended {
add_component!("rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target });
add_component!("llvm-components" => LlvmTools { target });
add_component!("clippy" => Clippy { compilers: rustc_private_compilers, target });
add_component!("miri" => Miri { build_compiler: compiler, target });
add_component!("miri" => Miri { compilers: rustc_private_compilers, target });
add_component!("analysis" => Analysis { build_compiler: compiler, target });
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {
build_compiler: compiler,

View file

@ -244,7 +244,7 @@ install!((self, builder, _config),
install_sh(builder, "clippy", self.compiler.stage, Some(self.target), &tarball);
};
Miri, alias = "miri", Self::should_build(_config), IS_HOST: true, {
if let Some(tarball) = builder.ensure(dist::Miri { build_compiler: self.compiler, target: self.target }) {
if let Some(tarball) = builder.ensure(dist::Miri { compilers: RustcPrivateCompilers::from_build_compiler(builder, self.compiler, self.target) , target: self.target }) {
install_sh(builder, "miri", self.compiler.stage, Some(self.target), &tarball);
} else {
// Miri is only available on nightly

View file

@ -1211,6 +1211,7 @@ mod snapshot {
[dist] rustc 1 <host> -> clippy 2 <host>
[build] rustc 1 <host> -> miri 2 <host>
[build] rustc 1 <host> -> cargo-miri 2 <host>
[dist] rustc 1 <host> -> miri 2 <host>
");
}
@ -1543,6 +1544,7 @@ mod snapshot {
[dist] rustc 1 <host> -> clippy 2 <target1>
[build] rustc 1 <host> -> miri 2 <target1>
[build] rustc 1 <host> -> cargo-miri 2 <target1>
[dist] rustc 1 <host> -> miri 2 <target1>
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>
[doc] rustc 2 <target1> -> std 2 <target1> crates=[]
");
@ -2330,6 +2332,7 @@ mod snapshot {
[dist] rustc 2 <host> -> clippy 3 <host>
[build] rustc 2 <host> -> miri 3 <host>
[build] rustc 2 <host> -> cargo-miri 3 <host>
[dist] rustc 2 <host> -> miri 3 <host>
[dist] src <>
");
}