首先感谢您帮助我用cabal xD解决我的灾难......
我正在使用OS X El Capitan 10.11.3,64位。
我从2013年5月2013.2.0.0的https://www.haskell.org/platform/prior.html安装了Haskell平台,特别是因为我需要使用ghc 7.6.3
然后当我执行cabal更新...我的头痛开始......
Resolving dependencies...
Configuring binary-0.8.2.0...
/var/folders/3l/wflf71t55t92rrvt8lhx_8700000gn/T/10157.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
Building binary-0.8.2.0...
Preprocessing library binary-0.8.2.0...
src/Data/Binary.hs:198:43:
warning: missing terminating ' character [-Winvalid-pp-token]
-- This is just a convenience function, it's defined simply as:
^
src/Data/Binary.hs:253:35:
warning: missing terminating ' character [-Winvalid-pp-token]
-- This mechanism makes use of GHC's efficient built-in generics
^
2 warnings generated.
src/Data/Binary/Put.hs:110:26:
warning: missing terminating ' character [-Winvalid-pp-token]
PairS x w' = unPut k
^
src/Data/Binary/Put.hs:111:42:
warning: missing terminating ' character [-Winvalid-pp-token]
in PairS (f x) (w `mappend` w')
^
src/Data/Binary/Put.hs:115:26:
warning: missing terminating ' character [-Winvalid-pp-token]
PairS b w' = unPut k
^
src/Data/Binary/Put.hs:116:38:
warning: missing terminating ' character [-Winvalid-pp-token]
in PairS b (w `mappend` w')
^
src/Data/Binary/Put.hs:123:22:
warning: missing terminating ' character [-Winvalid-pp-token]
PairS b w' = unPut (k a)
^
src/Data/Binary/Put.hs:124:34:
warning: missing terminating ' character [-Winvalid-pp-token]
in PairS b (w `mappend` w')
^
src/Data/Binary/Put.hs:257:64:
warning: missing terminating ' character [-Winvalid-pp-token]
-- written in host order, host endian form, for the machine you're on.
^
src/Data/Binary/Put.hs:286:64:
warning: missing terminating ' character [-Winvalid-pp-token]
-- written in host order, host endian form, for the machine you're on.
^
8 warnings generated.
src/Data/Binary/Get.hs:26:7:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Let's decode binary data representing illustrated here.
^
src/Data/Binary/Get.hs:43:71:
warning: missing terminating ' character [-Winvalid-pp-token]
-- The fields in @Trade@ are marked as strict (using @!@) since we don't need
^
src/Data/Binary/Get.hs:48:12:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Now, let's have a look at a decoder for this format.
^
src/Data/Binary/Get.hs:62:20:
warning: missing terminating ' character [-Winvalid-pp-token]
--getTrade' :: 'Get' Trade
^
src/Data/Binary/Get.hs:63:79:
warning: missing terminating ' character [-Winvalid-pp-token]
--getTrade' = Trade '<$>' 'getWord32le' '<*>' 'getWord32le' '<*>' 'getWord16le'
^
src/Data/Binary/Get.hs:70:7:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Let's first define a function that decodes many @Trade@s.
^
src/Data/Binary/Get.hs:88:27:
warning: missing terminating '"' character [-Winvalid-pp-token]
-- input <- BL.readFile \"trades.bin\"
^
src/Data/Binary/Get.hs:235:64:
warning: missing terminating ' character [-Winvalid-pp-token]
-- The lazy interface consumes a single lazy 'L.ByteString'. It's the easiest
^
src/Data/Binary/Get.hs:236:47:
warning: missing terminating ' character [-Winvalid-pp-token]
-- interface to get started with, but it doesn't support interleaving I\/O and
^
src/Data/Binary/Get.hs:298:23:
warning: missing terminating ' character [-Winvalid-pp-token]
runGetState g lbs0 pos' = go (runGetIncremental g) lbs0
^
src/Data/Binary/Get.hs:300:53:
warning: missing terminating ' character [-Winvalid-pp-token]
go (Done s pos a) lbs = (a, L.chunk s lbs, pos+pos')
^
src/Data/Binary/Get.hs:570:53:
warning: missing terminating ' character [-Winvalid-pp-token]
-- host order, host endian form, for the machine you're on. On a 64 bit
^
12 warnings generated.
src/Data/Binary/Get/Internal.hs:157:22:
warning: missing terminating ' character [-Winvalid-pp-token]
-- | Make sure we don't have to pass Nothing to a Partial twice.
^
src/Data/Binary/Get/Internal.hs:158:19:
warning: missing terminating ' character [-Winvalid-pp-token]
-- This way we don't need to pass around an EOF value in the Get monad, it
^
src/Data/Binary/Get/Internal.hs:180:63:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt inp kf ks = prompt' kf (\inp' -> ks (inp `B.append` inp'))
^
src/Data/Binary/Get/Internal.hs:182:7:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt' :: Decoder a -> (B.ByteString -> Decoder a) -> Decoder a
^
src/Data/Binary/Get/Internal.hs:183:7:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt' kf ks =
^
src/Data/Binary/Get/Internal.hs:221:21:
warning: missing terminating ' character [-Winvalid-pp-token]
let (inp', out) = B.splitAt n str
^
src/Data/Binary/Get/Internal.hs:222:31:
warning: missing terminating ' character [-Winvalid-pp-token]
in k out (Just inp')
^
src/Data/Binary/Get/Internal.hs:240:17:
warning: missing terminating ' character [-Winvalid-pp-token]
Left state' -> do
^
src/Data/Binary/Get/Internal.hs:241:16:
warning: missing terminating ' character [-Winvalid-pp-token]
let acc' = inp : acc
^
src/Data/Binary/Get/Internal.hs:242:15:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt'
^
src/Data/Binary/Get/Internal.hs:243:40:
warning: missing terminating ' character [-Winvalid-pp-token]
(runCont (onFail (reverse acc')) B.empty ks)
^
src/Data/Binary/Get/Internal.hs:284:72:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Once it's finished, return the final decoder (always 'Done' or 'Fail'),
^
src/Data/Binary/Get/Internal.hs:327:8:
warning: missing terminating ' character [-Winvalid-pp-token]
let g' = maybe (Left ()) Right <$> g
^
src/Data/Binary/Get/Internal.hs:328:47:
warning: missing terminating ' character [-Winvalid-pp-token]
either (const Nothing) Just <$> lookAheadE g'
^
src/Data/Binary/Get/Internal.hs:403:3:
error: invalid preprocessing directive
#-}
^
src/Data/Binary/Get/Internal.hs:412:64:
warning: missing terminating ' character [-Winvalid-pp-token]
where -- might look a bit funny, but plays very well with GHC's inliner.
^
src/Data/Binary/Get/Internal.hs:413:19:
warning: missing terminating ' character [-Winvalid-pp-token]
-- GHC won't inline recursive functions, so we make ensureN non-recursive
^
16 warnings and 1 error generated.
Failed to install binary-0.8.2.0
cabal: Error: some packages failed to install:
Cabal-1.22.7.0 depends on binary-0.8.2.0 which failed to install.
binary-0.8.2.0 failed during the building phase. The exception was:
ExitFailure 1
cabal-install-1.22.8.0 depends on binary-0.8.2.0 which failed to install.
然后......我尝试安装二进制文件......
Resolving dependencies...
Configuring binary-0.8.2.0...
/var/folders/3l/wflf71t55t92rrvt8lhx_8700000gn/T/10204.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
Building binary-0.8.2.0...
Preprocessing library binary-0.8.2.0...
src/Data/Binary.hs:198:43:
warning: missing terminating ' character [-Winvalid-pp-token]
-- This is just a convenience function, it's defined simply as:
^
src/Data/Binary.hs:253:35:
warning: missing terminating ' character [-Winvalid-pp-token]
-- This mechanism makes use of GHC's efficient built-in generics
^
2 warnings generated.
src/Data/Binary/Put.hs:110:26:
warning: missing terminating ' character [-Winvalid-pp-token]
PairS x w' = unPut k
^
src/Data/Binary/Put.hs:111:42:
warning: missing terminating ' character [-Winvalid-pp-token]
in PairS (f x) (w `mappend` w')
^
src/Data/Binary/Put.hs:115:26:
warning: missing terminating ' character [-Winvalid-pp-token]
PairS b w' = unPut k
^
src/Data/Binary/Put.hs:116:38:
warning: missing terminating ' character [-Winvalid-pp-token]
in PairS b (w `mappend` w')
^
src/Data/Binary/Put.hs:123:22:
warning: missing terminating ' character [-Winvalid-pp-token]
PairS b w' = unPut (k a)
^
src/Data/Binary/Put.hs:124:34:
warning: missing terminating ' character [-Winvalid-pp-token]
in PairS b (w `mappend` w')
^
src/Data/Binary/Put.hs:257:64:
warning: missing terminating ' character [-Winvalid-pp-token]
-- written in host order, host endian form, for the machine you're on.
^
src/Data/Binary/Put.hs:286:64:
warning: missing terminating ' character [-Winvalid-pp-token]
-- written in host order, host endian form, for the machine you're on.
^
8 warnings generated.
src/Data/Binary/Get.hs:26:7:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Let's decode binary data representing illustrated here.
^
src/Data/Binary/Get.hs:43:71:
warning: missing terminating ' character [-Winvalid-pp-token]
-- The fields in @Trade@ are marked as strict (using @!@) since we don't need
^
src/Data/Binary/Get.hs:48:12:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Now, let's have a look at a decoder for this format.
^
src/Data/Binary/Get.hs:62:20:
warning: missing terminating ' character [-Winvalid-pp-token]
--getTrade' :: 'Get' Trade
^
src/Data/Binary/Get.hs:63:79:
warning: missing terminating ' character [-Winvalid-pp-token]
--getTrade' = Trade '<$>' 'getWord32le' '<*>' 'getWord32le' '<*>' 'getWord16le'
^
src/Data/Binary/Get.hs:70:7:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Let's first define a function that decodes many @Trade@s.
^
src/Data/Binary/Get.hs:88:27:
warning: missing terminating '"' character [-Winvalid-pp-token]
-- input <- BL.readFile \"trades.bin\"
^
src/Data/Binary/Get.hs:235:64:
warning: missing terminating ' character [-Winvalid-pp-token]
-- The lazy interface consumes a single lazy 'L.ByteString'. It's the easiest
^
src/Data/Binary/Get.hs:236:47:
warning: missing terminating ' character [-Winvalid-pp-token]
-- interface to get started with, but it doesn't support interleaving I\/O and
^
src/Data/Binary/Get.hs:298:23:
warning: missing terminating ' character [-Winvalid-pp-token]
runGetState g lbs0 pos' = go (runGetIncremental g) lbs0
^
src/Data/Binary/Get.hs:300:53:
warning: missing terminating ' character [-Winvalid-pp-token]
go (Done s pos a) lbs = (a, L.chunk s lbs, pos+pos')
^
src/Data/Binary/Get.hs:570:53:
warning: missing terminating ' character [-Winvalid-pp-token]
-- host order, host endian form, for the machine you're on. On a 64 bit
^
12 warnings generated.
src/Data/Binary/Get/Internal.hs:157:22:
warning: missing terminating ' character [-Winvalid-pp-token]
-- | Make sure we don't have to pass Nothing to a Partial twice.
^
src/Data/Binary/Get/Internal.hs:158:19:
warning: missing terminating ' character [-Winvalid-pp-token]
-- This way we don't need to pass around an EOF value in the Get monad, it
^
src/Data/Binary/Get/Internal.hs:180:63:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt inp kf ks = prompt' kf (\inp' -> ks (inp `B.append` inp'))
^
src/Data/Binary/Get/Internal.hs:182:7:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt' :: Decoder a -> (B.ByteString -> Decoder a) -> Decoder a
^
src/Data/Binary/Get/Internal.hs:183:7:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt' kf ks =
^
src/Data/Binary/Get/Internal.hs:221:21:
warning: missing terminating ' character [-Winvalid-pp-token]
let (inp', out) = B.splitAt n str
^
src/Data/Binary/Get/Internal.hs:222:31:
warning: missing terminating ' character [-Winvalid-pp-token]
in k out (Just inp')
^
src/Data/Binary/Get/Internal.hs:240:17:
warning: missing terminating ' character [-Winvalid-pp-token]
Left state' -> do
^
src/Data/Binary/Get/Internal.hs:241:16:
warning: missing terminating ' character [-Winvalid-pp-token]
let acc' = inp : acc
^
src/Data/Binary/Get/Internal.hs:242:15:
warning: missing terminating ' character [-Winvalid-pp-token]
prompt'
^
src/Data/Binary/Get/Internal.hs:243:40:
warning: missing terminating ' character [-Winvalid-pp-token]
(runCont (onFail (reverse acc')) B.empty ks)
^
src/Data/Binary/Get/Internal.hs:284:72:
warning: missing terminating ' character [-Winvalid-pp-token]
-- Once it's finished, return the final decoder (always 'Done' or 'Fail'),
^
src/Data/Binary/Get/Internal.hs:327:8:
warning: missing terminating ' character [-Winvalid-pp-token]
let g' = maybe (Left ()) Right <$> g
^
src/Data/Binary/Get/Internal.hs:328:47:
warning: missing terminating ' character [-Winvalid-pp-token]
either (const Nothing) Just <$> lookAheadE g'
^
src/Data/Binary/Get/Internal.hs:403:3:
error: invalid preprocessing directive
#-}
^
src/Data/Binary/Get/Internal.hs:412:64:
warning: missing terminating ' character [-Winvalid-pp-token]
where -- might look a bit funny, but plays very well with GHC's inliner.
^
src/Data/Binary/Get/Internal.hs:413:19:
warning: missing terminating ' character [-Winvalid-pp-token]
-- GHC won't inline recursive functions, so we make ensureN non-recursive
^
16 warnings and 1 error generated.
Failed to install binary-0.8.2.0
cabal: Error: some packages failed to install:
binary-0.8.2.0 failed during the building phase. The exception was:
ExitFailure 1
我的ghc --version是 Glorious Glasgow Haskell编译系统,版本7.6.3
我的阴谋集 - 版本是 cabal-install version 1.16.0.2 使用Cabal库的1.16.0版本
感谢您的关注。
答案 0 :(得分:2)
它只是二进制-0.8.2.0中的一个错误。
src/Data/Binary/Get/Internal.hs:403:3:
error: invalid preprocessing directive
#-}
^
src/Data/Binary/Get/Internal.hs
有一行以#
开头,而C语言预处理器并不喜欢。 gcc很好用,但在Mac上苹果公司的gcc真是铿锵有力。
那条线是new in binary-0.8.0.0,于12月20日发布。还是很奇怪,显然没有其他人遇到这个。
我提交了issue。
答案 1 :(得分:0)
这是使用旧版GHC和现代铿锵声(现代Mac OS X附带)的结果。 GHC使用clang进行CPP,而clang对其输入并不十分了解。
较新的GHC没有这个问题,这就解释了为什么直到现在还没有找到并修复它。
github上的issue was reported。我修好了它并推了binary-0.8.2.1
。运行cabal update
然后重试。
binary
的任何其他问题,请
答案 2 :(得分:0)
总之,它不能使用最新版本的cabal 1.22.07与较旧版本的GHC 7.6.3,因为
它只是二进制-0.8.2.0中的一个错误。
src/Data/Binary/Get/Internal.hs:403:3:
error: invalid preprocessing directive
#-}
^
src / Data / Binary / Get / Internal.hs有一行以#开头,clang的C预处理器并不喜欢。 gcc很好用,但在Mac上苹果公司的gcc真是铿锵有力。
并且知道重要...
GHC使用clang进行CPP,而clang对其输入并不十分了解。 较新的GHC没有这个问题,这就解释了为什么到目前为止还没有找到并修复它。
github上的issue was reported。
感谢您的每一个答案。
PD:我可以使用Debian安装GHC 7.6.3和Cabal 1.22.07 ...&gt;。&lt;