阴谋集团构建 --GHC-选项= "-fforce-recomp -Wall -fno-code"失败



在使用神圣项目搭建我的haskell项目后,我遇到了一些阴谋失败。

我不认为这个问题与该插件有关(看起来更像是一般的阴谋集团问题),因为我可以从标准的cabal init开始复制它。如果这个问题与SublimeHaskell有关,我会感到惊讶,因为很多人似乎都在使用它

这是生成的阴谋集团文件(我简化/缩短了一点):

(神圣项目生成了一些示例源文件)

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标志(省略代码生成),没有生成对象文件,因此链接器失败。这是意料之中的事吗?或者应该没有调用链接器?

我为什么要指挥那个阴谋集团

正如我之前所说:我正在使用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的建议,直接运行这个cabal命令(因为它是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

这是阴谋集团中的一个已知问题。

请参阅https://github.com/haskell/cabal/issues/1176

如果您没有通过-fforce-recomp,那么您可能可以进行增量检查,并且只有在需要进行干净构建时才会遇到错误。

但如果没有这一点,当ghc并没有真正编译东西时,cabal就是不知道该怎么办。。。

最新更新