重现步骤:
$ 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/