我正在尝试在Windows上安装ghc-mod库。使用stack install ghc-mod会显示以下冗长的错误消息:
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for ghc-mod-5.8.0.0:
Cabal-2.4.1.0 from stack configuration does not match >=1.18 && <1.25 (latest matching version is 1.24.2.0)
base-4.12.0.0 from stack configuration does not match >=4.6.0.1 && <4.10 (latest matching version is 4.9.1.0)
cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version (latest matching
version is 0.7.3.0)
djinn-ghc must match <0.1 && >=0.0.2.2, but the stack configuration has no specified version (latest matching
version is 0.0.2.3)
extra-1.6.17 from stack configuration does not match <1.6 && >=1.4 (latest matching version is 1.5.3)
ghc-8.6.5 from stack configuration does not match >=7.6 && <8.2
ghc-syb-utils must match <0.3 && >=0.2.3, but the stack configuration has no specified version (latest matching
version is 0.2.3.3)
haskell-src-exts-1.20.3 from stack configuration does not match <1.20 && >=1.18 (latest matching version is 1.19.1) hlint-2.1.11 from stack configuration does not match <2.1 && >=2.0.8 (latest matching version is 2.0.15)
monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4 (latest matching version is 0.7.2)
optparse-applicative-0.14.3.0 from stack configuration does not match >=0.13.0.0 && <0.14 (latest matching version
is 0.13.2.0)
temporary-1.3 from stack configuration does not match <1.3 && >=1.2.0.3 (latest matching version is 1.2.1.1)
needed since ghc-mod is a build target.
Some different approaches to resolving this:
* Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a different
GHC version with the matching base.显然,我需要更改ghc的版本,但我的版本比所需的版本高,所以更新没有帮助。我应该降级吗?如何在不破坏我的ghc生态系统的情况下做到这一点?
使用cabal安装它会得到类似的结果。
发布于 2019-08-24 01:23:14
很抱歉,除非您愿意降级到GHC 8.0,否则您无法执行此操作。请注意,在依赖项列表中,它显示为ghc (>=7.6 && <8.2)。没有GHC 8.1 (奇数是为了测试),所以它回到了GHC 8.0。
Stackage提供了已知要一起编译的包版本的精选列表,以及GHC的一个版本。每个长期支持(LTS)都是这些版本的特定集合。正如你可以从达米安·拉斐尔·拉特内罗发布的名单中看到的那样,这意味着回到LTS-9.21。
问题是,ghc-mod使用GHC作为库和编译器,所以它对版本非常敏感,您必须为ghc-mod和您正在开发的软件使用相同版本的编译器;有了ghc-mod的工作版本,您就不能为自己的程序切换到更高版本的GHC。
假设您仍然想要这样做,那么获取stack installed。然后编辑您的~/.stack/config.yaml文件(在Windows上键入stack path --stack-root以查找存储该文件的位置)。将其更改为resolver: lts-9.21。然后说stack install ghc-mod。
发布于 2019-08-21 05:44:24
https://stackoverflow.com/questions/57580913
复制相似问题