-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade GHC to 9.2 #414
Upgrade GHC to 9.2 #414
Conversation
52912c1
to
d2d2101
Compare
Solving the Ormolu problem took a negative number of lines. Convenient. |
The panic happens on the library. It's probably not caused by the clever setup that It doesn't happen with |
The panic happens in the This one breaks (the error appears to happen on the last line) ❌ deriving via
Generically1 (Product f g)
instance
(Applicative f, Applicative g) => Applicative (Product f g) This one works ✔️ deriving via
Generically1 ((,) a)
instance
Monoid a => Applicative ((,) a) Why there is a different between the two does elude me some. And why only in ghci? This is a weird puzzle. |
Could it be a bug in GHC's implementation of Template Haskell? Have you reported a GHC bug? |
I haven't reported a GHC bug yet (there doesn't seem to be any Template Haskell involved anyway). As I don't know what to report 🙂 . I'll try to minimize later this week, now I've got to go. I've had a look at GHC's source to see where could the source of this message be, and it's not obvious. |
@monoidal points me at the fact that @andreasabel has already mentioned this very bug in the GHC bug tracker https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7105#note_421618 . |
examples/Test/Foreign.hs
Outdated
testProperty "memory freed post-exception" testExecptionOnMem | ||
[ testPropertyNamed "List.toList . List.fromList = id" "invertNonGCList" invertNonGCList, | ||
testPropertyNamed "map id = id" "mapIdNonGCList" mapIdNonGCList, | ||
testPropertyNamed "memory freed post-exception" "testExecptionOnMem" testExecptionOnMem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you want to fix the typo testExecptionOnMem
to testExceptionOnMem
while you are at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know, it was all search and replace 🙂 .
Thanks for noticing!
testProperty
from tasty-hedgehog
This PR has now been changed to only care about GHC 9.2. The tasty-hedgehog bits are now handled by #415 . |
Upgrading the stack snapshot is part of #389.
Specifically, GHC 9.2.2, which is the version used in our Stackage snapshot.
d2d2101
to
baa93ac
Compare
Rebased. I still don't want to merge though. Let me (or someone) figure out what is happening with ghci. |
Here is a minimised version of the bug (on GHC 9.2.2). Uncomment any of the two commented signatures and the module seems to compile (I have yet to figure out why… it should fail to derive the instance I'm a little puzzled). At any rate, it makes the anomaly disappear. {-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Data.Functor.Linear.Internal.Applicative
( Applicative (..),
)
where
import GHC.Types
-- type Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type
data Product f g a = Pair (f a) (g a)
-- type Generically1 :: (Type -> Type) -> Type -> Type
newtype Generically1 f a = Generically1 (f a)
type Functor :: (Type -> Type) -> Constraint
class Functor f where
class Functor f => Applicative f where
deriving instance (Functor f, Functor g) => Functor (Product f g)
deriving via
Generically1 (Product f g)
instance
(Applicative f, Applicative g) => Applicative (Product f g) |
The bug appears to be fixed on (a recent) master:
Maybe we can use this error message to build a workaround. |
See the thread at #414. The bug is fixed in GHC 9.4 as far as I can tell.
Indeed, just adding some type signature in the |
See the thread at #414. The anomaly is fixed in GHC 9.4 as far as I can tell. But arguably a bug persists, and we won't be able to remove this quite right away.
180148a
to
6e2adca
Compare
I am a little bit confused as to why, locally, stack tells me that |
ca7e329
to
19fdb72
Compare
I wrote an issue upstream ghc!21514. I'll give myself a little time to think of a better workaround. Then we will be able to merge. |
I haven't found a better workaround. So we'll go with this, even though it's rather inelegant and fragile (it's probably a good idea to use GHC2021 as the default language in Cabal to avoid the fragility, but I think I had good reasons not to do that at some point, so I won't do this immediately). |
Part of #389.
This PR originally fixed the tasty-hedgehog deprecation warning. But because it turned out to that GHC 9.2 is having problem with our PR, I extracted this bit in #415.
I'll rebase on master as soon as #415 is merged to clear up the tasty-hedgehog bits.
Edit: I wanted to only make a draft PR, but I misclicked. I don't think that
I can convert it back. I don't know how anyway. I don't want to merge quite
yet, as there is a bug related to
stack ghci
which causes an anomaly in GHC:I haven't investigated this problem yet, and I want to know a bit more before we merge
Another problem that I noticed is that the format script cannot install Ormolu anymore (due to an upper bound somewher)