Skip to content

Commit c4f5ae4

Browse files
Merge #714
714: Use host target directory when calling host cargo. r=Emilgardis a=Alexhuszagh When using docker, the target directory is mounted at `/target`. However, when falling back to the host cargo, if we provide a custom target directory, we incorrectly pass it as `--target-dir /target`. To rectify this, this PR passes the original command-line arguments to cargo. Fixes #619. Co-authored-by: Alex Huszagh <[email protected]> Co-authored-by: Alexander Huszagh <[email protected]>
2 parents 0adbce2 + 3581476 commit c4f5ae4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## [Unreleased]
77

8+
- #714 - use host target directory when falling back to host cargo.
89
- #713 - convert relative target directories to absolute paths.
910
- #709 - Update Emscripten targets to `emcc` version 3.1.10
1011
- #707, #708 - Set `BINDGEN_EXTRA_CLANG_ARGS` environment variable to pass sysroot to `rust-bindgen`

src/main.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,10 @@ fn run() -> Result<ExitStatus> {
410410
}
411411

412412
eprintln!("Warning: Falling back to `cargo` on the host.");
413-
cargo::run(&args.all, verbose)
413+
414+
// if we fallback to the host cargo, use the same invocation that was made to cross
415+
let argv: Vec<String> = env::args().skip(1).collect();
416+
cargo::run(&argv, verbose)
414417
}
415418

416419
#[derive(PartialEq, Debug)]

0 commit comments

Comments
 (0)