[英]Haskell Stack's executable profiling and ghc options fails to build
我正在尝试调试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
?
“堆栈执行 - 哪个ghc”说什么? 如果您的ghc是全局安装的,那么它可能缺少分析库。 如果是这样,“堆栈设置--no-system-ghc”+“堆栈构建--no-system-ghc”
你的stack.yaml配置是什么? 如果您设置了“ghc- *”的解析器,除非您在“extra-deps”中指定所有依赖项的版本,否则它将无效。 通常你会想要使用堆栈快照 - https://www.stackage.org/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.