4

当我尝试从 hackage 安装 style-haskell 软件包时,我相对一致地得到相同的错误。安装过程很顺利,直到安装导管,但安装导管几乎没有正确安装。

错误信息的结尾:

        17 warnings and 2 errors generated.
        Failed to install conduit-1.0.8
        cabal: Error: some packages failed to install:
        conduit-1.0.8 failed during the building phase. The exception was:
        ExitFailure 1
        stylish-haskell-0.5.8.0 depends on conduit-1.0.8 which failed to install. 
        yaml-0.8.5.1 depends on conduit-1.0.8 which failed to install.

我得到的完整终端输出是:

        Configuring conduit-1.0.8...

        /var/folders/cn/67wph78d62qc1v_lm7z2mb980000gn/T/32054.c:1:12:
             warning: control reaches end of non-void function [-Wreturn-type]
        int foo() {}
                   ^
        1 warning generated.
        Building conduit-1.0.8...
        Preprocessing library conduit-1.0.8...

        Data/Conduit/Binary.hs:165:14:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    let c' = c - S.length bs
                         ^

        Data/Conduit/Binary.hs:166:18:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    assert (c' >= 0) $
                             ^

        Data/Conduit/Binary.hs:171:34:
             warning: missing terminating ' character [-Winvalid-pp-token]
                                pullLimited c'
                                             ^

        Data/Conduit/Binary.hs:281:62:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    await >>= maybe (return $ L.fromChunks $ front []) go'
                                                                         ^

        Data/Conduit/Binary.hs:283:11:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    go' bs =
                      ^

        Data/Conduit/Binary.hs:299:39:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    await >>= maybe (return ()) go'
                                                  ^

        Data/Conduit/Binary.hs:301:11:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    go' bs =
                      ^
        7 warnings generated.

        Data/Conduit/Internal.hs:79:47:
             warning: missing terminating ' character [-Winvalid-pp-token]
        -- * /i/ is the type of values for this @Pipe@'s input stream.
                                                      ^

        Data/Conduit/Internal.hs:81:47:
             warning: missing terminating ' character [-Winvalid-pp-token]
        -- * /o/ is the type of values for this @Pipe@'s output stream.
                                                      ^

        Data/Conduit/Internal.hs:152:64:
             warning: \u used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
                local f (NeedInput p c) = NeedInput (\i -> local f (p i)) (\u -> local f (c u))
                                                                           ^

        Data/Conduit/Internal.hs:170:62:
             warning: \u used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
                listen (NeedInput p c) = NeedInput (\i -> listen (p i)) (\u -> listen (c u))
                                                                         ^

        Data/Conduit/Internal.hs:175:26:
             warning: missing terminating ' character [-Winvalid-pp-token]
                     return $ do (x,w') <- listen p
                                     ^

        Data/Conduit/Internal.hs:176:46:
             warning: missing terminating ' character [-Winvalid-pp-token]
                                 return (x, w `mappend` w')
                                                         ^

        Data/Conduit/Internal.hs:180:58:
             warning: \u used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
                pass (NeedInput p c) = NeedInput (\i -> pass (p i)) (\u -> pass (c u))
                                                                     ^

        Data/Conduit/Internal.hs:197:74:
             warning: \u used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
                catchError (NeedInput p c) f = NeedInput (\i -> catchError (p i) f) (\u -> catchError (c u) f)
                                                                                     ^

        Data/Conduit/Internal.hs:306:50:
             warning: missing terminating ' character [-Winvalid-pp-token]
        awaitForever :: Monad m => (i -> Pipe l i o r m r') -> Pipe l i o r m r
                                                         ^

        Data/Conduit/Internal.hs:338:4:
             error: invalid preprocessing directive
              #-}
               ^

        Data/Conduit/Internal.hs:543:13:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    pipe' <- mpipe
                        ^

        Data/Conduit/Internal.hs:544:18:
             warning: missing terminating ' character [-Winvalid-pp-token]
                    case pipe' of
                             ^

        Data/Conduit/Internal.hs:546:29:
             warning: missing terminating ' character [-Winvalid-pp-token]
                        _ -> return pipe'
                                        ^

        Data/Conduit/Internal.hs:581:83:
             warning: missing terminating ' character [-Winvalid-pp-token]
        mapInput f f' (NeedInput p c)    = NeedInput (mapInput f f' . p . f) (mapInput f f' . c)
                                                                                          ^

        Data/Conduit/Internal.hs:584:82:
             warning: missing terminating ' character [-Winvalid-pp-token]
        mapInput f f' (Leftover p i)     = maybe id (flip Leftover) (f' i) $ mapInput f f' p
                                                                                         ^

        Data/Conduit/Internal.hs:605:4:
             error: invalid preprocessing directive
              #-}
               ^

        Data/Conduit/Internal.hs:650:35:
             warning: \u used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
                    loop = awaitE >>= either (\u -> return (u, r)) (\_ -> loop)
                                              ^

        Data/Conduit/Internal.hs:671:14:
             warning: missing terminating ' character [-Winvalid-pp-token]
                let final' = do
                         ^

        Data/Conduit/Internal.hs:674:58:
             warning: missing terminating ' character [-Winvalid-pp-token]
                return (liftIO (I.writeIORef ref False) >> src, final')
                                                                     ^
        17 warnings and 2 errors generated.
        Failed to install conduit-1.0.8
        cabal: Error: some packages failed to install:
        conduit-1.0.8 failed during the building phase. The exception was:
        ExitFailure 1
        stylish-haskell-0.5.8.0 depends on conduit-1.0.8 which failed to install.
        yaml-0.8.5.1 depends on conduit-1.0.8 which failed to install.
4

3 回答 3

8

我不是这里的专家,但我认为这是由于 Mavericks 将标准替换为gcc带有-semi-compatible 包装器的包装器clang版本。gcc它不时使 GHC 窒息。您可以通过编辑来修复它,/usr/local/lib/ghc-7.6.3/settings以便"C compiler command"入口指向有效的gcc.

例如,我gcc从 Homebrew 安装了 4.8,然后将设置行更改为

 ("C compiler command", "/usr/local/bin/gcc-4.9")
于 2013-11-08T04:12:51.363 回答
5

正如在其他一些答案中所提到的,这是因为 gcc 被 Clang 取代,至少从 Xcode 5 开始。

GHC 依靠 GCC 的预处理器来支持类似 c++ 的#something宏,并且看起来 Clang 的行为略有不同,这导致包含此类宏的 haskell 源的编译失败。

该修复程序实际上显示在 Haskell 平台的 Mac 页面上: https ://www.haskell.org/platform/mac.html

它由一个简单的 bash 脚本组成,它充当 Clang 的包装器。

要安装它:

  • 转到https://www.haskell.org/platform/ghc-clang-wrapper
  • 按 command-s 将脚本保存在下载文件夹中。
  • 通过在终端中运行以下指令来安装它:

    cd ~/Downloads
    chmod +x ghc-clang-wrapper
    ./ghc-clang-wrapper
    
  • 然后按照它打印的简单说明进行操作。

完成后,只需重新启动 cabal install 命令,它就会运行良好。

于 2014-06-26T05:09:28.757 回答
1

此问题可以通过以下解决方法修复工作。

https://github.com/snoyberg/conduit/issues/147

于 2014-05-22T04:11:13.937 回答