bennofs / th-lift-instances

Lift instances for common haskell data types
http://hackage.haskell.org/package/th-lift-instances
Other
12 stars 11 forks source link

`th-lift-instances` configure failure #3

Closed Gabriella439 closed 6 years ago

Gabriella439 commented 8 years ago

I get the following failure at configuration time when building optparse-generic using GHC 7.6.3:

th-lift-instances-0.1.7 failed during the configure step. The exception was:

user error

(/usr/local/ghc/7.6.3/lib/ghc-7.6.3/unix-2.6.0.1/libHSunix-2.6.0.1.a(HsUnix.o):

In function `__hsunix_push_module':

HsUnix.c:(.text+0x80): multiple definition of `__hsunix_push_module'

/home/travis/.cabal/lib/x86_64-linux-ghc-7.6.3/unix-2.7.2.0/libHSunix-2.7.2.0.a(HsUnix.o):HsUnix.c:(.text+0x50):

first defined here

/usr/local/ghc/7.6.3/lib/ghc-7.6.3/unix-2.6.0.1/libHSunix-2.6.0.1.a(HsUnix.o):

In function `__hsunix_unlockpt':

HsUnix.c:(.text+0x100): multiple definition of `__hsunix_unlockpt'

/home/travis/.cabal/lib/x86_64-linux-ghc-7.6.3/unix-2.7.2.0/libHSunix-2.7.2.0.a(HsUnix.o):HsUnix.c:(.text+0x40):

first defined here

/usr/local/ghc/7.6.3/lib/ghc-7.6.3/unix-2.6.0.1/libHSunix-2.6.0.1.a(HsUnix.o):

In function `__hsunix_grantpt':

HsUnix.c:(.text+0x110): multiple definition of `__hsunix_grantpt'

/home/travis/.cabal/lib/x86_64-linux-ghc-7.6.3/unix-2.7.2.0/libHSunix-2.7.2.0.a(HsUnix.o):HsUnix.c:(.text+0x30):

first defined here

/usr/local/ghc/7.6.3/lib/ghc-7.6.3/unix-2.6.0.1/libHSunix-2.6.0.1.a(HsUnix.o):

In function `__hsunix_ptsname':

HsUnix.c:(.text+0x120): multiple definition of `__hsunix_ptsname'

/home/travis/.cabal/lib/x86_64-linux-ghc-7.6.3/unix-2.7.2.0/libHSunix-2.7.2.0.a(HsUnix.o):HsUnix.c:(.text+0x20):

first defined here

collect2: ld returned 1 exit status

)

th-orphans-0.13.1 depends on th-lift-instances-0.1.7 which failed to install.
bennofs commented 8 years ago

Ok, thanks for the report. I've never seen an error like that before, and it doesn't look directly to related to th-lift-instances to me. Looks like you encountered this in a ŧravis build? I'll see if I can reproduce this with travis docker images.

bennofs commented 8 years ago

Ok, I managed to reproduce this using the travis docker images. What's weird though is that a plain cabal install th-lift-instances in the build environment works, but cabal install --only-dependencies --enable-tests for optparse-applicative fails to install th-lift-instances.

bennofs commented 8 years ago

I figured out what happens here. The problem is that the Setup.hs file of th-lift-instances depends on modules from Cabal and from directory. These packages are compiled against different versions of the unix package, so we end up in a situation where the Setup.hs file is linked against two different versions of the unix package... I'll see if I can remove the dependency on the directory package to fix this.

bennofs commented 8 years ago

I uploaded th-lift-instances-0.1.8 that simply uses build-type: Simple, since the package does not have doctests atm anyway. I'm leaving this issue open for now though as a personal reminder, since I also use the same code in other packages.

Gabriella439 commented 6 years ago

Thank you for fixing this! :)