From 83e87d42128d07bef733c26bd395d69e99c98655 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 22 May 2018 04:45:46 -0700 Subject: [PATCH] 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. --- tests/testsuite/freshness.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/freshness.rs b/tests/testsuite/freshness.rs index 7df638cfb..edf9c74dd 100644 --- a/tests/testsuite/freshness.rs +++ b/tests/testsuite/freshness.rs @@ -522,7 +522,7 @@ fn changing_bin_features_caches_targets() { let foo_proc = |name: &str| { let src = p.bin("foo"); let dst = p.bin(name); - fs::copy(&src, &dst).expect("Failed to copy foo"); + fs::hard_link(&src, &dst).expect("Failed to link foo"); p.process(dst) }; -- 2.30.2