1

我目前正在尝试使用stack安装helm。我创建了一个简单的项目

stack new sandbox

并添加 helm 作为对sandbox.cabal

library
  hs-source-dirs:      src
  exposed-modules:     Lib
  build-depends:       base >= 4.7 && < 5
                     , helm
  default-language:    Haskell2010

之后我照常运行stack build并得到错误,表明我必须添加helm-0.7.1我的stack.yaml文件。我这样做并且也插入elerea-2.8.0,因为这也是一个要求。这是我的stack.yaml

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-3.12

# Local packages, usually specified by relative directory name
packages:
- '.'

# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps:
- helm-0.7.1
- elerea-2.8.0

# Override default flag values for local packages and extra-deps
flags: {}

# Extra package databases containing global packages
extra-package-dbs: []

# Control whether we use the GHC we find on the path
# system-ghc: true

# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: >= 0.1.4.0

# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64

# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]

再次运行stack build给我这个错误。

While constructing the BuildPlan the following exceptions were encountered:

--  Failure when adding dependencies:    
      helm: needed (-any), couldn't resolve its dependencies
    needed for package: sandbox-0.1.0.0

--  Failure when adding dependencies:    
      cairo: needed (>0.12 && <0.13), 0.13.1.0 found (latest version available)
      mtl: needed (>=2.1 && <2.2), 2.2.1 found (latest version available)
      pango: needed (>0.12 && <0.13), 0.13.1.0 found (latest version available)
      sdl2: needed (>=1.1 && <1.3), 1.3.1 found (latest is 2.1.0)
      time: needed (>=1.4 && <1.5), 1.5.0.1 found (latest version available)
    needed for package: helm-0.7.1

这个错误是什么意思?据我了解,它没有找到正确的版本。

4

1 回答 1

1

它的意思是您尝试使用的堆栈解析器(lts-3.12)与 helm-0.7.1 不兼容。

例如,helm-0.7.1 需要 0.12 到 0.13 之间的 cairo 版本,但 lts-3.12 支持的 cairo 版本是 0.13.1。其他约束也是如此。

helm 可能实际上可以与更高版本的 cairo 一起使用。要测试它,请下载 helm 源代码,修改其 cabal 文件中的依赖项,并将其作为本地包包含在您的堆栈项目中。

另一个建议是查看它是否构建在 cabal 沙箱中。

于 2015-11-23T16:07:22.057 回答