在沙箱中的Cabal配置会抱怨“至少以下依赖项丢失”在已安装的包上 [英] Cabal configure in a sandbox complains "At least the following dependencies are missing" on installed packages

查看:342
本文介绍了在沙箱中的Cabal配置会抱怨“至少以下依赖项丢失”在已安装的包上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,它在一个沙箱内,我在我的cabal文件中引入了一个测试套件,它在 hunit = build-depends = 1.2 * 。问题是当我尝试配置时:


$ cabal configure - 启用测试

解决依赖关系......

配置MyProject-0.1.0.0 ...

cabal:至少缺少以下依赖关系:

hunit == 1.2。*


还有其他一些尝试来解决它:


$ cabal install --dependencies-only

解决依赖关系...

所有请求的软件包已经安装完成:

使用--reinstall,如果您想要重新安装。


&


$ cabal install hunit

解决依赖关系。 ..
所有请求的软件包已经安装:
HUnit-1.2.5.2

如果您想要重新安装,请使用--reinstall。

&


$ cab $ install - 启用测试

解决依赖关系...
cabal:无法解决依赖关系:
正在尝试:MyProject-0.1.0.0(用户目标)

拒绝:MyProject-0.1 .0.0:!test(全局约束需要反向标志
选择)
试试:MyProject-0.1.0.0:*测试

下一个目标:hunit
失败(未知软件包:hunit)

依赖树彻底搜索。


- 重新安装 ing什么也没做。

我甚至玩过 - -user - global 标志,即使我使用 cabal 而不是 runhaskell ,它并没有帮助。

我也尝试过删除&重新 init 沙箱。
我也尝试过 delete 沙箱,它仍然给了我同样的错误。
ghc-pkg check 找不到任何错误。



<

顺便说一下,我的一部分人怀疑cabal忽略了我的项目是在沙箱中,因为它不需要安装一些已经放在我的包上的软件包机;它在我的Windows上这样做(这是在Ubuntu上)。是否有可能得到检查?



Ubuntu 14.04.1 LTS

GHC版本:7.6.3

cabal-install版本:1.20.0.3
Cabal库版本:1.20.0.2


现在还试用cabal-install 1.16 .0.2没有成功。

解决方案

软件包名称在Cabal / Hackage中区分大小写,正确的软件包名称是 HUnit 。更改包含以下内容的cabal文件中的行:

  hunit == 1.2。* 





  HUnit == 1.2。* 


I have a project, it's inside a sandbox, I introduced a test-suite in my cabal file and it build-depends on hunit ==1.2.*. The problem is when I try to configure:

$ cabal configure --enable-tests
Resolving dependencies...
Configuring MyProject-0.1.0.0...
cabal: At least the following dependencies are missing:
hunit ==1.2.*

A few more attempts to get it to come around:

$ cabal install --dependencies-only
Resolving dependencies...
All the requested packages are already installed:
Use --reinstall if you want to reinstall anyway.

&

$ cabal install hunit
Resolving dependencies...
All the requested packages are already installed:
HUnit-1.2.5.2
Use --reinstall if you want to reinstall anyway.

&

$ cabal install --enable-tests
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: MyProject-0.1.0.0 (user goal)
rejecting: MyProject-0.1.0.0:!test (global constraint requires opposite flag selection)
trying: MyProject-0.1.0.0:*test
next goal: hunit (dependency of MyProject-0.1.0.0:*test)
fail (unknown package: hunit)
Dependency tree exhaustively searched.

--reinstalling did nothing.
I even played with the --user and --global flags, even tho I'm using cabal and not runhaskell, it doesn't help it.
I also tried to delete & re-init the sandbox.
I tried just deleteing the sandbox too, and it still gave me the same error.
ghc-pkg check finds nothing wrong.

What could it be?
By the way a part of me is suspicious that cabal ignores that my project is in a sandbox, since it didn't bother to install some packages that were already on my machine; it does so on my Windows (this is on Ubuntu). Is it possible to get that checked?

Ubuntu 14.04.1 LTS
GHC version: 7.6.3
cabal-install version: 1.20.0.3
Cabal library version: 1.20.0.2

Also tried now with cabal-install 1.16.0.2 without success.

解决方案

Package names are case sensitive in Cabal/Hackage, the correct package name is HUnit. Change the line in your cabal file containing:

hunit ==1.2.*

To

HUnit ==1.2.*

这篇关于在沙箱中的Cabal配置会抱怨“至少以下依赖项丢失”在已安装的包上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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