在OSX 10.9.1上使用Cabal 1.16.0构建Cabal 1.18.x时出错

时间:2014-01-10 23:50:08

标签: haskell cabal cabal-install

我无法在Mac OS X 10.9.1上使用当前版本的Cabal(1.16.0)构建任何软件包。

这包括Cabal本身,即目前无法更新到1.18.x,我看到一个错误,如

Failed to install Cabal-1.18.1.2
cabal: Error: some packages failed to install:
Cabal-1.18.1.2 failed during the configure step. The exception was:
ExitFailure 1
cabal-install-1.18.0.2 depends on Cabal-1.18.1.2 which failed to install.

错误消息的最后几行(我认为是相关的)是

In file included from /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/include/Rts.h:234,

                 from /var/folders/w8/w_9g62j15xs9pls1fxw3kkk00000gn/T/ghc26435_0/ghc26435_0.c:1:0:

/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/include/rts/Threads.h:19:23:
     error: sys/types.h: No such file or directory
In file included from /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/include/Rts.h:234,

                 from /var/folders/w8/w_9g62j15xs9pls1fxw3kkk00000gn/T/ghc26435_0/ghc26435_0.c:1:0:

/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/include/rts/Threads.h:49:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘forkProcess’

我认为这实际上与文件“Threads.h”无关,这似乎在语法上是有效的,但我仍然在这里包含相关的行 -

#if !defined(mingw32_HOST_OS)
pid_t  forkProcess     (HsStablePtr *entry); // This is line 49
#else
pid_t  forkProcess     (HsStablePtr *entry)
    GNU_ATTRIBUTE(__noreturn__);
#endif

我能找到最接近解释的是this issue on the Cabal GitHub repository,看起来它提供了(a)补丁和(b)修复,但我无法让它们中的任何一个工作 - 主要是因为我不知道在我的系统上找到../cabal/Cabal/文件夹的位置。

任何人都可以提供任何提示吗?

1 个答案:

答案 0 :(得分:2)

由于语法错误位于GHC RTS标头内,因此该问题看起来并不特定于Cabal。我怀疑这是由gcc在较新的OS X版本上成为clang的别名引起的。 the Haskell Platform OS X download page描述了此问题的解决方法。下一版本的Haskell平台将在开箱即用的OS X 10.9上运行。