From 1f7f7f55a8b63f36d0ca91b46f2a4e0bcb606b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 15 Aug 2025 20:11:45 +0200 Subject: [PATCH] Remove `compiler_for` from `dist::Miri` --- src/bootstrap/src/core/build_steps/dist.rs | 20 +++++++++---------- src/bootstrap/src/core/build_steps/install.rs | 2 +- src/bootstrap/src/core/builder/tests.rs | 3 +++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index f6379f7e71ea..f3276ebf7311 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -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 { + 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, diff --git a/src/bootstrap/src/core/build_steps/install.rs b/src/bootstrap/src/core/build_steps/install.rs index aea54512f7c4..da3eef74b2b9 100644 --- a/src/bootstrap/src/core/build_steps/install.rs +++ b/src/bootstrap/src/core/build_steps/install.rs @@ -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 diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 2a922d5f4b8c..1646c4bd6314 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1211,6 +1211,7 @@ mod snapshot { [dist] rustc 1 -> clippy 2 [build] rustc 1 -> miri 2 [build] rustc 1 -> cargo-miri 2 + [dist] rustc 1 -> miri 2 "); } @@ -1543,6 +1544,7 @@ mod snapshot { [dist] rustc 1 -> clippy 2 [build] rustc 1 -> miri 2 [build] rustc 1 -> cargo-miri 2 + [dist] rustc 1 -> miri 2 [build] rustc 1 -> LlvmBitcodeLinker 2 [doc] rustc 2 -> std 2 crates=[] "); @@ -2330,6 +2332,7 @@ mod snapshot { [dist] rustc 2 -> clippy 3 [build] rustc 2 -> miri 3 [build] rustc 2 -> cargo-miri 3 + [dist] rustc 2 -> miri 3 [dist] src <> "); }