From 31dc80853fc0319f3cb17c39d117b67f1c84a064 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 24 Mar 2021 08:31:00 +0200 Subject: [PATCH 1/3] 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 From 780091d714725af60edd8420e902814912335293 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 24 Mar 2021 08:51:02 +0200 Subject: [PATCH 2/3] Remove warnings for GHC 9.0 --- ChangeLog.md | 2 ++ src/Stack/Setup.hs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 65cb8f016a..38b9962ef0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -29,6 +29,8 @@ Other enhancements: * `stack list` is a new command to list package versions in a snapshot. See [#5431](https://github.com/commercialhaskell/stack/pull/5431) +* Consider GHC 9.0 a tested compiler and remove warnings. + Bug fixes: * `stack new` now suppports branches other than `master` as default for diff --git a/src/Stack/Setup.hs b/src/Stack/Setup.hs index 9391752dd0..cd620e3f86 100644 --- a/src/Stack/Setup.hs +++ b/src/Stack/Setup.hs @@ -465,9 +465,9 @@ warnUnsupportedCompiler ghcVersion = do logWarn "For more information, see: https://github.com/commercialhaskell/stack/issues/648" logWarn "" pure True - | ghcVersion >= mkVersion [8, 11] -> do + | ghcVersion >= mkVersion [9, 1] -> do logWarn $ - "Stack has not been tested with GHC versions above 8.10, and using " <> + "Stack has not been tested with GHC versions above 9.0, and using " <> fromString (versionString ghcVersion) <> ", this may fail" pure True @@ -492,9 +492,9 @@ warnUnsupportedCompilerCabal cp didWarn = do logWarn "This invocation will most likely fail." logWarn "To fix this, either use an older version of Stack or a newer resolver" logWarn "Acceptable resolvers: lts-3.0/nightly-2015-05-05 or later" - | cabalVersion >= mkVersion [3, 3] -> + | cabalVersion >= mkVersion [3, 5] -> logWarn $ - "Stack has not been tested with Cabal versions above 3.2, but version " <> + "Stack has not been tested with Cabal versions above 3.4, but version " <> fromString (versionString cabalVersion) <> " was found, this may fail" | otherwise -> pure () From d09865e8376823a7916d806b392199e62c0b4df5 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 24 Mar 2021 14:59:10 +0200 Subject: [PATCH 3/3] Bump rev --- stack-ghc-810.yaml | 2 +- stack-ghc-84.yaml | 2 +- stack-ghc-88.yaml | 2 +- stack.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stack-ghc-810.yaml b/stack-ghc-810.yaml index b9f72b47b4..8c8fd6ac7e 100644 --- a/stack-ghc-810.yaml +++ b/stack-ghc-810.yaml @@ -20,7 +20,7 @@ ghc-options: "$locals": -fhide-source-paths extra-deps: -- hi-file-parser-0.1.1.0@rev:0 +- hi-file-parser-0.1.1.0@rev:2 - 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 2df27ab59c..77380d4db4 100644 --- a/stack-ghc-84.yaml +++ b/stack-ghc-84.yaml @@ -27,7 +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 +- hi-file-parser-0.1.1.0@rev:2 - 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 b8f4b0fa0a..7ed176091c 100644 --- a/stack-ghc-88.yaml +++ b/stack-ghc-88.yaml @@ -21,7 +21,7 @@ ghc-options: extra-deps: - hackage-security-0.6.0.0@sha256:69987d46e7b55fe5f0fc537021c3873c5f6f44a6665d349ee6995fd593df8147,11976 -- hi-file-parser-0.1.1.0@rev:0 +- hi-file-parser-0.1.1.0@rev:2 - 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 df7653aff7..5ab7fe7390 100644 --- a/stack.yaml +++ b/stack.yaml @@ -25,7 +25,7 @@ ghc-options: extra-deps: - Cabal-3.0.0.0@rev:0 -- hi-file-parser-0.1.1.0@rev:0 +- hi-file-parser-0.1.1.0@rev:2 - hpack-0.33.0@rev:0 - http-download-0.2.0.0@rev:0 - filelock-0.1.1.5@rev:0