siuling_88 February 2016

A lot of errors during cabal update and finally doesn't work

first of all thanks for the help you can bring me to solve my disaster with cabal xD...

I'm working with OS X El Capitan 10.11.3, 64 bits.

I installed Haskell platform from https://www.haskell.org/platform/prior.html of 2013.2.0.0, May 2013, specially because i need to work with ghc 7.6.3

Then when I execute cabal update... my headache starts...

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 [-Winvali        

Answers


Reid Barton February 2016

It's just a bug in binary-0.8.2.0.

src/Data/Binary/Get/Internal.hs:403:3:
     error: invalid preprocessing directive
     #-}
      ^

src/Data/Binary/Get/Internal.hs has a line that starts with #, which clang's C preprocessor doesn't like. gcc is fine with it, but on a Mac Apple's gcc is really clang.

That line is new in binary-0.8.0.0, which was released Dec 20. Still odd that apparently no one else encountered this yet.

I filed an issue.


L. Kolmodin February 2016

It's the result of using an old GHC version with modern clang (which comes with your modern Mac OS X). GHC uses clang for CPP, and clang is not very understanding about its input.

Newer GHCs don't have this issue, which explains why it hasn't been found and fixed until now.

The issue was reported on github. I've fixed it and pushed binary-0.8.2.1. Run cabal update and try again.

Let me know if you run into any other issues with binary.


siuling_88 February 2016

In conclusion, it can not use the latest version of cabal 1.22.07 with an older version of GHC 7.6.3,because

It's just a bug in binary-0.8.2.0.

src/Data/Binary/Get/Internal.hs:403:3:
 error: invalid preprocessing directive
 #-}
  ^

src/Data/Binary/Get/Internal.hs has a line that starts with #, which clang's C preprocessor doesn't like. gcc is fine with it, but on a Mac Apple's gcc is really clang.

by Reid Barton

and important to know...

GHC uses clang for CPP, and clang is not very understanding about its input. Newer GHCs don't have this issue, which explains why it hasn't been found and fixed until now.

The issue was reported on github.

by L. Kolmodin

Thanks for every answer.

PD: I could install GHC 7.6.3 and Cabal 1.22.07 using Debian... >.<

Post Status

Asked in February 2016
Viewed 3,863 times
Voted 9
Answered 3 times

Search




Leave an answer