Skip to content

Commit

Permalink
Don't create hardlink for library test, integrations tests and benche…
Browse files Browse the repository at this point in the history
…s, fixing #7960
  • Loading branch information
jiegec committed Mar 5, 2020
1 parent 5fe8ab5 commit 9f07c83
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
11 changes: 8 additions & 3 deletions src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,14 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
Some(types) => {
for file_type in types {
let path = out_dir.join(file_type.filename(&file_stem));
let hardlink = link_stem
.as_ref()
.map(|&(ref ld, ref ls)| ld.join(file_type.filename(ls)));
// Don't create hardlink for tests
let hardlink = if unit.mode.is_any_test() {
None
} else {
link_stem
.as_ref()
.map(|&(ref ld, ref ls)| ld.join(file_type.filename(ls)))
};
let export_path = if unit.target.is_custom_build() {
None
} else {
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1612,9 +1612,9 @@ fn json_artifact_includes_executable_for_benchmark() {
.with_json(
r#"
{
"executable": "[..]/foo/target/release/benchmark-[..][EXE]",
"executable": "[..]/foo/target/release/deps/benchmark-[..][EXE]",
"features": [],
"filenames": [ "[..]/foo/target/release/benchmark-[..][EXE]" ],
"filenames": [ "[..]/foo/target/release/deps/benchmark-[..][EXE]" ],
"fresh": false,
"package_id": "foo 0.0.1 ([..])",
"profile": "{...}",
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3379,7 +3379,7 @@ fn json_artifact_includes_executable_for_library_tests() {
.with_json(
r#"
{
"executable": "[..]/foo/target/debug/foo-[..][EXE]",
"executable": "[..]/foo/target/debug/deps/foo-[..][EXE]",
"features": [],
"filenames": "{...}",
"fresh": false,
Expand Down Expand Up @@ -3413,7 +3413,7 @@ fn json_artifact_includes_executable_for_integration_tests() {
.with_json(
r#"
{
"executable": "[..]/foo/target/debug/integration_test-[..][EXE]",
"executable": "[..]/foo/target/debug/deps/integration_test-[..][EXE]",
"features": [],
"filenames": "{...}",
"fresh": false,
Expand Down

0 comments on commit 9f07c83

Please sign in to comment.