Skip to content
This repository

"Compatibility with ghc head" patch breaks with GHC 7.0.4 #43

Closed
kazu-yamamoto opened this Issue August 07, 2012 · 9 comments

3 participants

Kazu Yamamoto Johan Tibell Simon Hengel
Kazu Yamamoto

@markwright the patch e25f69d works with GHC 7.4.1 but does not work with GHC 7.0.4.

Preprocessing library network-2.3.0.14...
BSD.hsc:115:23: error: missing binary operator before token "("
BSD.hsc:115:23: error: missing binary operator before token "("
BSD.hsc:115:23: error: missing binary operator before token "("
compiling dist/build/Network/BSD_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/Network/BSD_hsc_make.c -o dist/build/Network/BSD_hsc_make.o -fno-stack-protector -fno-stack-protector -D__GLASGOW_HASKELL__=700 -Dlinux_BUILD_OS -Dlinux_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -Iinclude -DCALLCONV=ccall -I/ghc7.0.4/lib/ghc-7.0.4/unix-2.4.2.0/include -I/ghc7.0.4/lib/ghc-7.0.4/bytestring-0.9.1.10/include -I/ghc7.0.4/lib/ghc-7.0.4/base-4.3.1.0/include -I/ghc7.0.4/lib/ghc-7.0.4/include -I/ghc7.0.4/lib/ghc-7.0.4/include -I/ghc7.0.4/lib/ghc-7.0.4/include/

Johan Tibell
Owner

Interesting. According to my buildbot, it builds with 7.0.3: http://ci.johantibell.com/job/network/compiler=ghc-7.0.3/32/console

Johan Tibell
Owner

@kazu-yamamoto Older versions of Cabal used to miss a pair of parenthesis in the definition of the MIN_VERSION_<package> macro. Does changing line 115 in BSD.hsc to

#if !(MIN_VERSION_base(4,6,0))

(Note the extra parens.)

solve your problem?

Kazu Yamamoto

After changing so, I got the same error message. (Actually, I tried this before but it did not fix the problem.)
I'm using Cabal 1.10.2.0 and cabal-install version 0.10.2 and hsc2hs version 0.67.

Kazu Yamamoto

Inserting the following code works:

#ifndef MIN_VERSION_base
#define MIN_VERSION_base(x,y,z) 1
#endif

So, MIN_VERSION_base is not defined in my environment.

Johan Tibell
Owner

@kazu-yamamoto It should be defined in dist/build/autogen/cabal_macros.h. Could you try with the latest released Cabal version?

Kazu Yamamoto

dist/build/autogen/cabal_macros.h is created but dist/build/Network/BSD_hsc_make.c does not include it.

As I said, I don't see this problem with GHC 7.4.1 (aka the latest HP).

Johan Tibell
Owner

There could be a bug in 7.0.3 that made GHC not pass the right flags to hsc2hs. I'm not sure what's going on. Could you please investigate? I have very limited cycles at the moment.

Simon Hengel
sol commented August 14, 2012

It works here with GHC 7.0.4 and Cabal/cabal-install 1.14.0, so I guess it's an issue with Cabal 1.10.2.0 or cabal-install 0.10.2.

Simon Hengel
sol commented August 14, 2012

Anyway, I do not really see the need for CPP here. I'd just import Control.Exception qualified.

@kazu-yamamoto Does my code work for you?

Simon Hengel sol referenced this issue August 14, 2012
Merged

Fix for issue #43 #46

Johan Tibell tibbe closed this in fec2454 August 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.