about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-11 21:54:44 +0000
committerbors <bors@rust-lang.org>2018-07-11 21:54:44 +0000
commit4ba5ff4d3020ed0de7da8f976204342a2102fdf1 (patch)
treea7623939b909d4eb585bd42c864d4684c5d13261 /src/bootstrap
parent704af2d7e1474ba60a0b70a5aa78e29905abb4e1 (diff)
parent0fc61be68efe6b3419989c62c284c408368b2ea4 (diff)
downloadrust-4ba5ff4d3020ed0de7da8f976204342a2102fdf1.tar.gz
rust-4ba5ff4d3020ed0de7da8f976204342a2102fdf1.zip
Auto merge of #52172 - oli-obk:clippy_in_rls, r=nrc
Inject clippy into the rls again

Also makes sure we actually point to the local rustfmt

r? @nrc

cc @Manishearth
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/dist.rs7
-rw-r--r--src/bootstrap/tool.rs16
2 files changed, 22 insertions, 1 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index e4fbabdf231..ca804abd26a 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -1229,7 +1229,7 @@ impl Step for Clippy {
         let tmp = tmpdir(builder);
         let image = tmp.join("clippy-image");
         drop(fs::remove_dir_all(&image));
-        t!(fs::create_dir_all(&image));
+        builder.create_dir(&image);
 
         // Prepare the image directory
         // We expect clippy to build, because we've exited this step above if tool
@@ -1238,8 +1238,13 @@ impl Step for Clippy {
             compiler: builder.compiler(stage, builder.config.build),
             target, extra_features: Vec::new()
         }).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?;
+        let cargoclippy = builder.ensure(tool::CargoClippy {
+            compiler: builder.compiler(stage, builder.config.build),
+            target, extra_features: Vec::new()
+        }).or_else(|| { println!("Unable to build cargo clippy, skipping dist"); None })?;
 
         builder.install(&clippy, &image.join("bin"), 0o755);
+        builder.install(&cargoclippy, &image.join("bin"), 0o755);
         let doc = image.join("share/doc/clippy");
         builder.install(&src.join("README.md"), &doc, 0o644);
         builder.install(&src.join("LICENSE"), &doc, 0o644);
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index b3d7b9a91ec..42c65b750d3 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -584,6 +584,14 @@ macro_rules! tool_extended {
 
 tool_extended!((self, builder),
     Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {};
+    CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {
+        // Clippy depends on procedural macros (serde), which requires a full host
+        // compiler to be available, so we need to depend on that.
+        builder.ensure(compile::Rustc {
+            compiler: self.compiler,
+            target: builder.config.build,
+        });
+    };
     Clippy, clippy, "src/tools/clippy", "clippy-driver", {
         // Clippy depends on procedural macros (serde), which requires a full host
         // compiler to be available, so we need to depend on that.
@@ -594,6 +602,14 @@ tool_extended!((self, builder),
     };
     Miri, miri, "src/tools/miri", "miri", {};
     Rls, rls, "src/tools/rls", "rls", {
+        let clippy = builder.ensure(Clippy {
+            compiler: self.compiler,
+            target: self.target,
+            extra_features: Vec::new(),
+        });
+        if clippy.is_some() {
+            self.extra_features.push("clippy".to_owned());
+        }
         builder.ensure(native::Openssl {
             target: self.target,
         });