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
Executables built by GHC 7.8.2 need to have DYLD_LIBRARY_PATH set in a wrapper #2488
Comments
5849a91 changed the default builder to set
on Linux. I guess, we'll need something similar for Darwin, too. The problem seems to be, though, that Darwin's ld doesn't accept |
According to http://stackoverflow.com/questions/4513799/how-to-set-the-runtime-path-rpath-of-an-executable-with-gcc-under-mac-osx, Darwin uses |
@peti No, that did not work. I just saw this failure today trying to run
|
I am sorry, but I cannot help much remedying this issue. I don't know much about Darwin, and I don't have access to that platform either. All I can do is disable shared library support on Darwin by default in the Cabal builder? |
Yes, that would work. The alternative is to use |
Well, if there is a way to fix shared library support on Darwin, I'd be more than happy to apply a patch. :-) |
@peti I discovered what the underlying problem was: When building an executable in a temporary directory, the rpath that get "baked in" refers to the directory of the dylib in that temp directory. You can see this by setting What this patch does is to add another rpath after the executable is built: the directory where the dylib will be installed in the store. Previously, since this directory did not exist yet and we were not informing the linker of its location, there was no way for OS X to know that it should look for its dependencies there. |
For example, cabal-bounds now has the following dylib reference:
If I set
DYLD_LIBRARY_PATH
to point into the right directory in the Nix store, it works fine:The text was updated successfully, but these errors were encountered: