Skip to content

Commit 7a8e085

Browse files
committed
Also distribute cargo clippy
1 parent 68620b1 commit 7a8e085

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/bootstrap/dist.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ impl Step for Clippy {
12211221
let tmp = tmpdir(builder);
12221222
let image = tmp.join("clippy-image");
12231223
drop(fs::remove_dir_all(&image));
1224-
t!(fs::create_dir_all(&image));
1224+
builder.create_dir(&image);
12251225

12261226
// Prepare the image directory
12271227
// We expect clippy to build, because we've exited this step above if tool
@@ -1230,8 +1230,13 @@ impl Step for Clippy {
12301230
compiler: builder.compiler(stage, builder.config.build),
12311231
target, extra_features: Vec::new()
12321232
}).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?;
1233+
let cargoclippy = builder.ensure(tool::CargoClippy {
1234+
compiler: builder.compiler(stage, builder.config.build),
1235+
target, extra_features: Vec::new()
1236+
}).or_else(|| { println!("Unable to build cargo clippy, skipping dist"); None })?;
12331237

12341238
builder.install(&clippy, &image.join("bin"), 0o755);
1239+
builder.install(&cargoclippy, &image.join("bin"), 0o755);
12351240
let doc = image.join("share/doc/clippy");
12361241
builder.install(&src.join("README.md"), &doc, 0o644);
12371242
builder.install(&src.join("LICENSE"), &doc, 0o644);

src/bootstrap/tool.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,14 @@ macro_rules! tool_extended {
584584

585585
tool_extended!((self, builder),
586586
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {};
587+
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {
588+
// Clippy depends on procedural macros (serde), which requires a full host
589+
// compiler to be available, so we need to depend on that.
590+
builder.ensure(compile::Rustc {
591+
compiler: self.compiler,
592+
target: builder.config.build,
593+
});
594+
};
587595
Clippy, clippy, "src/tools/clippy", "clippy-driver", {
588596
// Clippy depends on procedural macros (serde), which requires a full host
589597
// compiler to be available, so we need to depend on that.

0 commit comments

Comments
 (0)