]> git.lizzy.rs Git - rust.git/commitdiff
builder.cargo(): don't add "--target"/"--release" to cargo install
authorJohannes Nixdorf <mixi@exherbo.org>
Fri, 25 May 2018 12:04:27 +0000 (14:04 +0200)
committerJohannes Nixdorf <mixi@exherbo.org>
Thu, 31 May 2018 10:03:29 +0000 (12:03 +0200)
This is required to use builder.cargo for cargo-vendor.

src/bootstrap/builder.rs

index d8a449277abb8af81e059c6129a93586316b7aa5..c9c9c73c84af2f2097689d845df7c709cb3e2a14 100644 (file)
@@ -698,9 +698,14 @@ pub fn cargo(
         let out_dir = self.stage_out(compiler, mode);
         cargo
             .env("CARGO_TARGET_DIR", out_dir)
-            .arg(cmd)
-            .arg("--target")
-            .arg(target);
+            .arg(cmd);
+
+        if cmd != "install" {
+            cargo.arg("--target")
+                 .arg(target);
+        } else {
+            assert_eq!(target, compiler.host);
+        }
 
         // Set a flag for `check` so that certain build scripts can do less work
         // (e.g. not building/requiring LLVM).
@@ -1022,8 +1027,8 @@ pub fn cargo(
         }
 
         if self.config.rust_optimize {
-            // FIXME: cargo bench does not accept `--release`
-            if cmd != "bench" {
+            // FIXME: cargo bench/install do not accept `--release`
+            if cmd != "bench" && cmd != "install" {
                 cargo.arg("--release");
             }
         }