Opened 21 months ago

Closed 8 months ago

#7359 closed bug (fixed)

unix-2.6.0.0 fails to install on mac os x with 7.4.* (works with 7.6.1)

Reported by: AndreasVoellmy Owned by:
Priority: highest Milestone: 7.6.3
Component: libraries/unix Version: 7.4.1
Keywords: unix package Cc: george.colpitts@…, ekmett@…
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: Other Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Some package I am trying to build with cabal causes cabal to try to install unix-2.6.0.0 . This fails with the following errors:

[35 of 38] Compiling System.Posix.Signals ( dist/build/System/Posix/Signals.hs, dist/build/System/Posix/Signals.o )
/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c: In function ‘ghc_wrapper_dtUw_sigismember’:

/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c:8:0:
     warning: dereferencing ‘void *’ pointer

/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c:8:0:
     error: void value not ignored as it ought to be
/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c: In function ‘ghc_wrapper_dtUF_sigfillset’:

/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c:10:0:
     warning: dereferencing ‘void *’ pointer

/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c:10:0:
     error: invalid use of void expression
/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c: In function ‘ghc_wrapper_dtUR_sigdelset’:

/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c:12:0:
     warning: dereferencing ‘void *’ pointer

/var/folders/_c/4n2x0zfx7mx5gk_46pdxn3pm0000gn/T/ghc30459_0/ghc30459_0.c:12:0:
     error: invalid use of void expression
Failed to install unix-2.6.0.0

This seems to be a recent problem for me, so it may be due to some software updates for mac os x. I am running os x version 10.8.2 build 12c60. I have XCode version 4.5.1 with the "Command Line Tools" installed. I installed ghc from the haskell-platform after updating the os x and xcode (and command line tools).

Change History (15)

comment:1 Changed 21 months ago by AndreasVoellmy

Additional piece of info on my configuration:

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

comment:2 Changed 21 months ago by jfischoff

  • Summary changed from unix-2.6.0.0 fails to install on mac os x to unix-2.6.0.0 fails to install on mac os x with 7.4.* (works with 7.6.1)

I am also getting this, but the really odd thing about it is I only get it with GHC 7.4.2, works fine with 7.6.1.

comment:3 Changed 21 months ago by lukexi

Seems related to #2979 (which explains why it works with 7.6.1)

I fixed it by cabal unpacking, and swapping lines 615-622 with those from unix-2.5.1.1 in source:unix/System/Posix/Signals.hsc:

foreign import ccall unsafe "__hscore_sigdelset"
  c_sigdelset   :: Ptr CSigset -> CInt -> IO CInt

foreign import ccall unsafe "__hscore_sigfillset"
  c_sigfillset  :: Ptr CSigset -> IO CInt

foreign import ccall unsafe "__hscore_sigismember"
  c_sigismember :: Ptr CSigset -> CInt -> IO CInt

and cabal installing.

Last edited 8 months ago by hvr (previous) (diff)

comment:4 Changed 17 months ago by george.colpitts

  • Cc george.colpitts@… added

Any chance of a fix for this? Many packages depend on unix and these packages can't be installed on Mac OS with the latest Haskell Platform

comment:5 Changed 17 months ago by george.colpitts

  • Keywords unix package added

comment:6 Changed 17 months ago by andykitchen

bump, unix-2.6.0.1 also fails to build. This breaks a lot of things for Haskell platform users.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2

$ gcc-mp-4.7 -v
Using built-in specs.
COLLECT_GCC=gcc-mp-4.7
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin12/4.7.2/lto-wrapper
Target: x86_64-apple-darwin12
Configured with: ../gcc-4.7.2/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc47 --includedir=/opt/local/include/gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --with-pkgversion='MacPorts gcc47 4.7.2_2'
Thread model: posix
gcc version 4.7.2 (MacPorts gcc47 4.7.2_2) 

comment:7 Changed 17 months ago by simonmar

  • Difficulty set to Unknown
  • Milestone set to 7.6.3
  • Owner set to igloo
  • Priority changed from normal to highest

Ian, I think this is your area.

comment:8 Changed 16 months ago by ekmett

  • Cc ekmett@… added

comment:9 Changed 16 months ago by AndreasVoellmy

This ticket:2979 seems to be related. It looks like the problem on this ticket would be solved by the commit at the end of ticket:2979, namely 7b24c3fffecbf9fc219c10f24d1472d0d03da6a1. It doesn't look like this commit is in the history for the ghc-7.4.2-release tag.

comment:10 follow-up: Changed 15 months ago by MtnViewMark

The unix package is supplied with GHC. You can't, in general, just use a different version. Haskell Platform 2012.4 ships with GHC 7.4.1, which includes unix-2.5.1.1. I wouldn't expect unix-2.6.x.y to work with GHC 7.4.1 at all. Of course unix-2.6.x.y works with GHC 7.6.z, as that is the version of GHC that distributes with it.

I'm curious what caused the OP's system to think it needed unix-2.6.0.0. I'm also wondering if I should be reading something into "I installed ghc from the haskell-platform" - does that mean they installed HP whole, or did some surgery to install just GHC?

comment:11 Changed 15 months ago by MtnViewMark

Upon further investigation of George's situation, which I suspect is the same as others, this is version of "Cabal hell":

George's system had multiple versions of packages, including some newer versions of packages that are supplied with GHC.

A line from verbose cabal output tells the story:

rejecting: unix-2.5.1.1/installed-296... (conflict: cairo => bytestring==0.10.0.1/installed-9b0..., unix => bytestring==0.9.2.1/installed-004...)

That is, cabal rejected the installed unix-2.5.1.1 because it was compiled against bytestring-0.9.2.1 (both supplied with GHC 7.4.1, and with HP 2012.4.0.0)... and the installed version of cairo it picked (0.12.4) was compiled against bytestring-0.10.0.1 (which was also installed). The only solution cabal could find was to pick unix-2.6.0.1. However, that, as we know (and expect) is incompatible with GHC-7.4.2.

So the bug is that unix should have some dependency on ghc, which in turn would cause Cabal to give up in this situation - because the compiler essentially constrains the version of unix to just one.

comment:12 Changed 13 months ago by AndreasVoellmy

It looks like the reason that my package tried to install unix-2.6.0.0 was that my cabal specified "bytestring >= 0.10.0.1" in build-depends field. I don't seem to really need that, so I can fix the problem by deleting that constraint. So this seems to be mainly user error, although fixing the dependency in the way that MtnViewMark's last comment suggests may have helped me find the problem earlier.

comment:13 Changed 12 months ago by igloo

  • Owner igloo deleted

comment:14 in reply to: ↑ 10 Changed 8 months ago by hvr

Replying to MtnViewMark:

The unix package is supplied with GHC. You can't, in general, just use a different version. Haskell Platform 2012.4 ships with GHC 7.4.1, which includes unix-2.5.1.1. I wouldn't expect unix-2.6.x.y to work with GHC 7.4.1 at all.

Fwiw, the soon to be released unix-2.7.0.0 package should work with GHC 7.4.x, GHC 7.6.x, and (obviously) GHC 7.8.x (See also current TravisCI build status)

comment:15 Changed 8 months ago by hvr

  • Resolution set to fixed
  • Status changed from new to closed

This one is fixed by the workaround in [88bfec0cf55f8c9ad74881d48cf8756c9fe627aa/unix]; if there's still demand, I can also backport this and upload an unix-2.6.0.2 package...

Note: See TracTickets for help on using tickets.