Haskell Stack的可执行分析和ghc选项无法构建

时间:2016-07-15 20:52:07

标签: haskell haskell-stack

我试图在Haskell项目中调试性能问题,但是我无法编译成分析,所以我可以通过Approvals.SetCaller(); Assert.IsTrue(NCrunchReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt")); 命令行参数来使用它。

我的+RTS -p文件中GHC的选项是:

.cabal

我试图建立它:

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

1 个答案:

答案 0 :(得分:3)

什么是“堆栈执行 - 哪个ghc”说的?如果您的ghc是全局安装的,那么它可能缺少分析库。如果是这样,“堆栈设置--no-system-ghc”+“堆栈构建--no-system-ghc”

你的stack.yaml配置是什么?如果您设置了“ghc- *”的解析器,除非您在“extra-deps”中指定所有依赖项的版本,否则它将无效。通常您会想要使用堆叠快照 - https://www.stackage.org/