game-in-haskell icon indicating copy to clipboard operation
game-in-haskell copied to clipboard

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

Open Rydgel opened this issue 10 years ago • 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.

Rydgel avatar Jun 21 '15 17:06 Rydgel

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

joom avatar Jun 21 '15 19:06 joom

@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.

Rydgel avatar Jun 23 '15 16:06 Rydgel

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 

Rydgel avatar Aug 16 '15 23:08 Rydgel

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 avatar Oct 30 '15 22:10 elisehuard

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

Rydgel avatar Oct 31 '15 00:10 Rydgel