Skip to content

Commit 8d4a282

Browse files
committed
Hack around wrong .mix directories for tests #5213
1 parent 2917995 commit 8d4a282

File tree

1 file changed

+9
-1
lines changed
  • Cabal/src/Distribution/Simple

1 file changed

+9
-1
lines changed

Cabal/src/Distribution/Simple/Hpc.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,15 @@ mixDir :: FilePath -- ^ \"dist/\" prefix
6868
-> Way
6969
-> FilePath -- ^ Component name
7070
-> FilePath -- ^ Directory containing test suite's .mix files
71-
mixDir distPref way name = hpcDir distPref way </> "mix" </> name
71+
mixDir distPref way name = hpcDir distPrefBuild way </> "mix" </> name
72+
where
73+
-- This is a hack for HPC over test suites, needed to match the directory
74+
-- where HPC stores .mix files when the main library of the same package
75+
-- is being processed, perhaps in a previous cabal run (#5213).
76+
distPrefElements = splitDirectories distPref
77+
distPrefBuild = case drop (length distPrefElements - 2) distPrefElements of
78+
"t" : _ -> joinPath $ take (length distPrefElements - 2) distPrefElements
79+
_ -> distPref
7280

7381
tixDir :: FilePath -- ^ \"dist/\" prefix
7482
-> Way

0 commit comments

Comments
 (0)