Fixing 8266: How do I get a list of all dist-install/build directories?

Christiaan Baaij christiaan.baaij at gmail.com
Sat Sep 21 07:39:53 UTC 2013


Hello everyone,

I'm trying to write a patch for #8266.
Here's what I have so far: https://gist.github.com/christiaanb/6648192
It changes the name of the dynamic library to a relative path instead of an absolute one.

However, now I'm getting an error while building the DPH packages (probably due to the use of TH):
Loading package vector-0.9.1 ... <command line>: can't load .so/.DLL for: /Users/christiaan/Documents/devel/ghc/libraries/vector/dist-install/build/libHSvector-0.9.1-ghc7.7.20130918.dylib (dlopen(/Users/christiaan/Documents/devel/ghc/libraries/vector/dist-install/build/libHSvector-0.9.1-ghc7.7.20130918.dylib, 9): Library not loaded: @loader_path/../primitive-0.4.0.1/libHSprimitive-0.4.0.1-ghc7.7.20130918.dylib
  Referenced from: /Users/christiaan/Documents/devel/ghc/libraries/vector/dist-install/build/libHSvector-0.9.1-ghc7.7.20130918.dylib
  Reason: image not found)

Of course the problem is, is that the packages are not installed yet, so the relative paths don't make sense yet.

My solution is to update rules/shell-wrapper.mk, and to add
DYLD_FALLBACK_LIBRARY_PATH = <ALL_LIBRARY_BUILD_DIRS>
to the inplace/bin shell wrappers.
So that during building of ghc, dynlibs of all the packages can still be resolved to the place where they were build.

So my question is: how do I get the list  <ALL_LIBRARY_BUILD_DIRS> within the build system?

Cheers,

Christiaan





More information about the ghc-devs mailing list