简体   繁体   English

如何拒绝使用某个ghc版本进行构建

[英]how to refuse building with a certain ghc version

One of my cabal libraries has hit this GHC bug . 我的一个cabal库已经遇到了这个GHC错误 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. 我目前在源代码中有一个解决方法,但是由于此GHC错误现已在7.8.3中修复,我计划很快删除该解决方法。 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. 我不知道如何处理这种情况,使图书馆拒绝在GHC 7.8.0-7.8.2上构建。 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). 理想情况下,我希望用户得到一个很好的错误消息(“GHC 7.8.0-7.8.2有一个错误阻止这个库正确构建,请使用7.8.3+”)。

Maybe some cabal flag? 也许一些阴谋旗? Or some CPP magic? 还是一些CPP魔术? I think the fix is in base , maybe I can condition on that, although it seems tricky or impossible. 我认为修复是base ,也许我可以对此进行调整,尽管它似乎很棘手或不可能。

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. 或者我可以进行很长一段时间的解决方法,直到问题完全没有实际意义,但由于大多数早期采用者会使用7.8.2及更早版本,我认为放弃支持不应该是一个问题,适当的警告。

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. GHC 7.8.3递增的版本号base从4.7.0.0(由先前的7.8版本中使用)来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 您可以使用build-depends cabal字段来排除该版本,例如通过添加约束base <=4.7.0.0 || >4.7.0.0 base <=4.7.0.0 || >4.7.0.0 . base <=4.7.0.0 || >4.7.0.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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