-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure rustc-echo-wrapper works with an overridden build.target-dir #10962
Conversation
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
Thanks! I think the issue here is that the sandbox limits aren't getting set correctly. I think something like this would be a more correct fix: diff --git a/crates/cargo-test-support/src/lib.rs b/crates/cargo-test-support/src/lib.rs
index 1ed9bd54e..ed9e50f33 100644
--- a/crates/cargo-test-support/src/lib.rs
+++ b/crates/cargo-test-support/src/lib.rs
@@ -1209,7 +1209,7 @@ pub trait TestEnv: Sized {
.current_dir(&paths::root())
.env("HOME", paths::home())
.env("CARGO_HOME", paths::home().join(".cargo"))
- .env("__CARGO_TEST_ROOT", paths::root())
+ .env("__CARGO_TEST_ROOT", paths::global_root())
// Force Cargo to think it's on the stable channel for all tests, this
// should hopefully not surprise us as we add cargo features over time and
// cargo rides the trains. That will ensure that things like echo-wrapper don't read any configuration settings from above the |
b7a9ce8
to
61c4b11
Compare
Yep, that seems to work and makes a lot more sense. |
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 8 commits in ce40690a5e4e315d3dab0aae1eae69d0252c52ac..efd4ca3dc0b89929dc8c5f5c023d25978d76cb61 2022-08-09 22:32:17 +0000 to 2022-08-12 01:28:28 +0000 - Use `std::thread::scope` to replace crossbeam (rust-lang/cargo#10977) - [docs] Remove extra "in" from `cargo-test.md` (rust-lang/cargo#10978) - Enable two windows tests (rust-lang/cargo#10930) - Improve error msg for get target runner (rust-lang/cargo#10968) - Ensure rustc-echo-wrapper works with an overridden build.target-dir (rust-lang/cargo#10962) - Switch back to `available_parallelism` (rust-lang/cargo#10969) - Only override published resolver when the workspace is different (rust-lang/cargo#10961) - Add `CARGO_LOG` to "Environment variables Cargo reads" (rust-lang/cargo#10967)
Without this when running with an overridden target-dir there are about a dozen test failures like
Because the
rustc-echo-wrapper
is compiled tonot-target/debug/rustc-echo-wrapper
.This is resolved by forcing the target-dir to be a manifest-relative one for this specific build.