cabal-install不考虑我安装的转换器版本 [英] My installed transformers version is not considered by cabal-install
问题描述
我对Haskell阴谋集团是完全陌生的,我正在努力使yesod正常工作.
I am totally new to Haskell an cabal and I'm trying to make yesod work.
我的阴谋集团版本是阴谋集团安装版本1.20.0.3使用Cabal库的1.20.0.2版本
My cabal version is cabal-install version 1.20.0.3 using version 1.20.0.2 of the Cabal library
这是当我tru安装alex时发生的事情:
This is what happends when I tru to install alex:
$ cabal install alex
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: alex-3.1.4 (user goal)
next goal: QuickCheck (dependency of alex-3.1.4)
rejecting: QuickCheck-2.8.1, 2.8 (global constraint requires ==2.7.6)
trying: QuickCheck-2.7.6
next goal: transformers (dependency of QuickCheck-2.7.6)
rejecting: transformers-0.4.3.0, 0.4.2.0, 0.4.1.0, 0.3.0.0, 0.2.2.1, 0.2.2.0,
0.2.1.0, 0.2.0.0, 0.1.4.0, 0.1.3.0, 0.1.1.0, 0.1.0.1, 0.1.0.0, 0.0.1.0,
0.0.0.0, 0.4.0.0 (global constraint requires installed instance)
Dependency tree exhaustively searched.
第二次尝试:
$ cabal install alex happy yesod-bin --allow-newer
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: alex-3.1.4 (user goal)
trying: QuickCheck-2.7.6/installed-1a8... (dependency of alex-3.1.4)
trying: tf-random-0.5/installed-ef3... (dependency of
QuickCheck-2.7.6/installed-1a8...)
next goal: primitive (dependency of tf-random-0.5/installed-ef3...)
rejecting: primitive-0.5.0.1/installed-8e5... (global constraint requires
==0.6)
rejecting: primitive-0.6 (conflict: tf-random =>
primitive==0.5.0.1/installed-8e5...)
rejecting: primitive-0.5.4.0, 0.5.3.0, 0.5.2.1, 0.5.1.0, 0.5.0.1, 0.5, 0.4.1,
0.4.0.1, 0.4, 0.3.1, 0.3, 0.2.1, 0.2, 0.1 (global constraint requires ==0.6)
Dependency tree exhaustively searched.
我必须做什么来安装alex?
What do I have to do to install alex?
一个相关的问题是: cabal安装---全局约束要求已安装实例
@kosmikus对这个问题的评论是:
The comment by @kosmikus on that question is:
因此Stackage LTS配置文件包含约束转换器已安装,表示仅已存在的版本可以使用变压器.这是合理的,因为GHC随附了特定版本的变压器.对于ghc-7.8,这是变形金刚0.3.0.0.由于某种原因,此安装版本不是由cabal-install考虑.您的部分日志不包含足够的信息以了解原因.
So the Stackage LTS config file contains the constraint transformers installed, meaning that only an already present version of transformers can be used. This is reasonable, because GHC ships with a specific version of transformers. For ghc-7.8, this is transformers-0.3.0.0. For some reason, this installed version is not considered by cabal-install. Your partial log doesn't contain sufficient info to see why.
如何修复Stackage LTS配置文件?在Ubuntu上它在哪里?
How can I fix my Stackage LTS config file? Where is it on Ubuntu?
推荐答案
问题的原因是我的GHC太旧了.我下载了新版本并解决了问题.
The reason of the problem was that my GHC was too old. I downloaded a newer version and solved the problem.
尝试失败(错误)
当前目录中应该有一个 cabal.config
文件.使用任何文本编辑器打开它,并搜索已安装的变形金刚
字符串.
You should have a cabal.config
file in your current directory. Open it with any text editor and serach for the transformers installed
string.
找到它后,将其替换为 transformers == 0.4.3.0
或您喜欢的任何其他版本.
Once you have found it, replace it with transformers ==0.4.3.0
or any other version you like.
这是一个糟糕的解决方案,因为dfeurer写道:
It is a bad solution, because, as dfeurer writes:
transformers
在程序包依赖关系结构中位于非常低的位置.一世相信它仅取决于base
;我想大多数Hackage上的软件包直接或间接取决于它.如果你升级transformers
,实际上系统中的每个依赖项都会搞砸了,这与您想要的相反使用Stackage.
transformers
sits very far down in the package dependency structure. I believe it depends only onbase
; I imagine a large majority of packages on Hackage depend, directly or indirectly, on it. If you upgradetransformers
, practically every dependency in the system will go screwy, which is the opposite of what you're going for if you're using Stackage.
Sibi的清洁解决方案
按原样使用堆叠包装.如果您有一些导致问题的全局软件包,请删除它们并单独使用堆栈.在每个项目中使用沙箱也是一个好主意.
Use the stackage packages as it is. If you have some global package causing problem, then remove them and use stackage exclusively. Also using sandbox for each project is a good idea.
这篇关于cabal-install不考虑我安装的转换器版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!