简体   繁体   中英

how to refuse building with a certain ghc version

One of my cabal libraries has hit this GHC bug . I currently have a workaround in the source, however since this GHC bug was now fixed in 7.8.3, I'm planning to remove the workaround soon. I'm not sure how to handle the situation to make the library refuse to build on GHC 7.8.0-7.8.2 though. Ideally I'd like that the user gets a nice error message ("GHC 7.8.0-7.8.2 have a bug preventing this library to build correctly, please use 7.8.3+" for instance).

Maybe some cabal flag? Or some CPP magic? I think the fix is in base , maybe I can condition on that, although it seems tricky or impossible.

Or I could carry the workaround for a very long time, until the issue is completely moot, but since mostly early adopters would have used 7.8.2 and earlier, I'm thinking it should not be a problem to drop the support, with a proper warning.

GHC 7.8.3 incremented the version number of base from 4.7.0.0 (used by the previous 7.8 releases) to 4.7.0.1. You can use the build-depends cabal field to exclude that version, for instance by adding the constraint base <=4.7.0.0 || >4.7.0.0 base <=4.7.0.0 || >4.7.0.0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM