Skip to content

Commit 0dd894b

Browse files
authored
Merge pull request #323 from ehuss/no-default-target
Do not unconditionally set the target.
2 parents a9df9fe + a0dd61c commit 0dd894b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

guide/src/examples/rustdoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set -e
2121

2222
cargo doc
2323

24-
grep "some example text" $CARGO_TARGET_DIR/$CARGO_BUILD_TARGET/doc/mycrate/fn.foo.html
24+
grep "some example text" $CARGO_TARGET_DIR/doc/mycrate/fn.foo.html
2525
```
2626

2727
This can be used with the `--script` option:

guide/src/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ COUNT=`echo "$OUTPUT" | grep -c "unnecessary parentheses"`
106106
test $COUNT -eq 1
107107
```
108108

109-
If you need to use the targets directly without using `cargo` in the script, they are available in `$CARGO_TARGET_DIR/$CARGO_BUILD_TARGET/[release|debug]/...`, since `cargo-bisect-rustc` sets `$CARGO_TARGET_DIR` and `$CARGO_BUILD_TARGET`.
109+
If you need to use the targets directly without using `cargo` in the script, they are available in `$CARGO_TARGET_DIR/[release|debug]/...`, since `cargo-bisect-rustc` sets `$CARGO_TARGET_DIR`.
110110

111111
Check out the [examples chapters](examples/index.md) for several examples of how to use this option.

src/toolchains.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ impl Toolchain {
288288
};
289289
cmd.current_dir(&cfg.args.test_dir);
290290
cmd.env("CARGO_TARGET_DIR", format!("target-{}", self.rustup_name()));
291-
cmd.env("CARGO_BUILD_TARGET", &cfg.target);
291+
if let Some(target) = &cfg.args.target {
292+
cmd.env("CARGO_BUILD_TARGET", target);
293+
}
292294

293295
// let `cmd` capture stderr for us to process afterward.
294296
let must_capture_output = cfg.args.regress.must_process_stderr();

0 commit comments

Comments
 (0)