Skip to content

Commit 216f915

Browse files
committed
Auto merge of #9814 - ehuss:move-tmp, r=alexcrichton
Move `tmp` test directory. The `tmp` directory added in #9375 was placed within the profile directory (such as `target/debug/tmp` or `target/release/tmp`). This causes problems for any cargo target (binary, test, etc.) with the name `tmp` as there is a name collision. This PR attempts to address that by moving the `tmp` directory to the root of the target directory (`target/tmp`), and reserving the profile name "tmp". Fixes #9783
2 parents 2733a6a + 4e7fe83 commit 216f915

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

src/cargo/core/compiler/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl Layout {
172172
fingerprint: dest.join(".fingerprint"),
173173
examples: dest.join("examples"),
174174
doc: root.join("doc"),
175-
tmp: dest.join("tmp"),
175+
tmp: root.join("tmp"),
176176
root,
177177
dest,
178178
_lock: lock,

src/cargo/util/toml/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ impl TomlProfile {
642642
| "rust"
643643
| "rustc"
644644
| "rustdoc"
645+
| "tmp"
645646
| "uninstall"
646647
) || lower_name.starts_with("cargo")
647648
{

src/doc/src/reference/environment-variables.md

-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ corresponding environment variable is set to the empty string, `""`.
233233
where integration tests or benchmarks are free to put any data needed by
234234
the tests/benches. Cargo initially creates this directory but doesn't
235235
manage its content in any way, this is the responsibility of the test code.
236-
There are separate directories for `debug` and `release` profiles.
237236

238237
[integration test]: cargo-targets.md#integration-tests
239238
[`env` macro]: ../../std/macro.env.html

tests/testsuite/build.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,10 @@ fn crate_env_vars() {
13781378
let tmpdir: PathBuf = tmp.unwrap().into();
13791379
13801380
let exe: PathBuf = env::current_exe().unwrap().into();
1381-
let mut expected: PathBuf = exe.parent().unwrap().parent().unwrap().into();
1381+
let mut expected: PathBuf = exe.parent().unwrap()
1382+
.parent().unwrap()
1383+
.parent().unwrap()
1384+
.into();
13821385
expected.push("tmp");
13831386
assert_eq!(tmpdir, expected);
13841387

0 commit comments

Comments
 (0)