builder.cargo(): don't add "--target"/"--release" to cargo install
This is required to use builder.cargo for cargo-vendor.
This commit is contained in:
@@ -698,9 +698,14 @@ impl<'a> Builder<'a> {
|
|||||||
let out_dir = self.stage_out(compiler, mode);
|
let out_dir = self.stage_out(compiler, mode);
|
||||||
cargo
|
cargo
|
||||||
.env("CARGO_TARGET_DIR", out_dir)
|
.env("CARGO_TARGET_DIR", out_dir)
|
||||||
.arg(cmd)
|
.arg(cmd);
|
||||||
.arg("--target")
|
|
||||||
.arg(target);
|
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
|
// Set a flag for `check` so that certain build scripts can do less work
|
||||||
// (e.g. not building/requiring LLVM).
|
// (e.g. not building/requiring LLVM).
|
||||||
@@ -1022,8 +1027,8 @@ impl<'a> Builder<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if self.config.rust_optimize {
|
if self.config.rust_optimize {
|
||||||
// FIXME: cargo bench does not accept `--release`
|
// FIXME: cargo bench/install do not accept `--release`
|
||||||
if cmd != "bench" {
|
if cmd != "bench" && cmd != "install" {
|
||||||
cargo.arg("--release");
|
cargo.arg("--release");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user