2014-10-30 39 views
7

使用​​腳手架搭建我的haskell項目後,發生一些cabal故障。cabal build --ghc-options =「 - fforce-recomp -Wall -fno-code」失敗

我不認爲問題與該插件(看起來更像一般的陰謀的問題),因爲我可以複製它從一個標準cabal init開始。如果這個問題與SublimeHaskell有關,或者許多人似乎正在使用它,我會感到驚訝。

這裏是被生成的小集團文件(I簡化/縮短它一個位):

(聖項目沿產生一些示例性源文件)

name:     test-holy 
version:    0.1.0.0 
build-type:    Simple 
cabal-version:   >=1.10 

library 
    exposed-modules:  TestHoly 
         , TestHoly.Swallow 
         , TestHoly.Coconut 
    build-depends:  base >=4.7 && <4.8 
    ghc-options:   -Wall 
    hs-source-dirs:  src 
    default-language:  Haskell2010 

cabal build工作

以下命令不起作用:

$ cabal clean && cabal configure && cabal build --ghc-options="-fforce-recomp -Wall -fno-code" 

cleaning... 
Resolving dependencies... 
Configuring test-non-holy2-0.1.0.0... 
Building test-non-holy2-0.1.0.0... 
Preprocessing library test-non-holy2-0.1.0.0... 
[1 of 3] Compiling TestHoly.Coconut (src/TestHoly/Coconut.hs, nothing) 
[2 of 3] Compiling TestHoly.Swallow (src/TestHoly/Swallow.hs, nothing) 
[3 of 3] Compiling TestHoly   (src/TestHoly.hs, nothing) 
[1 of 3] Compiling TestHoly.Coconut (src/TestHoly/Coconut.hs, nothing) 
[2 of 3] Compiling TestHoly.Swallow (src/TestHoly/Swallow.hs, nothing) 
[3 of 3] Compiling TestHoly   (src/TestHoly.hs, nothing) 
ar: dist/build/TestHoly.o: No such file or directory 
ar: dist/build/TestHoly/Swallow.o: No such file or directory 
ar: dist/build/TestHoly/Coconut.o: No such file or directory 

據我所知,由於-fno-code標誌(省略代碼生成)沒有生成目標文件,因此連接器失敗。這是預期的嗎?還是應該鏈接器沒有被調用?

爲什麼我運行那個cabal命令?

正如我前面所說:我使用SublimeText來編輯我的項目。它失敗的項目,聖生成以下消息小集團文件:

Build FAILED 

REMAINING STDERR: 

Warning: the following files would be used as linker inputs, but linking is not being done: dist/build/TestHoly.dyn_o dist/build/TestHoly/Swallow.dyn_o dist/build/TestHoly/Coconut.dyn_o 
ghc: no input files 
Usage: For basic information, try the `--help' option. 

通過討論SublimeHaskell#158我接着NH2的建議,直接運行這個陰謀命令(因爲它是由SublimeHaskell使用的)。

我會很感激,如果有人可以在這個光!

版本信息

$ cabal --version 
cabal-install version 1.18.0.5 
using version 1.18.1.4 of the Cabal library 

$ ghc --version 
The Glorious Glasgow Haskell Compilation System, version 7.8.3 

$ system_profiler SPSoftwareDataType 
Software: 

    System Software Overview: 

     System Version: OS X 10.10 (14A389) 
     Kernel Version: Darwin 14.0.0 
+0

不,如果你通過'-c'標誌GHC工作? – 2014-10-31 01:24:28

+1

'cabal build --ghc-options =「 - c -fforce-recomp -Wall -fno-code」'給出同樣的問題。我通過將'--verbose'傳遞給cabal來檢查,並且在ghc命令中傳遞該標誌:'/ usr/bin/ghc --make -fbuilding-cabal-package ... -Wall -c -fforce-recomp - 牆-fno-code' – dvekeman 2014-11-01 11:54:14

+0

你可以嘗試添加'-fwrite-interface'嗎? – 2015-09-17 09:59:42

回答

0

這是陰謀的已知問題。

https://github.com/haskell/cabal/issues/1176

如果不通過-fforce-recomp你可能是確定的增量檢查,當你需要做一個乾淨的構建只打了錯誤。

但是沒有說,陰謀只是不知道該怎麼辦時,GHC並沒有實際編譯的東西...