Skip to content

Commit 27362d9

Browse files
committed
Remove compiler_for from dist::Clippy
1 parent 11696ae commit 27362d9

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ impl Step for RustAnalyzer {
13711371

13721372
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
13731373
pub struct Clippy {
1374-
pub build_compiler: Compiler,
1374+
pub compilers: RustcPrivateCompilers,
13751375
pub target: TargetSelection,
13761376
}
13771377

@@ -1387,25 +1387,19 @@ impl Step for Clippy {
13871387

13881388
fn make_run(run: RunConfig<'_>) {
13891389
run.builder.ensure(Clippy {
1390-
build_compiler: run.builder.compiler_for(
1391-
run.builder.top_stage,
1392-
run.builder.config.host_target,
1393-
run.target,
1394-
),
1390+
compilers: RustcPrivateCompilers::new(run.builder, run.builder.top_stage, run.target),
13951391
target: run.target,
13961392
});
13971393
}
13981394

13991395
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
14001396
let target = self.target;
1401-
let compilers =
1402-
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, target);
14031397

14041398
// Prepare the image directory
14051399
// We expect clippy to build, because we've exited this step above if tool
14061400
// state for clippy isn't testing.
1407-
let clippy = builder.ensure(tool::Clippy::from_compilers(compilers));
1408-
let cargoclippy = builder.ensure(tool::CargoClippy::from_compilers(compilers));
1401+
let clippy = builder.ensure(tool::Clippy::from_compilers(self.compilers));
1402+
let cargoclippy = builder.ensure(tool::CargoClippy::from_compilers(self.compilers));
14091403

14101404
let mut tarball = Tarball::new(builder, "clippy", &target.triple);
14111405
tarball.set_overlay(OverlayKind::Clippy);
@@ -1415,6 +1409,10 @@ impl Step for Clippy {
14151409
tarball.add_legal_and_readme_to("share/doc/clippy");
14161410
Some(tarball.generate())
14171411
}
1412+
1413+
fn metadata(&self) -> Option<StepMetadata> {
1414+
Some(StepMetadata::dist("clippy", self.target).built_by(self.compilers.build_compiler()))
1415+
}
14181416
}
14191417

14201418
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -1659,14 +1657,17 @@ impl Step for Extended {
16591657
tarballs.push(builder.ensure(Mingw { target }).expect("missing mingw"));
16601658
}
16611659

1660+
let rustc_private_compilers =
1661+
RustcPrivateCompilers::from_build_compiler(builder, compiler, target);
1662+
16621663
add_component!("rust-docs" => Docs { host: target });
16631664
// Std stage N is documented with compiler stage N
16641665
add_component!("rust-json-docs" => JsonDocs { build_compiler: target_compiler, target });
16651666
add_component!("cargo" => Cargo { build_compiler: compiler, target });
16661667
add_component!("rustfmt" => Rustfmt { build_compiler: compiler, target });
1667-
add_component!("rust-analyzer" => RustAnalyzer { compilers: RustcPrivateCompilers::from_build_compiler(builder, compiler, target), target });
1668+
add_component!("rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target });
16681669
add_component!("llvm-components" => LlvmTools { target });
1669-
add_component!("clippy" => Clippy { build_compiler: compiler, target });
1670+
add_component!("clippy" => Clippy { compilers: rustc_private_compilers, target });
16701671
add_component!("miri" => Miri { build_compiler: compiler, target });
16711672
add_component!("analysis" => Analysis { build_compiler: compiler, target });
16721673
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ install!((self, builder, _config),
239239
};
240240
Clippy, alias = "clippy", Self::should_build(_config), IS_HOST: true, {
241241
let tarball = builder
242-
.ensure(dist::Clippy { build_compiler: self.compiler, target: self.target })
242+
.ensure(dist::Clippy { compilers: RustcPrivateCompilers::from_build_compiler(builder, self.compiler, self.target), target: self.target })
243243
.expect("missing clippy");
244244
install_sh(builder, "clippy", self.compiler.stage, Some(self.target), &tarball);
245245
};

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ mod snapshot {
11311131
[build] rustc 1 <host> -> cargo-fmt 2 <host>
11321132
[build] rustc 1 <host> -> clippy-driver 2 <host>
11331133
[build] rustc 1 <host> -> cargo-clippy 2 <host>
1134+
[dist] rustc 1 <host> -> clippy 2 <host>
11341135
[build] rustc 1 <host> -> miri 2 <host>
11351136
[build] rustc 1 <host> -> cargo-miri 2 <host>
11361137
");
@@ -1462,6 +1463,7 @@ mod snapshot {
14621463
[build] rustc 1 <host> -> cargo-fmt 2 <target1>
14631464
[build] rustc 1 <host> -> clippy-driver 2 <target1>
14641465
[build] rustc 1 <host> -> cargo-clippy 2 <target1>
1466+
[dist] rustc 1 <host> -> clippy 2 <target1>
14651467
[build] rustc 1 <host> -> miri 2 <target1>
14661468
[build] rustc 1 <host> -> cargo-miri 2 <target1>
14671469
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>

0 commit comments

Comments
 (0)