我試圖在堆棧中進行分析工作,以便我可以得到與RWH的Chapter 25上指示的指標相同的指標。我開始一個新的堆棧的項目,具體如下:與堆棧分析
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-work /'下的一個位置,你可以在不安裝它的情況下運行它。 –
'stack build'構建代碼沒有問題。我忘了添加這些信息,謝謝! –