Skip to content

Commit ff8f226

Browse files
committed
builder.cargo(): don't add "--target"/"--release" to cargo install
This is required to use builder.cargo for cargo-vendor.
1 parent 81687c4 commit ff8f226

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/bootstrap/builder.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,14 @@ impl<'a> Builder<'a> {
698698
let out_dir = self.stage_out(compiler, mode);
699699
cargo
700700
.env("CARGO_TARGET_DIR", out_dir)
701-
.arg(cmd)
702-
.arg("--target")
703-
.arg(target);
701+
.arg(cmd);
702+
703+
if cmd != "install" {
704+
cargo.arg("--target")
705+
.arg(target);
706+
} else {
707+
assert_eq!(target, compiler.host);
708+
}
704709

705710
// Set a flag for `check` so that certain build scripts can do less work
706711
// (e.g. not building/requiring LLVM).
@@ -1022,8 +1027,8 @@ impl<'a> Builder<'a> {
10221027
}
10231028

10241029
if self.config.rust_optimize {
1025-
// FIXME: cargo bench does not accept `--release`
1026-
if cmd != "bench" {
1030+
// FIXME: cargo bench/install do not accept `--release`
1031+
if cmd != "bench" && cmd != "install" {
10271032
cargo.arg("--release");
10281033
}
10291034
}

0 commit comments

Comments
 (0)