【发布时间】:2016-10-21 21:42:11
【问题描述】:
我正在尝试在 Stack 中进行分析,以便获得与 RWH 的 Chapter 25 上指示的指标相同的指标。我开始了一个新的Stack项目,如下:
stack new test
然后,如here所示,我跑了:
stack install --executable-profiling --library-profiling --ghc-options="-rtsopts"
但是此命令失败并出现以下错误:
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 test-0.1.0.0
Recommended action: try adding the following to your extra-deps in /home/damian/test/stack.yaml
- base-4.9.0.0
You may also want to try the 'stack solver' command
我已经尝试了上面的建议,但没有成功。
如果我运行stack build,那么程序就不会出错。
作为另一个问题,我想知道是否无法使用上述标志运行 stack test 或 stack exec(这似乎比安装可执行文件以对其进行分析更合乎逻辑)。
【问题讨论】:
-
当您尝试
stack build时会发生什么? -
另外,我发现如果您使用上述选项运行
stack build,那么它会将可执行文件编译到.stack-work/下的位置,您无需安装即可运行它。 -
stack build可以毫无问题地构建代码。我忘记添加该信息,谢谢!
标签: debugging haskell profiling haskell-stack