2016-10-03 19 views
2

重現步驟:使用'stack build --profile'時的依賴關係問題?

$ stack new profiling-test 
$ cd profiling-test 
$ stack build --profile 

一個新的項目與lts-7.2和默認模板初始化。我得到的錯誤:

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 profiling-test-0.1.0.0 

Recommended action: try adding the following to your extra-deps in ~/profiling-test/stack.yaml 
- base-4.9.0.0 

You may also want to try the 'stack solver' command 

如果我只是做stack build,它編譯沒有任何錯誤的罰款。

我已將base-4.9.0.0添加到extra-depsstack.yaml,但我得到了同樣的錯誤。

我堆棧版本是:

$ stack --version 
Version 1.1.3, Git revision 225df244ea346a8dc880ef911b002583486a92b2 x86_64 hpack-0.14.0 

而且我運行Ubuntu 14.04信賴。

在此先感謝您的幫助!

回答

2

找到https://github.com/commercialhaskell/stack/issues/1331後找出結果。

解決方案:

  • 而不是做

    $ stack build --profile 
    
  • 務必:

    $ stack build --profile --no-system-ghc 
    

而只是添加--no-system-ghc的一切。你可能需要在做任何事之前做stack setup --no-system-ghc

或者,如評論所建議的那樣,您可以將其添加到該項目或您的全局堆棧項目的stack.yaml

+2

如果你想爲所有命令添加'--no-system-ghc'標誌,你可以將它添加到'stack.yaml'(可能是你的本地項目,而不是項目的一個) –