【发布时间】:2016-07-15 20:52:06
【问题描述】:
我正在尝试调试 Haskell 项目中的性能问题,但我无法在其中编译分析,因此我可以通过 +RTS -p 命令行参数使用它。
我的.cabal 文件中的 GHC 选项是:
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror
我正在尝试构建它:
stack build --executable-profiling --library-profiling --ghc-options="-fprof-auto -rtsopts"
结果:
While constructing the BuildPlan the following exceptions were encountered:
-- Failure when adding dependencies:
base: needed (>=2 && <5), not present in build plan (latest applicable is 4.9.0.0)
mtl: needed (>=2.1 && <2.3), couldn't resolve its dependencies
random: needed (-any), couldn't resolve its dependencies
transformers: needed (>=0.3 && <0.6), couldn't resolve its dependencies
transformers-compat: needed (>=0.4 && <0.6), couldn't resolve its dependencies
needed for package: MonadRandom-0.4.2.3
-- Failure when adding dependencies:
base: needed (>=4 && <5), not present in build plan (latest applicable is 4.9.0.0)
stm: needed (>=2.0 && <2.5), couldn't resolve its dependencies
transformers: needed (>=0.2 && <0.6), couldn't resolve its dependencies
needed for package: StateVar-1.1.0.4
<snipped large log>
即使只尝试 stack build --executable-profiling 也会导致相同的错误。
作为参考,我的库依赖项是:
build-depends: base >= 4.7 && < 5
, aeson
, servant
, servant-server
, wai
, warp
, either
, bytestring
, transformers
, postgresql-simple
, amazonka
, amazonka-sqs
, lens
, text
, time
, resource-pool
我该如何解决这个问题,以便我可以使用堆栈编译我的项目并内置分析以与+RTS -p 一起使用?
【问题讨论】:
-
在较新的堆栈版本中,您也可以只调用
stack build --profile作为所有其他标志的快捷方式。 -
更多信息请见this example
标签: haskell haskell-stack