Skip to content

Commit

Permalink
Merge cross-rs#714
Browse files Browse the repository at this point in the history
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 cross-rs#619.

Co-authored-by: Alex Huszagh <[email protected]>
Co-authored-by: Alexander Huszagh <[email protected]>
  • Loading branch information
bors[bot] and Alexhuszagh authored May 25, 2022
2 parents 0adbce2 + 3581476 commit c4f5ae4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- #714 - use host target directory when falling back to host cargo.
- #713 - convert relative target directories to absolute paths.
- #709 - Update Emscripten targets to `emcc` version 3.1.10
- #707, #708 - Set `BINDGEN_EXTRA_CLANG_ARGS` environment variable to pass sysroot to `rust-bindgen`
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ fn run() -> Result<ExitStatus> {
}

eprintln!("Warning: Falling back to `cargo` on the host.");
cargo::run(&args.all, verbose)

// if we fallback to the host cargo, use the same invocation that was made to cross
let argv: Vec<String> = env::args().skip(1).collect();
cargo::run(&argv, verbose)
}

#[derive(PartialEq, Debug)]
Expand Down

0 comments on commit c4f5ae4

Please sign in to comment.