@@ -22,7 +22,7 @@ import Control.Concurrent.Async (withAsync, wait)
2222import Control.Concurrent.Execute
2323import Control.Concurrent.MVar.Lifted
2424import Control.Concurrent.STM
25- import Control.Exception.Enclosed (catchIO , tryIO )
25+ import Control.Exception.Enclosed (catchIO )
2626import Control.Exception.Lifted
2727import Control.Monad (liftM , when , unless , void , join , filterM , (<=<) )
2828import Control.Monad.Catch (MonadCatch , MonadMask )
@@ -1338,7 +1338,7 @@ printBuildOutput excludeTHLoading makeAbsolute pkgDir level outH = void $
13381338 =$ CL. mapM_ (monadLoggerLog $ (TH. location >>= liftLoc) " " level)
13391339
13401340-- | Strip Template Haskell "Loading package" lines and making paths absolute.
1341- mungeBuildOutput :: MonadIO m
1341+ mungeBuildOutput :: ( MonadIO m , MonadThrow m )
13421342 => Bool -- ^ exclude TH loading?
13431343 -> Bool -- ^ convert paths to absolute?
13441344 -> Path Abs Dir -- ^ package's root directory
@@ -1363,21 +1363,17 @@ mungeBuildOutput excludeTHLoading makeAbsolute pkgDir = void $
13631363 let (x, y) = T. break (== ' :' ) bs
13641364 mabs <-
13651365 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)
13711367 else return Nothing
13721368 case mabs of
13731369 Nothing -> return bs
13741370 Just fp -> return $ fp `T.append` y
13751371
13761372 -- | Match the line:column format at the end of lines
1377- isValidSuffix = isRight . parseOnly ( lineCol <* endOfInput)
1373+ isValidSuffix = isRight . parseOnly lineCol
13781374 lineCol = char ' :' >> (decimal :: Parser Int )
13791375 >> char ' :' >> (decimal :: Parser Int )
1380- >> (string " : " <|> string " : Warning: " )
1376+ >> char ' : '
13811377 >> return ()
13821378
13831379 -- | Strip @\r@ characters from the byte vector. Used because Windows.
0 commit comments