From 31dc80853fc0319f3cb17c39d117b67f1c84a064 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 24 Mar 2021 08:31:00 +0200 Subject: [PATCH] Catch all errors from hi-file-parser Closes #5486 Closes #5445 --- ChangeLog.md | 4 ++++ src/Stack/Package.hs | 2 +- stack-ghc-810.yaml | 1 + stack-ghc-84.yaml | 1 + stack-ghc-88.yaml | 1 + stack.yaml | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index adff519513..65cb8f016a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -35,6 +35,10 @@ Bug fixes: GitHub repositories. See [#5422](https://github.com/commercialhaskell/stack/issues/5422) +* Ignore all errors from `hi-file-parser`. See + [#5445](https://github.com/commercialhaskell/stack/issues/5445) and + [#5486](https://github.com/commercialhaskell/stack/issues/5486). + ## v2.5.1.1 Hackage-only release: diff --git a/src/Stack/Package.hs b/src/Stack/Package.hs index 9d01f72f4a..067417217b 100644 --- a/src/Stack/Package.hs +++ b/src/Stack/Package.hs @@ -1107,7 +1107,7 @@ parseHI :: FilePath -> RIO Ctx (Set ModuleName, [Path Abs File]) parseHI hiPath = do dir <- asks (parent . ctxFile) - result <- liftIO $ Iface.fromFile hiPath + result <- liftIO $ Iface.fromFile hiPath `catchAnyDeep` \e -> pure (Left (show e)) case result of Left msg -> do prettyStackDevL diff --git a/stack-ghc-810.yaml b/stack-ghc-810.yaml index 67f8c1470a..b9f72b47b4 100644 --- a/stack-ghc-810.yaml +++ b/stack-ghc-810.yaml @@ -20,6 +20,7 @@ ghc-options: "$locals": -fhide-source-paths extra-deps: +- hi-file-parser-0.1.1.0@rev:0 - persistent-2.11.0.1@rev:0 - persistent-sqlite-2.11.0.0@rev:0 - persistent-template-2.9.1.0@rev:0 diff --git a/stack-ghc-84.yaml b/stack-ghc-84.yaml index 22f22e5e40..2df27ab59c 100644 --- a/stack-ghc-84.yaml +++ b/stack-ghc-84.yaml @@ -27,6 +27,7 @@ extra-deps: - hpack-0.32.0@sha256:31178d0c454ec1fd2222e7c4bdd4db937b030a43cc79cb5bb62b8048c38cd64b,4406 - hackage-security-0.5.3.0@rev:6 - aeson-1.4.6.0@sha256:560575b008a23960403a128331f0e59594786b5cd19a35be0cd74b9a7257958e,6980 +- hi-file-parser-0.1.1.0@rev:0 - infer-license-0.2.0@rev:0 #for hpack-0.31 - time-compat-1.9.2.2@sha256:ccf268e6ec91a6d9a79392697634c670c095a34a60d1ccfa1be1c84f20bb24c5,4254 - base-orphans-0.8.2@sha256:40ef37ed043aac2cbb6c538fdebfc62e601ee65ee161e4a6327452133b574d7e,2958 diff --git a/stack-ghc-88.yaml b/stack-ghc-88.yaml index 94ebe17d7b..b8f4b0fa0a 100644 --- a/stack-ghc-88.yaml +++ b/stack-ghc-88.yaml @@ -21,6 +21,7 @@ ghc-options: extra-deps: - hackage-security-0.6.0.0@sha256:69987d46e7b55fe5f0fc537021c3873c5f6f44a6665d349ee6995fd593df8147,11976 +- hi-file-parser-0.1.1.0@rev:0 - regex-applicative-text-0.1.0.1@sha256:52463fdc8daf130f40b82fec84bad2d4b8600227751c2a5b04679a1de8bd7f7a,1155 - lukko-0.1.1.1@sha256:5c674bdd8a06b926ba55d872abe254155ed49a58df202b4d842b643e5ed6bcc9,4289 - hpack-0.33.0@rev:0 diff --git a/stack.yaml b/stack.yaml index c8c9c51cca..df7653aff7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -25,6 +25,7 @@ ghc-options: extra-deps: - Cabal-3.0.0.0@rev:0 +- hi-file-parser-0.1.1.0@rev:0 - hpack-0.33.0@rev:0 - http-download-0.2.0.0@rev:0 - filelock-0.1.1.5@rev:0