Support ghc-8.10 #269

Closed
opened 2019-12-01 16:07:17 +01:00 by lspitzner · 9 comments
lspitzner commented 2019-12-01 16:07:17 +01:00 (Migrated from github.com)

The next alpha is released (https://mail.haskell.org/pipermail/ghc-devs/2019-November/018337.html).

For the last two ghc released I have tried to prepare for the next GHC release ahead of time by using head.hackage or whatsitcalled. Because getting that to work has proven to be a sink of my time, this time around I plan not to start working on making brittany compatible until the dependencies work with the new GHC version (excluding the dependencies from me, of course, i.e. multistate/butcher/czipwith/data-tree-print).

This may delay a release that is compatible with ghc-8.10 a bit (but we'll keep making releases with new features until then).

You are very welcome to

  • Give feedback on this;
  • Mention any new syntactical constructs in 8.10 that you would like to be supported by brittany;
  • Friendly poke dependency maintainers about making compatible releases;
  • Remind me about this once dependencies are working.

Thank you for your understanding, have a nice day!

The next alpha is released (https://mail.haskell.org/pipermail/ghc-devs/2019-November/018337.html). For the last two ghc released I have tried to prepare for the next GHC release ahead of time by using head.hackage or whatsitcalled. Because getting that to work has proven to be a sink of my time, this time around I plan _not_ to start working on making brittany compatible until the dependencies work with the new GHC version (excluding the dependencies from me, of course, i.e. multistate/butcher/czipwith/data-tree-print). This may delay a release that is compatible with ghc-8.10 a bit (but we'll keep making releases with new features until then). You are very welcome to - Give feedback on this; - Mention any new syntactical constructs in 8.10 that you would like to be supported by brittany; - Friendly poke dependency maintainers about making compatible releases; - Remind me about this once dependencies are working. Thank you for your understanding, have a nice day!
lspitzner commented 2019-12-17 11:26:53 +01:00 (Migrated from github.com)

cabal-install is at this moment not officially compatible with ghc-8.8 yet. Probably just a bounds oversight, but good to see that brittany is ahead of the "official" ecosystem.

cabal-install is at this moment [not officially compatible](https://github.com/haskell/cabal/issues/5819#issuecomment-566478180) with ghc-8.8 yet. Probably just a bounds oversight, but good to see that brittany is ahead of the "official" ecosystem.
ChickenProp commented 2020-01-02 11:15:05 +01:00 (Migrated from github.com)

Will ghc-exactprint need to be updated for 8.10 before brittany can be? That repo hasn't seen much activity lately.

Will [ghc-exactprint](https://github.com/alanz/ghc-exactprint) need to be updated for 8.10 before brittany can be? That repo hasn't seen much activity lately.
lspitzner commented 2020-01-03 11:55:12 +01:00 (Migrated from github.com)

yes, but I am sure alanz will make a release in time. I know most of the feature-requests in that repo don't get much attention, but it has always been updated to new ghcs quickly in the past. And there already is https://github.com/alanz/ghc-exactprint/commits/ghc-8.10.

yes, but I am sure alanz will make a release in time. I know most of the feature-requests in that repo don't get much attention, but it has always been updated to new ghcs quickly in the past. And there already is https://github.com/alanz/ghc-exactprint/commits/ghc-8.10.
ChickenProp commented 2020-01-03 11:59:02 +01:00 (Migrated from github.com)

Ah, I hadn't looked at the list of branches. It totally makes sense that that work wouldn't be on master yet.

Ah, I hadn't looked at the list of branches. It totally makes sense that that work wouldn't be on master yet.
jgrosso commented 2020-05-03 23:22:45 +02:00 (Migrated from github.com)

Bumping now that GHC 8.10.1 has been officially released.

Bumping now that GHC 8.10.1 has been officially released.
jgrosso commented 2020-05-06 02:30:22 +02:00 (Migrated from github.com)

@lspitzner I took a brief look, and (at least on Hackage) I think all the external dependencies support GHC 8.10.2.

@lspitzner I took a brief look, and (at least on Hackage) I _think_ all the external dependencies support GHC 8.10.2.
jneira commented 2020-05-13 10:38:35 +02:00 (Migrated from github.com)

I am afraid that some of them still does not support them. I got several solver errors trying to build it in windows with cabal v2-build -w ghc-8.10.1 and it needed this cabal project:

packages: .

allow-newer: multistate:base,
             data-tree-print:base,
             czipwith:base,
             czipwith:template-haskell,
             butcher:base

It could serve as the checklist of packages that would be need an update to be comatible with ghc-8.10.1.

I've added the dependencies that already support ghc-8.10.1:

diff --git a/brittany.cabal b/brittany.cabal
index d99ad17..c189532 100644
--- a/brittany.cabal
+++ b/brittany.cabal
@@ -91,10 +91,10 @@ library {
     -fno-warn-redundant-constraints
   }
   build-depends:
-    { base >=4.9 && <4.14
-    , ghc >=8.0.1 && <8.9
+    { base >=4.9 && <4.15
+    , ghc >=8.0.1 && <8.11
     , ghc-paths >=0.1.0.9 && <0.2
-    , ghc-exactprint >=0.5.8 && <0.6.3
+    , ghc-exactprint >=0.5.8 && <0.6.4
     , transformers >=0.5.2.0 && <0.6
     , containers >=0.5.7.1 && <0.7
     , mtl >=2.2.1 && <2.3
@@ -118,7 +118,7 @@ library {
     , semigroups >=0.18.2 && <0.20
     , cmdargs >=0.10.14 && <0.11
     , czipwith >=1.0.1.0 && <1.1
-    , ghc-boot-th >=8.0.1 && <8.9
+    , ghc-boot-th >=8.0.1 && <8.11
     , filepath >=1.4.1.0 && <1.5
     , random >= 1.1 && <1.2
     }

Then i started to fix compile errors, mainly due to the reorganization of ghc modules (HsSyn -> GHC.Hs and so on)
After fixing some module names with CPP, I am just reach a incompatible function change error:

[13 of 32] Compiling Language.Haskell.Brittany.Internal.ExactPrintUtils ( src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs, D:\\dev\ws\haskell\brittany\dist-newstyle\build\x86_64-windows\ghc-8.10.1\brittany-0.12.1.1\build\Language\Haskell\Brittany\Internal\ExactPrintUtils.o )

src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs:101:9: error:
    • Couldn't match type ‘Bag.Bag ErrUtils.ErrMsg’ with ‘(a1, [Char])’
      Expected type: Either
                       (a1, [Char]) (ExactPrint.Anns, GHC.ParsedSource)
        Actual type: Either
                       ErrUtils.ErrorMessages (ExactPrint.Anns, GHC.ParsedSource)
    • In the second argument of ‘($)’, namely
        ‘ExactPrint.postParseTransform res opts’
      In a stmt of a 'do' block:
        either
          (\ (span, err) -> ExceptT.throwE $ show span ++ ": " ++ err)
          (\ (a, m) -> pure (a, m, x))
          $ ExactPrint.postParseTransform res opts
      In the second argument of ‘($)’, namely
        ‘do dflags0 <- lift $ GHC.getSessionDynFlags
            (dflags1, leftover, warnings) <- lift
                                               $ GHC.parseDynamicFlagsCmdLine
                                                   dflags0
                                                   (GHC.noLoc <$> ("-hide-all-packages" : args))
            void $ lift $ GHC.setSessionDynFlags dflags1
            dflags2 <- lift $ ExactPrint.initDynFlags fp
            ....’
    |
101 |       $ ExactPrint.postParseTransform res opts
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs:132:13: error:
    • Couldn't match type ‘(a0, [Char])’ with ‘Bag.Bag ErrUtils.ErrMsg’
      Expected type: ErrUtils.ErrorMessages
        Actual type: (a0, [Char])
    • In the pattern: (span, err)
      In the pattern: Left (span, err)
      In a case alternative:
          Left (span, err)
            -> ExceptT.throwE $ showOutputable span ++ ": " ++ err
    |
132 |       Left  (span, err) -> ExceptT.throwE $ showOutputable span ++ ": " ++ err

😞

I am afraid that some of them still does not support them. I got several solver errors trying to build it in windows with `cabal v2-build -w ghc-8.10.1` and it needed this cabal project: ``` packages: . allow-newer: multistate:base, data-tree-print:base, czipwith:base, czipwith:template-haskell, butcher:base ``` It could serve as the checklist of packages that would be need an update to be comatible with ghc-8.10.1. I've added the dependencies that already support ghc-8.10.1: ```diff diff --git a/brittany.cabal b/brittany.cabal index d99ad17..c189532 100644 --- a/brittany.cabal +++ b/brittany.cabal @@ -91,10 +91,10 @@ library { -fno-warn-redundant-constraints } build-depends: - { base >=4.9 && <4.14 - , ghc >=8.0.1 && <8.9 + { base >=4.9 && <4.15 + , ghc >=8.0.1 && <8.11 , ghc-paths >=0.1.0.9 && <0.2 - , ghc-exactprint >=0.5.8 && <0.6.3 + , ghc-exactprint >=0.5.8 && <0.6.4 , transformers >=0.5.2.0 && <0.6 , containers >=0.5.7.1 && <0.7 , mtl >=2.2.1 && <2.3 @@ -118,7 +118,7 @@ library { , semigroups >=0.18.2 && <0.20 , cmdargs >=0.10.14 && <0.11 , czipwith >=1.0.1.0 && <1.1 - , ghc-boot-th >=8.0.1 && <8.9 + , ghc-boot-th >=8.0.1 && <8.11 , filepath >=1.4.1.0 && <1.5 , random >= 1.1 && <1.2 } ``` Then i started to fix compile errors, mainly due to the reorganization of ghc modules (HsSyn -> GHC.Hs and so on) After fixing some module names with CPP, I am just reach a incompatible function change error: ``` [13 of 32] Compiling Language.Haskell.Brittany.Internal.ExactPrintUtils ( src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs, D:\\dev\ws\haskell\brittany\dist-newstyle\build\x86_64-windows\ghc-8.10.1\brittany-0.12.1.1\build\Language\Haskell\Brittany\Internal\ExactPrintUtils.o ) src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs:101:9: error: • Couldn't match type ‘Bag.Bag ErrUtils.ErrMsg’ with ‘(a1, [Char])’ Expected type: Either (a1, [Char]) (ExactPrint.Anns, GHC.ParsedSource) Actual type: Either ErrUtils.ErrorMessages (ExactPrint.Anns, GHC.ParsedSource) • In the second argument of ‘($)’, namely ‘ExactPrint.postParseTransform res opts’ In a stmt of a 'do' block: either (\ (span, err) -> ExceptT.throwE $ show span ++ ": " ++ err) (\ (a, m) -> pure (a, m, x)) $ ExactPrint.postParseTransform res opts In the second argument of ‘($)’, namely ‘do dflags0 <- lift $ GHC.getSessionDynFlags (dflags1, leftover, warnings) <- lift $ GHC.parseDynamicFlagsCmdLine dflags0 (GHC.noLoc <$> ("-hide-all-packages" : args)) void $ lift $ GHC.setSessionDynFlags dflags1 dflags2 <- lift $ ExactPrint.initDynFlags fp ....’ | 101 | $ ExactPrint.postParseTransform res opts | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs:132:13: error: • Couldn't match type ‘(a0, [Char])’ with ‘Bag.Bag ErrUtils.ErrMsg’ Expected type: ErrUtils.ErrorMessages Actual type: (a0, [Char]) • In the pattern: (span, err) In the pattern: Left (span, err) In a case alternative: Left (span, err) -> ExceptT.throwE $ showOutputable span ++ ": " ++ err | 132 | Left (span, err) -> ExceptT.throwE $ showOutputable span ++ ": " ++ err ``` 😞
jneira commented 2020-05-13 10:48:13 +02:00 (Migrated from github.com)

My work so far is here: https://github.com/lspitzner/brittany/compare/master...jneira:ghc-8.10.1?expand=1
Just in case it could be useful

My work so far is here: https://github.com/lspitzner/brittany/compare/master...jneira:ghc-8.10.1?expand=1 Just in case it could be useful
tfausak commented 2020-12-11 18:25:36 +01:00 (Migrated from github.com)

Done as part of #324 and released with version 0.13.0.0.

Done as part of #324 and released with version 0.13.0.0.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#269
There is no content yet.