Skip to content

Commit 596e89b

Browse files
committed
Extend the comment about the hack
1 parent 13d5ecd commit 596e89b

File tree

1 file changed

+7
-2
lines changed
  • Cabal/src/Distribution/Simple

1 file changed

+7
-2
lines changed

Cabal/src/Distribution/Simple/Hpc.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@ mixDir :: FilePath -- ^ \"dist/\" prefix
7171
mixDir distPref way name = hpcDir distPrefBuild way </> "mix" </> name
7272
where
7373
-- 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).
74+
-- where HPC saves and reads .mix files when the main library of the same
75+
-- package is being processed, perhaps in a previous cabal run (#5213).
76+
-- E.g., @distPref@ may be
77+
-- @./dist-newstyle/build/x86_64-linux/ghc-9.0.1/cabal-gh5213-0.1/t/tests@
78+
-- but the path where library mix files reside has two less components
79+
-- at the end (@t/tests@) and this reduced path needs to be passed to
80+
-- both @hpc@ and @ghc@.
7681
distPrefElements = splitDirectories distPref
7782
distPrefBuild = case drop (length distPrefElements - 2) distPrefElements of
7883
"t" : _ -> joinPath $ take (length distPrefElements - 2) distPrefElements

0 commit comments

Comments
 (0)