Index: src/tools/cargo/crates/cargo-test-support/src/paths.rs
--- src/tools/cargo/crates/cargo-test-support/src/paths.rs.orig
+++ src/tools/cargo/crates/cargo-test-support/src/paths.rs
@@ -19,9 +19,7 @@ static GLOBAL_ROOT: OnceLock<Mutex<Option<PathBuf>>> =
 /// This is used when running cargo is pre-CARGO_TARGET_TMPDIR
 /// TODO: Remove when `CARGO_TARGET_TMPDIR` grows old enough.
 fn global_root_legacy() -> PathBuf {
-    let mut path = t!(env::current_exe());
-    path.pop(); // chop off exe name
-    path.pop(); // chop off "deps"
+    let path = PathBuf::from("${WRKBUILD}/test-cargo");
     path.push("tmp");
     path.mkdir_p();
     path
