Skip to content

Recompilation checking stochastically broken on Darwin

The retc001 test usually fails on Darwin. Unfortunately, it also sometimes passes.

Failures look like this,

=====> retc001(normal) 1 of 1 [0, 0, 0] 
cd . && $MAKE -s --no-print-directory retc001    </dev/null > retc001.run.stdout 2> retc001.run.stderr
Actual stderr output differs from expected:
--- ./retc001.stderr.normalised	2015-12-11 23:02:23.000000000 +0200
+++ ./retc001.run.stderr.normalised	2015-12-11 23:02:23.000000000 +0200
@@ -1,2 +0,0 @@
-
-C.hs:3:11: Module ‘B’ does not export ‘foo’
\ No newline at end of file
Actual stdout output differs from expected:
--- ./retc001.stdout.normalised	2015-12-11 23:02:23.000000000 +0200
+++ ./retc001.run.stdout.normalised	2015-12-11 23:02:23.000000000 +0200
@@ -3,5 +3,3 @@
 [3 of 3] Compiling Main             ( C.hs, nothing )
 Middle
 End
-[2 of 3] Compiling B                ( B.hs, nothing )
-[3 of 3] Compiling Main             ( C.hs, nothing ) [B changed]
\ No newline at end of file
*** unexpected failure for retc001(normal)

I suspect the problem is mtime resolution as the test nearly always passes with the following patch,

diff --git a/testsuite/tests/driver/retc001/Makefile b/testsuite/tests/driver/retc001/Makefile
index a3cf6eb..bb1eca8 100644
--- a/testsuite/tests/driver/retc001/Makefile
+++ b/testsuite/tests/driver/retc001/Makefile
@@ -20,5 +20,6 @@ retc001: clean
        echo 'Middle'
        '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -fno-code -fwrite-interface --make C.hs
        echo 'End'
+       sleep 1
        cp B2.hs B.hs
        -'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -fno-code -fwrite-interface --make C.hs
Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information