Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskellPackages.rocksdb-haskell won't compile on OSX #21215

Closed
domenkozar opened this issue Dec 16, 2016 · 13 comments
Closed

haskellPackages.rocksdb-haskell won't compile on OSX #21215

domenkozar opened this issue Dec 16, 2016 · 13 comments
Assignees
Labels
6.topic: darwin Running or building packages on Darwin 6.topic: haskell

Comments

@domenkozar
Copy link
Member

It compiles on Linux, but fails to do so on OSX:

Building rocksdb-0.1.0...
Preprocessing library rocksdb-0.1.0...
dyld: Library not loaded: librocksdb.4.13.dylib
  Referenced from: /private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-rocksdb-0.1.0.drv-0/rocksdb-haskell-0a5bced/dist/build/Database/RocksDB/C_hsc_make
  Reason: image not found
running dist/build/Database/RocksDB/C_hsc_make failed (exit code -5)
command was: dist/build/Database/RocksDB/C_hsc_make  >dist/build/Database/RocksDB/C.hs

Rocksdb library is passed correctly (as this works on Linux):

configureFlags: --verbose --prefix=/nix/store/9426hvvp9cr84yfwv9vjqq6kpd3z5zd0-rocksdb-0.1.0 --libdir=$prefix/lib/$compiler --
libsubdir=$pkgid --with-gcc=clang --package-db=/private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-rocksdb-0.1.
0.drv-0/package.conf.d --ghc-option=-optl=-Wl,-headerpad_max_install_names --disable-split-objs --enable-library-profiling --d
isable-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests --extra-include-dirs=/nix
/store/ny14y5f1s0fzcz9s2nyayqy3vbrmjgfx-rocksdb-4.13/include --extra-lib-dirs=/nix/store/ny14y5f1s0fzcz9s2nyayqy3vbrmjgfx-rocksdb-4.13/lib

and the library is there:

$ ls -la /nix/store/ny14y5f1s0fzcz9s2nyayqy3vbrmjgfx-rocksdb-4.13/lib    
total 40464
dr-xr-xr-x  11 admin  wheel       374 Jan  1  1970 .
dr-xr-xr-x   4 admin  wheel       136 Jan  1  1970 ..
-r-xr-xr-x   1 admin  wheel   4825312 Jan  1  1970 librocksdb.4.13.4.dylib
lrwxr-xr-x   1 admin  wheel        23 Jan  1  1970 librocksdb.4.13.dylib -> librocksdb.4.13.4.dylib
lrwxr-xr-x   1 admin  wheel        23 Jan  1  1970 librocksdb.4.dylib -> librocksdb.4.13.4.dylib
lrwxr-xr-x   1 admin  wheel        23 Jan  1  1970 librocksdb.dylib -> librocksdb.4.13.4.dylib
-r-xr-xr-x   1 admin  wheel   5065852 Jan  1  1970 librocksdb_debug.4.13.4.dylib
lrwxr-xr-x   1 admin  wheel        29 Jan  1  1970 librocksdb_debug.4.13.dylib -> librocksdb_debug.4.13.4.dylib
lrwxr-xr-x   1 admin  wheel        29 Jan  1  1970 librocksdb_debug.4.dylib -> librocksdb_debug.4.13.4.dylib
-r-xr-xr-x   1 admin  wheel  10795016 Jan  1  1970 librocksdb_debug.a
lrwxr-xr-x   1 admin  wheel        29 Jan  1  1970 librocksdb_debug.dylib -> librocksdb_debug.4.13.4.dylib

Any tips are appreciated.

@domenkozar domenkozar added 6.topic: haskell 6.topic: darwin Running or building packages on Darwin labels Dec 16, 2016
@domenkozar domenkozar changed the title haskellPackages.rocksdb won't compile haskellPackages.rocksdb-haskell won't compile on OSX Dec 16, 2016
@LnL7
Copy link
Member

LnL7 commented Dec 18, 2016

I forgot that the haskell DYLD_LIBRARY_PATH changes where reverted.

@LnL7
Copy link
Member

LnL7 commented Dec 18, 2016

This is a workaround for rocksdb LnL7@6edec59. I should be able to get this into the builder in a generic way.

@LnL7 LnL7 self-assigned this Dec 18, 2016
@domenkozar domenkozar reopened this Dec 20, 2016
@domenkozar
Copy link
Member Author

Unfortunately that also doesn't work, as we hit haskell/cabal#4042

@LnL7
Copy link
Member

LnL7 commented Dec 20, 2016

Does my workaround work properly? It's a bit tricky to get the rewrite right but I can get it to work.

@domenkozar
Copy link
Member Author

Yeah. Reported upstream: haskell/cabal#4183

@domenkozar
Copy link
Member Author

@LnL7 when used by upstream package it is still referenced relatively:

<no location info>: error:
    ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.1 for x86_64-apple-darwin):
        Loading temp shared object failed: dlopen(/private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-customproject-0.1.0.0.drv-2/ghc69083_0/libghc_68.dylib, 5): Library not loaded: librocksdb.4.13.dylib
  Referenced from: /private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-customproject-0.1.0.0.drv-2/ghc69083_0/libghc_68.dylib
  Reason: image not found

@LnL7
Copy link
Member

LnL7 commented Dec 20, 2016

Oh no! Is this a regular package, or the ghc wrapper?

@domenkozar
Copy link
Member Author

@LnL7 regular package

@LnL7
Copy link
Member

LnL7 commented Dec 21, 2016

Ok so it's the same issue, just a level higher.

@LnL7
Copy link
Member

LnL7 commented Dec 24, 2016

This is fixed by #21351, but meta.platforms does not include darwin so it's still marked as broken. I'm not sure where that comes from.

/cc @peti

@peti
Copy link
Member

peti commented Dec 25, 2016

NixOS/cabal2nix@234191b prevents Hydra from building the package on anything other than Linux/x86_64. I wish I still knew why I made that change. There's no reference to a github issue, unfortunately.

peti added a commit to NixOS/cabal2nix that referenced this issue Dec 25, 2016
peti added a commit that referenced this issue Dec 25, 2016
NixOS/cabal2nix@ac3ba01
tells the automatic re-generation process to do the same thing in the next update.

Required by #21215.
@domenkozar
Copy link
Member Author

domenkozar commented Dec 25, 2016 via email

domenkozar added a commit that referenced this issue Dec 28, 2016
@LnL7
Copy link
Member

LnL7 commented Jan 2, 2017

This is fixed, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 6.topic: haskell
Projects
None yet
Development

No branches or pull requests

3 participants