haskell - 使用 'stack build --profile' 时出现依赖性问题?

标签 haskell haskell-stack

重现步骤:

$ stack new profiling-test
$ cd profiling-test
$ stack build --profile

使用 lts-7.2 和默认模板初始化新项目。我收到错误:

While constructing the BuildPlan the following exceptions were encountered:

--  While attempting to add dependency,
    Could not find package base in known packages

--  Failure when adding dependencies:
      base: needed (>=4.7 && <5), stack configuration has no specified version (latest applicable is 4.9.0.0)
    needed for package profiling-test-0.1.0.0

Recommended action: try adding the following to your extra-deps in ~/profiling-test/stack.yaml
- base-4.9.0.0

You may also want to try the 'stack solver' command

如果我只是进行堆栈构建,它可以正常编译,没有任何错误。

我已将 base-4.9.0.0 添加到 stack.yaml 中的 extra-deps,但出现了相同的错误。

我的堆栈版本是:

$ stack --version
Version 1.1.3, Git revision 225df244ea346a8dc880ef911b002583486a92b2 x86_64 hpack-0.14.0

我正在运行 Ubuntu 14.04 trusty。

预先感谢您的帮助!

最佳答案

找到https://github.com/commercialhaskell/stack/issues/1331后就明白了.

解决方案:

  • 而不是做

    $ stack build --profile
    
  • 做:

    $ stack build --profile --no-system-ghc
    

只需将 --no-system-ghc 添加到所有内容即可。您可能还需要在执行所有操作之前进行stack setup --no-system-ghc

或者,按照注释的建议,您可以将其添加到项目或全局堆栈项目的 stack.yaml 中。

关于haskell - 使用 'stack build --profile' 时出现依赖性问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39823472/

相关文章:

haskell - 使用类型类在 Haskell 应用程序中实现依赖倒置?

c++ - VBO 一般几何

haskell - haskell 中的 "Open Data Types and Open Functions"

haskell - 不是仿函数(或不可遍历)的可折叠示例?

unit-testing - 使用 Haskell Stack 运行 detailed-0.9 测试套件时为 "module cannot be found locally"

haskell - 如何列出 `stack` 安装的全局包?

algorithm - 我如何从单个种子廉价地产生无限可拆分的非冲突数字流?

haskell - 如何在堆栈中使用 "-ddump-minimal-imports"

haskell - 如何确定 Haskell 可执行文件需要哪些操作系统依赖包?

haskell - 如何将环境变量传递给通过堆栈运行的 Haskell 程序?