@@ -22,7 +22,7 @@ import Control.Concurrent.Async (withAsync, wait)
22
22
import Control.Concurrent.Execute
23
23
import Control.Concurrent.MVar.Lifted
24
24
import Control.Concurrent.STM
25
- import Control.Exception.Enclosed (catchIO , tryIO )
25
+ import Control.Exception.Enclosed (catchIO )
26
26
import Control.Exception.Lifted
27
27
import Control.Monad (liftM , when , unless , void , join , filterM , (<=<) )
28
28
import Control.Monad.Catch (MonadCatch , MonadMask )
@@ -1338,7 +1338,7 @@ printBuildOutput excludeTHLoading makeAbsolute pkgDir level outH = void $
1338
1338
=$ CL. mapM_ (monadLoggerLog $ (TH. location >>= liftLoc) " " level)
1339
1339
1340
1340
-- | Strip Template Haskell "Loading package" lines and making paths absolute.
1341
- mungeBuildOutput :: MonadIO m
1341
+ mungeBuildOutput :: ( MonadIO m , MonadThrow m )
1342
1342
=> Bool -- ^ exclude TH loading?
1343
1343
-> Bool -- ^ convert paths to absolute?
1344
1344
-> Path Abs Dir -- ^ package's root directory
@@ -1363,21 +1363,17 @@ mungeBuildOutput excludeTHLoading makeAbsolute pkgDir = void $
1363
1363
let (x, y) = T. break (== ' :' ) bs
1364
1364
mabs <-
1365
1365
if isValidSuffix y
1366
- then do
1367
- efp <- liftIO $ tryIO $ resolveFile pkgDir (T. unpack x)
1368
- case efp of
1369
- Left _ -> return Nothing
1370
- Right fp -> return $ Just $ T. pack (toFilePath fp)
1366
+ then fmap (T. pack . toFilePath) <$> resolveFileMaybe pkgDir (T. unpack $ T. strip x)
1371
1367
else return Nothing
1372
1368
case mabs of
1373
1369
Nothing -> return bs
1374
1370
Just fp -> return $ fp `T.append` y
1375
1371
1376
1372
-- | Match the line:column format at the end of lines
1377
- isValidSuffix = isRight . parseOnly ( lineCol <* endOfInput)
1373
+ isValidSuffix = isRight . parseOnly lineCol
1378
1374
lineCol = char ' :' >> (decimal :: Parser Int )
1379
1375
>> char ' :' >> (decimal :: Parser Int )
1380
- >> (string " : " <|> string " : Warning: " )
1376
+ >> char ' : '
1381
1377
>> return ()
1382
1378
1383
1379
-- | Strip @\r@ characters from the byte vector. Used because Windows.
0 commit comments