haskell – Cabal沙箱正在使用全局依赖.无法解决

我正在尝试将timerep添加到现有应用程序中.我无法解决我的依赖关系.看起来它正在使用全局安装的time == 1.4.2版本,当> = 1.5对我的应用程序来说是理想的.

如何让cabal使用时间1.5?我已经通过unix,tls,process,timerep进行了调查,如果它只使用时间> = 1.5,它们似乎都能正常工作.

这是错误:

serials> cabal install --only-dependencies
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: serials-0.1.0.2 (user goal)
trying: mandrill-0.2.2.0 (dependency of serials-0.1.0.2)
trying: http-client-tls-0.2.2 (dependency of mandrill-0.2.2.0)
trying: tls-1.2.17 (dependency of http-client-tls-0.2.2)
trying: x509-validation-1.5.2 (dependency of tls-1.2.17)
trying: process-1.2.0.0/installed-487... (dependency of x509-validation-1.5.2)
next goal: unix (dependency of process-1.2.0.0/installed-487...)
rejecting: unix-2.7.0.1/installed-299... (conflict: unix =>
time==1.4.2/installed-bf9...,serials => time>=1.5)
rejecting: unix-2.7.1.0,2.7.0.1,2.7.0.0,2.6.0.1,2.6.0.0,2.5.1.1,2.5.1.0,2.5.0.0,2.4.2.0,2.4.1.0,2.4.0.2,2.4.0.1,2.4.0.0,2.3.2.0,2.3.1.0,2.3.0.0,2.2.0.0,2.0 (conflict: process => unix==2.7.0.1/installed-299...)
Dependency tree exhaustively searched.

Cabal file

-- Initial serials.cabal generated by cabal init.  For further
-- documentation,see http://haskell.org/cabal/users-guide/

name:                serials
version:             0.1.0.2
synopsis:            serials
description:         serials
license:             MIT
license-file:        LICENSE
author:              Sean Hess
maintainer:          Sean Hess
-- copyright:
category:            Web Scraper
build-type:          Simple
extra-source-files:  README.md
cabal-version:       >=1.10
Source-repository head
  type:       git
  location:   git@github.com:seanhess/serials.git

executable serials
  main-is:             Main.hs
  hs-source-dirs:      server
  ghc-options:         -fcontext-stack=36
  -- other-modules:
  -- other-extensions:
  default-language:     Haskell2010
  build-depends:
    base >=4.7 && <5,tagsoup,text,scalpel,containers,network-uri,monad-loops,wreq,lens,bytestring,parsec,utf8-string,xml,feed,regex-pcre,aeson,network,wai,wai-extra,wai-cors,wai-middleware-static,warp,servant-server >= 0.4,rethinkdb >= 1.16,transformers,either,unordered-containers,mtl,http-types,safe,hashable,resource-pool,time >= 1.5,pooled-io,shelly,string-conversions,bcrypt,random,jwt,cookie,entropy,mandrill == 0.2.2.0,email-validate,blaze-markup,blaze-html,iso8601-time,scotty == 0.10.0,timerep >= 2.0.0

解决方法

cabal-install很难完整地描述安装问题的相互不兼容性.它决定打印第一条失败之路.

但是,它打印完全搜索的依赖树.这表明实际上没有解决给定问题的方法.

通常有帮助的一件事是查看cabal-install所做的选择,找到一个看起来不理想的选择,然后添加一个显式约束来改变它.这可能会导致更好的错误消息.

让我们试试[请注意,我不确定我是否拥有与您相同的软件包数据库,因此它可能会在您的系统上产生不同的结果].

你有(已安装的软件包的模数):

$cabal install --only-dependencies
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: serials-0.1.0.2 (user goal)
trying: mandrill-0.2.2.0 (dependency of serials-0.1.0.2)
trying: http-client-tls-0.2.2 (dependency of mandrill-0.2.2.0)
trying: tls-1.2.17 (dependency of http-client-tls-0.2.2)
trying: x509-validation-1.5.2 (dependency of tls-1.2.17)
trying: process-1.2.0.0/installed-06c... (dependency of x509-validation-1.5.2)
next goal: unix (dependency of process-1.2.0.0/installed-06c...)
rejecting: unix-2.7.0.1/installed-f86... (conflict: unix =>
time==1.4.2/installed-9b3...,2.0 (conflict: process => unix==2.7.0.1/installed-f86...)
Dependency tree exhaustively searched.

通过这一点,unix发生了错误,这是进程的依赖.因此,选择的已安装的进程实例会导致问题.那么,如果我们不允许选择该流程实例呢?

$cabal install --only-dependencies --constraint="process source"
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: serials-0.1.0.2 (user goal)
next goal: time (dependency of serials-0.1.0.2)
rejecting: time-1.4.2/installed-9b3... (conflict: serials => time>=1.5)
trying: time-1.5.0.1
next goal: rethinkdb (dependency of serials-0.1.0.2)
rejecting: rethinkdb-1.16.0.0 (conflict: time==1.5.0.1,rethinkdb =>
time==1.4.*)
rejecting: rethinkdb-1.15.2.1,1.15.2.0,1.15.1.0,1.15.0.0,1.8.0.5,1.8.0.4,1.8.0.3,1.8.0.2,1.8.0.1,1.8.0.0,0.1.0.0 (conflict: serials =>
rethinkdb>=1.16)
Dependency tree exhaustively searched.

啊哈!因此rethinkdb是连续出版物的直接依赖关系,它具有明确的时间依赖性== 1.4.*.这与时间序列的依赖性> = 1.5直接冲突.

这不容易修复.您需要使rethinkdb与较新的时间库一起使用,或使用较旧的序列号.

我们现在进入推测领域:rethinkdb实际上可以用于较新版本的时间,但不能保证.我们可以尝试指示cabal-install考虑这样的安装计划:

$cabal install --only-dependencies --allow-newer=time

这实际上会在我的机器上产生安装计划.我没有尝试构建它,我不知道它是否有效.但它可能值得一试.

相关文章

什么是设计模式一套被反复使用、多数人知晓的、经过分类编目...
单一职责原则定义(Single Responsibility Principle,SRP)...
动态代理和CGLib代理分不清吗,看看这篇文章,写的非常好,强...
适配器模式将一个类的接口转换成客户期望的另一个接口,使得...
策略模式定义了一系列算法族,并封装在类中,它们之间可以互...
设计模式讲的是如何编写可扩展、可维护、可读的高质量代码,...