使用脚手架搭建我的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
不,如果你通过'-c'标志GHC工作? – 2014-10-31 01:24:28
'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
你可以尝试添加'-fwrite-interface'吗? – 2015-09-17 09:59:42