我正在尝试调试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使用。
发布于 2016-07-15 21:17:16
“堆栈主管--哪个ghc”说什么?如果您的ghc是全局安装的,它可能缺少分析库。如果是这样,“堆栈设置-无系统-ghc”+“堆栈构建-无系统-ghc”。
您的stack.yaml配置是什么?如果您已经设置了"ghc-*“的解析器,那么它将无法工作,除非您在”附加-deps“中指定所有依赖项的版本。通常您会希望使用堆栈快照- https://www.stackage.org/
https://stackoverflow.com/questions/38404833
复制相似问题