Repository navigation
Closed
Description
I'm building https://github.com/serokell/rocksdb-haskell/ with just Nix and also with Stack (+Nix). Both fail to build even when rocksdb lib forder is passed correctly:
configureFlags: --verbose --prefix=/nix/store/8mlm6x003sj8781qf688qx031yjysa83-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-1/package.conf.d --ghc-option=-optl=-Wl,-headerpad_max_install_names --disable-split-objs --enable-library-profiling --disable-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests --extra-include-dirs=/nix/sto
re/mj95pj47pjjmxgdzzfp2357zsylw9m3s-rocksdb-4.13/include --extra-lib-dirs=/nix/store/mj95pj47pjjmxgdzzfp2357zsylw9m3s-rocksdb-4.13/lib
Build fails as:
dyld: Library not loaded: librocksdb.4.13.dylib
Referenced from: /private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-rocksdb-0.1.0.drv-1/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
note: keeping build directory _/private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-rocksdb-0.1.0.drv-1_
This is a masked error, really it doesn't find rocksdb library because it's not linked as absolute path:
$ $(which otool) -L /private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-rocksdb-0.1.0.drv-1/rocksdb-haskell-0a5bced/dist/build/Database/RocksDB/C_hsc_make
/private/var/folders/v0/ydgx93x96375ws14_16p93gr0000gq/T/nix-build-rocksdb-0.1.0.drv-1/rocksdb-haskell-0a5bced/dist/build/Database/RocksDB/C_hsc_make:
librocksdb.4.13.dylib (compatibility version 0.0.0, current version 0.0.0)
/nix/store/wngzdrk0b53q24b5infy1g2j4d5mh1mx-libiconv-osx-10.11.6/lib/libiconv.dylib (compatibility version 7.0.0, current version 7.0.0)
/nix/store/f0m22bm6x14fq68jxnzw2w9dca83jfk7-gmp-6.1.1/lib/libgmp.10.dylib (compatibility version 14.0.0, current version 14.1.0)
/nix/store/qsq0qzfi0dib713a83adz70scf5m3z1a-Libsystem-osx-10.11.6/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
Following work around works that sets the path back to absolute:
Metadata
Metadata
Assignees
Labels
No labels
Activity
LnL7 commentedon Dec 20, 2016
/participate
Ericson2314 commentedon Dec 21, 2016
Might this relate to relocatable builds?
LnL7 commentedon Dec 21, 2016
Possibly, is there some way to disable that? I'm also not sure how this would work outside of nix.
domenkozar commentedon Jan 3, 2017
I've found out the culprit (thanks @christiaanb).
A bit more background how this is fixed in Nix
How rocksdb was fixed
General solution for Nix