about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-10-10 17:18:44 +0200
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-10-10 17:20:59 +0200
commit8e900aaa2b92fdd5adce736b512efc5517c58592 (patch)
treedbda0114e0c76b9607c0f5f57b8e64e8aee41307 /src/bootstrap
parent5f578dfad0dd5d43b28eff71a7e857d10c3f55fe (diff)
downloadrust-8e900aaa2b92fdd5adce736b512efc5517c58592.tar.gz
rust-8e900aaa2b92fdd5adce736b512efc5517c58592.zip
Enable building clippy in CI
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/check.rs9
-rw-r--r--src/bootstrap/tool.rs4
2 files changed, 9 insertions, 4 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 6e276f44668..daf965493d4 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -358,6 +358,7 @@ impl Step for Miri {
 
 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
 pub struct Clippy {
+    stage: u32,
     host: Interned<String>,
 }
 
@@ -372,6 +373,7 @@ impl Step for Clippy {
 
     fn make_run(run: RunConfig) {
         run.builder.ensure(Clippy {
+            stage: run.builder.top_stage,
             host: run.target,
         });
     }
@@ -379,10 +381,11 @@ impl Step for Clippy {
     /// Runs `cargo test` for clippy.
     fn run(self, builder: &Builder) {
         let build = builder.build;
+        let stage = self.stage;
         let host = self.host;
-        let compiler = builder.compiler(1, host);
+        let compiler = builder.compiler(stage, host);
 
-        let _clippy = builder.ensure(tool::Clippy { compiler, target: self.host });
+        let clippy = builder.ensure(tool::Clippy { compiler, target: self.host });
         let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test");
         cargo.arg("--manifest-path").arg(build.src.join("src/tools/clippy/Cargo.toml"));
 
@@ -390,6 +393,8 @@ impl Step for Clippy {
         cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
         // clippy tests need to know about the stage sysroot
         cargo.env("SYSROOT", builder.sysroot(compiler));
+        // clippy tests need to find the driver
+        cargo.env("CLIPPY_DRIVER_PATH", clippy);
 
         builder.add_rustc_lib_path(compiler, &mut cargo);
 
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index a05e58e6a22..e95a5e07436 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -387,7 +387,7 @@ pub struct Clippy {
 
 impl Step for Clippy {
     type Output = PathBuf;
-    const DEFAULT: bool = false;
+    const DEFAULT: bool = true;
     const ONLY_HOSTS: bool = true;
 
     fn should_run(run: ShouldRun) -> ShouldRun {
@@ -411,7 +411,7 @@ impl Step for Clippy {
         builder.ensure(ToolBuild {
             compiler: self.compiler,
             target: self.target,
-            tool: "clippy",
+            tool: "clippy-driver",
             mode: Mode::Librustc,
             path: "src/tools/clippy",
             expectation: builder.build.config.toolstate.clippy.passes(ToolState::Compiling),