Ghc-bignum is not buildable

I’m not sure if this is the place to ask, but after I add ghc-bignum to my library’s depends. It fails to build under GHC 8.X. cabal complains ghc-bignum is not buildable.

So the question is I’m not sure about the migration path for code using GMP internals, should I use a CPP to import different constructors from different versions of integer-gmp?

https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0#integer-gmp-11-integer-simple-ghc-bignum-10 says there is a integer-gmp-1.1 package for compat, but I’m not sure where.

1 Like

It seems that you have to actively select one of the available backends with -fnative, -fffi or -fgmp. See http://hackage.haskell.org/package/ghc-bignum-1.0/ghc-bignum.cabal.

1 Like

ghc-bignum isn’t supposed to be used by GHC < 9.0. GHC 9.0 should come with integer-gmp 1.1 that provides backward compatible pattern synonyms. Otherwise if you really need to import something from ghc-bignum, you will probably have to use something like CPP in code and if impl(ghc > 9.0) in .cabal files.

Hope that helps!

1 Like