如何降级与cabal基地? [英] How to downgrade base with cabal?

查看:173
本文介绍了如何降级与cabal基地?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows 10上安装一个名为 clanki 的程序。在它的安装文档中提到使用'cabal install clanki'。我下载了cabal,然后ghc。现在我遇到了一个 base 的版本问题。

  $ cabal install clanki 
正在解析依赖关系...
cabal.exe:无法解析依赖关系:
正在尝试:clanki-1.2.7(用户目标)
next goal:base(dependency
拒绝:base-4.9.0.0 / installed-4.9 ...(冲突:clanki => base <= 4.9.0)
拒绝:base-4.9.0.0 ,base-4.8.2.0,base-4.8.1.0,base-4.8.0.0,
ase-4.7.0.2,base-4.7.0.1,base-4.7.0.0,base-4.6.0.1,base-4.6 .0.0,
base-4.5.1.0,base-4.5.0.0,base-4.4.1.0,base-4.4.0.0,base-4.3.1.0,
base-4.3.0.0,base-4.2 .0.2,base-4.2.0.1,base-4.2.0.0,base-4.1.0.0,
base-4.0.0.0,base-3.0.3.2,base-3.0.3.1(来自不可升级的$ b的约束$ b包需要安装实例)
详尽搜索依赖关系树。

所以clanki要求基数大于4.9(stack比cabal更清楚地说明了这一点),而我然后想将基准降级到4.8.2.0。当我尝试 ghc-pkg unregister base 时,它不允许我。甚至没有 - force :

  $ ghc-pkg unregister base --force 
unregistering会破坏以下软件包:xhtml-3000.2.1 Win32-2.3.1.1变形金刚 - 0.5.2.0时间 - 1.6.0.1模板 - haskell - 2.11.0.0进程 - 1.4.2.0漂亮 - 1.1。 3.3 hpc-0.6.0.3 hoopl-3.10.2.1 haskeline-0.7.2.3 ghci-8.0.1 ghc-boot-th-8.0.1 ghc-boot-8.0.1 ghc-8.0.1 filepath-1.4.1.0目录-1.2 .6.2 deepseq-1.4.2.0容器-0.5.7.1 Cabal-1.24.0.0 bytestring-0.10.8.1 binary-0.8.3.0 array-0.5.1.1(忽略)

正如我所提到的,我也尝试过使用堆栈,但最终还是归结为错误的基本版本。我怎样才能降级这个软件包?

你不能。 base 固定为GHC安装;获得不同版本的唯一方法是安装一个较旧的编译器,即GHC-7.10。 stack 会自动执行此操作对于你来说,但我不确定这是否是最好的解决方案。



很可能, 实际上可以与GHC-8.0一起使用;实际上约束 base <= 4.9.0 表明它应该。这个约束没有多大意义,因为它只允许预先分割;它应该可能真的是 base< 4.10



所以最好的办法是从github下载源代码,其中 base 实际上没有上限,并使用 cabal install 从本地文件夹安装。如果这样做的话,通知作者放宽对Hackage的绑定。



如果它不能在GHC-8.0中编译,那么最好的办法是将通过编辑源文件然后提交一个拉取请求来使其工作

另外,我会用堆栈来安装包含旧GHC的包。要做到这一点,请使用 base< 4.9 constraint
(你需要在github代码中插入),然后运行 stack setup stack init 堆栈安装


I'm trying to install a program called clanki on Windows 10. In it's installation doc it says to use 'cabal install clanki'. I downloaded cabal, then ghc. Now I run into a version problem for the package base.

$ cabal install clanki
Resolving dependencies...
cabal.exe: Could not resolve dependencies:
trying: clanki-1.2.7 (user goal)
next goal: base (dependency of clanki-1.2.7)
rejecting: base-4.9.0.0/installed-4.9... (conflict: clanki => base<=4.9.0)
rejecting: base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0,
base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0,
base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0,
base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0,
base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable
package requires installed instance)
Dependency tree exhaustively searched.

So clanki requires base to be older than 4.9 (stack says this more clearly than cabal), and I then would like to downgrade base to 4.8.2.0. When I try ghc-pkg unregister base, it doesn't allow me. Not even with --force:

$ ghc-pkg unregister base --force
unregistering would break the following packages: xhtml-3000.2.1 Win32-2.3.1.1 transformers-0.5.2.0 time-1.6.0.1 template-haskell-2.11.0.0 process-1.4.2.0 pretty-1.1.3.3 hpc-0.6.0.3 hoopl-3.10.2.1 haskeline-0.7.2.3 ghci-8.0.1 ghc-boot-th-8.0.1 ghc-boot-8.0.1 ghc-8.0.1 filepath-1.4.1.0 directory-1.2.6.2 deepseq-1.4.2.0 containers-0.5.7.1 Cabal-1.24.0.0 bytestring-0.10.8.1 binary-0.8.3.0 array-0.5.1.1 (ignoring)

As I mentioned, I tried also with stack, but in the end it also comes down to the wrong version of base. How can I downgrade this package?

解决方案

You can't. base is fixed to the GHC install; the only way to get a different version is to install an older compiler, i.e. GHC-7.10. stack would automatically do that for you, but I wouldn't be sure if that's the best solution.

Likely enough, the package will actually work with GHC-8.0; in fact the constraint base <= 4.9.0 indicates that it should. That constraint doesn't make a lot of sense since it only allows the pre-first subrevision; it should probably really be base < 4.10.

So the best thing would be to download the source from github, where base does in fact not have the upper bound, and install it from the local folder with cabal install. If that works, notify the author to relax the bound on Hackage.

If it doesn't compile in GHC-8.0, again the best thing would be to make it work by editing the source and then file a pull request.

Alternatively, I'd then resort to stack for installing the package with an older GHC. To do this, get the source code with the base < 4.9 constraint (you need to insert that in the github code), and run stack setup, stack init and stack install.

这篇关于如何降级与cabal基地?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆