Skip to content

Commit 099a622

Browse files
committed
Auto merge of #5557 - ehuss:linux-cbfct, r=alexcrichton
Fix test failure in changing_bin_features_caches_targets for Linux. Fixes rust-lang/rust#50962. My theory is that while copying the binary, another thread forked with the fd open. The copy finishes and attempts to exec before the other child execs (and closes the writeable fd). I was able to easily repro this on linux. I ran some stress tests of this fix locally on linux and on appveyor, and was unable to trigger it again.
2 parents 64f8f1b + 83e87d4 commit 099a622

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/testsuite/freshness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ fn changing_bin_features_caches_targets() {
522522
let foo_proc = |name: &str| {
523523
let src = p.bin("foo");
524524
let dst = p.bin(name);
525-
fs::copy(&src, &dst).expect("Failed to copy foo");
525+
fs::hard_link(&src, &dst).expect("Failed to link foo");
526526
p.process(dst)
527527
};
528528

0 commit comments

Comments
 (0)