Skip to content

Commit 693e2ae

Browse files
committed
Remove compiler_for from dist::Clippy
1 parent 5c03710 commit 693e2ae

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
@@ -1380,7 +1380,7 @@ impl Step for RustAnalyzer {
13801380

13811381
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
13821382
pub struct Clippy {
1383-
pub build_compiler: Compiler,
1383+
pub compilers: RustcPrivateCompilers,
13841384
pub target: TargetSelection,
13851385
}
13861386

@@ -1396,25 +1396,19 @@ impl Step for Clippy {
13961396

13971397
fn make_run(run: RunConfig<'_>) {
13981398
run.builder.ensure(Clippy {
1399-
build_compiler: run.builder.compiler_for(
1400-
run.builder.top_stage,
1401-
run.builder.config.host_target,
1402-
run.target,
1403-
),
1399+
compilers: RustcPrivateCompilers::new(run.builder, run.builder.top_stage, run.target),
14041400
target: run.target,
14051401
});
14061402
}
14071403

14081404
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
14091405
let target = self.target;
1410-
let compilers =
1411-
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, target);
14121406

14131407
// Prepare the image directory
14141408
// We expect clippy to build, because we've exited this step above if tool
14151409
// state for clippy isn't testing.
1416-
let clippy = builder.ensure(tool::Clippy::from_compilers(compilers));
1417-
let cargoclippy = builder.ensure(tool::CargoClippy::from_compilers(compilers));
1410+
let clippy = builder.ensure(tool::Clippy::from_compilers(self.compilers));
1411+
let cargoclippy = builder.ensure(tool::CargoClippy::from_compilers(self.compilers));
14181412

14191413
let mut tarball = Tarball::new(builder, "clippy", &target.triple);
14201414
tarball.set_overlay(OverlayKind::Clippy);
@@ -1424,6 +1418,10 @@ impl Step for Clippy {
14241418
tarball.add_legal_and_readme_to("share/doc/clippy");
14251419
Some(tarball.generate())
14261420
}
1421+
1422+
fn metadata(&self) -> Option<StepMetadata> {
1423+
Some(StepMetadata::dist("clippy", self.target).built_by(self.compilers.build_compiler()))
1424+
}
14271425
}
14281426

14291427
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -1668,14 +1666,17 @@ impl Step for Extended {
16681666
tarballs.push(builder.ensure(Mingw { target }).expect("missing mingw"));
16691667
}
16701668

1669+
let rustc_private_compilers =
1670+
RustcPrivateCompilers::from_build_compiler(builder, compiler, target);
1671+
16711672
add_component!("rust-docs" => Docs { host: target });
16721673
// Std stage N is documented with compiler stage N
16731674
add_component!("rust-json-docs" => JsonDocs { build_compiler: target_compiler, target });
16741675
add_component!("cargo" => Cargo { build_compiler: compiler, target });
16751676
add_component!("rustfmt" => Rustfmt { build_compiler: compiler, target });
1676-
add_component!("rust-analyzer" => RustAnalyzer { compilers: RustcPrivateCompilers::from_build_compiler(builder, compiler, target), target });
1677+
add_component!("rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target });
16771678
add_component!("llvm-components" => LlvmTools { target });
1678-
add_component!("clippy" => Clippy { build_compiler: compiler, target });
1679+
add_component!("clippy" => Clippy { compilers: rustc_private_compilers, target });
16791680
add_component!("miri" => Miri { build_compiler: compiler, target });
16801681
add_component!("analysis" => Analysis { build_compiler: compiler, target });
16811682
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
@@ -1208,6 +1208,7 @@ mod snapshot {
12081208
[build] rustc 1 <host> -> cargo-fmt 2 <host>
12091209
[build] rustc 1 <host> -> clippy-driver 2 <host>
12101210
[build] rustc 1 <host> -> cargo-clippy 2 <host>
1211+
[dist] rustc 1 <host> -> clippy 2 <host>
12111212
[build] rustc 1 <host> -> miri 2 <host>
12121213
[build] rustc 1 <host> -> cargo-miri 2 <host>
12131214
");
@@ -1539,6 +1540,7 @@ mod snapshot {
15391540
[build] rustc 1 <host> -> cargo-fmt 2 <target1>
15401541
[build] rustc 1 <host> -> clippy-driver 2 <target1>
15411542
[build] rustc 1 <host> -> cargo-clippy 2 <target1>
1543+
[dist] rustc 1 <host> -> clippy 2 <target1>
15421544
[build] rustc 1 <host> -> miri 2 <target1>
15431545
[build] rustc 1 <host> -> cargo-miri 2 <target1>
15441546
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>

0 commit comments

Comments
 (0)