Skip to content

Commit e46481e

Browse files
committed
Filter out unqualified modules from tix files #1191
1 parent a60dac8 commit e46481e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Stack/Build/Coverage.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ updateTixFile tixSrc pkgId = do
5454
let tixDest = outputDir </> pkgIdRel </> filename tixSrc
5555
removeFileIfExists tixDest
5656
createTree (parent tixDest)
57-
renameFile tixSrc tixDest
57+
-- Remove exe modules because they are problematic. This could be revisited if there's a GHC
58+
-- version that fixes https://ghc.haskell.org/trac/ghc/ticket/1853
59+
mtix <- readTixOrLog tixSrc
60+
case mtix of
61+
Nothing -> $logError $ "Failed to read " <> T.pack (toFilePath tixSrc)
62+
Just tix -> do
63+
liftIO $ writeTix (toFilePath tixDest) (removeExeModules tix)
64+
removeFileIfExists tixSrc
5865

5966
-- | Get the tix file location, given the name of the file (without extension), and the package
6067
-- identifier string.

0 commit comments

Comments
 (0)