-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Haskell Z3 package can't find libz3.dylib at run-time on Darwin #16357
Comments
I have created a pull-request with a fix. Temporarily anyone interested can use this snippet to fix it in their config.nix file (in {
packageOverrides = let
z3hsk =
{ mkDerivation, base, containers, hspec, mtl, QuickCheck, stdenv, z3}:
mkDerivation {
pname = "z3";
version = "4.1.0";
sha256 = "1vpmwizxcab1mlz7vp3hp72ddla7805jn0lq60fmkjgmj95ryvq9";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [ base containers mtl ];
librarySystemDepends = [ z3 ];
testHaskellDepends = [ base hspec QuickCheck ];
preBuild = ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${z3}/lib
'';
homepage = "http://bitbucket.org/iago/z3-haskell";
description = "Bindings for the Z3 Theorem Prover";
license = stdenv.lib.licenses.bsd3;
};
in super: let
self = super.pkgs;
z3 = self.haskellPackages.callPackage z3hsk { z3 = super.z3; };
in {
myHaskellEnv = self.haskellPackages.ghcWithPackages
( p: with p;
[ cabal-install
z3
# ...ect
]
);
};
} |
With #17145 merged to |
It turns out that my changes did not work. Even though it enables the library to compile it, the environment variable DYLD_LIBRARY_PATH is needed when running the library too. The example shows running without and with DYLD_LIBRARY_PATH pointing to z3:
|
@peti could you reopen this issue. |
I believe this is a bug in Cabal. Cabal has all the information it needs to make things work, but apparently fails to do so. |
…yld" This fix doesn't actually fix the cabal bug (see NixOS#16357), but it does cause other bugs (see NixOS#20476) Fixes NixOS#20476 This reverts commit b89fa5f, reversing changes made to e4b146b.
#21215 seems to be a duplicate of this. |
Since 19e2e72 (cc @LnL7) this builds correctly, but fails in check phase:
We may tweak the workaround to also work there, but I'm hoping to get information upstream and fix this also for stack projects using Nix: haskell/cabal#2255 (comment) |
Yeah I still have to look into that, that only patches the ghc dyld so I might just have to do the same for the test binary. |
@LnL7 I might have found a way for fix this, wait a bit. |
Issue description
There seem to be a linking bug, while trying to compile the z3 haskell package. It seams like the language is correctly loaded, but the versions between the z3 haskell package and the z3 library might have diverted. The interesting error is:
Even though, that the included library does contain libz3.dylib.
--extra-lib-dirs=/nix/store/k3pbd2znh0yiq7hw7hg4k50gp474g1xc-z3-4.4.1/lib
Thank you very much for looking into it.
Steps to reproduce
Technical details
nixos-version
, Ubuntu/Fedora:lsb_release -a
, ...)nix-env --version
)nix-env (Nix) 1.11.2
nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
)"16.09pre83147.df89584"
The text was updated successfully, but these errors were encountered: