]> git.proxmox.com Git - cargo.git/commit
Auto merge of #10962 - Nemo157:override-target-dir, r=ehuss
authorbors <bors@rust-lang.org>
Wed, 10 Aug 2022 21:55:46 +0000 (21:55 +0000)
committerbors <bors@rust-lang.org>
Wed, 10 Aug 2022 21:55:46 +0000 (21:55 +0000)
commita120cfe08ee826d64a5cd99ef2c1e5b52a6fefd2
tree18aa35b3f137e127a97efc60230be2521d791c87
parent3a17953664444e0a509acdac4e2e0fb789153e57
parent61c4b11eae2223ae5efd2c09d541c0a543960f95
Auto merge of #10962 - Nemo157:override-target-dir, r=ehuss

Ensure rustc-echo-wrapper works with an overridden build.target-dir

Without this when running with an overridden target-dir there are about a dozen test failures like

```console
> mkdir .cargo
> echo '[build]\ntarget-dir = "not-target"' > .cargo/config
> cargo test -- fix::does_not_crash
---- fix::does_not_crash_with_rustc_wrapper stdout ----
running `/home/nemo157/sources/cargo/not-target/debug/cargo build`
running `/home/nemo157/sources/cargo/not-target/debug/cargo fix --allow-no-vcs`
thread 'fix::does_not_crash_with_rustc_wrapper' panicked at '
test failed running `/home/nemo157/sources/cargo/not-target/debug/cargo fix --allow-no-vcs`
error: process exited with code 101 (expected 0)
--- stdout

--- stderr
error: failed to run `rustc` to learn about target-specific information

Caused by:
  could not execute process `/home/nemo157/sources/cargo/not-target/tmp/cit/rustc-echo-wrapper/target/debug/rustc-echo-wrapper rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (never executed)

Caused by:
  No such file or directory (os error 2)
', tests/testsuite/fix.rs:1228:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Because the `rustc-echo-wrapper` is compiled to `not-target/debug/rustc-echo-wrapper`.

This is resolved by forcing the target-dir to be a manifest-relative one for this specific build.