haskell / happy

The Happy parser generator for Haskell
Other
276 stars 84 forks source link

Setup.hs: Compatibility with Cabal-3 #142

Closed bgamari closed 5 years ago

bgamari commented 5 years ago

https://github.com/haskell/cabal/pull/3693 deprecated rawSystemProgramConf in favor of runDbProgram.

RyanGlScott commented 5 years ago

For backwards compatibility with older versions of GHC (which bundle Cabals that don't support MIN_VERSION macros in Setup scripts), I think you'll need to add the following lines to the top of Setup.hs:

#ifndef MIN_VERSION_Cabal
#define MIN_VERSION_Cabal(x,y,z) 0
#endif
RyanGlScott commented 5 years ago

Better yet, you don't even need to use CPP at all. The runDbProgram function has existed for long enough that it can just be used in place of rawSystemProgramConf. The oldest version of GHC that happy currently supports is 7.6.3 which bundles Cabal-1.16, and even that release featured runDbProgram (see here). This is the approach I adopt in hvr/head.hackage#128.

ghost commented 5 years ago

Great news @bgamari @RyanGlScott @simonmar and thanks ! Do we have an ETA for a release to see this out the door?