elisehuard/game-in-haskell

cabal build fails under GHC 7.10.1, cabal 1.22.6.0 on OS X 10.10.3

Opened this issue · 5 comments

The command cabal install --only-dependencies works well.
But when I'm doing cabal build every project seems to build fine except the tests ones.

I've got this error message:

Preprocessing test suite 'hunit' for game-in-haskell-book-0.1.0.0...
[1 of 1] Compiling Main             ( test/HUnit.hs, dist/build/hunit/hunit-tmp/Main.o )

<no location info>:
    <command line>: can't load .so/.DLL for: /Users/rydgel/Projects/Haskell/game-in-haskell/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib (dlopen(/Users/rydgel/Projects/Haskell/game-in-haskell/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib, 5): Symbol not found: _glutBitmap8By13
  Referenced from: /Users/rydgel/Projects/Haskell/game-in-haskell/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib
  Expected in: flat namespace
 in /Users/rydgel/Projects/Haskell/game-in-haskell/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib)

The same error happens when launching cabal repl.

Oddly enough each little executable is still built and works well.

It worked fine when I used the project with GHC 7.8.4 a while back.

joom commented

This was reported here: haskell-opengl/GLUT#19
(sorry, I didn't see your comment there until now. I'm keeping the comment for reference)

@joom No problem. No one is sure where the bug is at the moment. I filled a bug to GHC just in case. This is kind of sad, I feel helpless, I'm not able to really understand where the problem lies for sure.

Should be fixed in GHC 7.10.3. In the meantime there is a work-around: just reinstall GLUT like this:

cabal install GLUT --ghc-options="-optl-Wl,-framework,GLUT" --reinstall --jobs=1 

Thanks @Rydgel for looking into this - I've not been very helpful (moving country, new job, etc) but I'll definitely look into integrating this into an appendix on to build on Linux (and thank you, amongst other people, for doing the work!)

@elisehuard you should add this in the appendix on to build on OS X. Linux is fine and don't encounter the issue. Cheers.