Cabal on Mac OSX EL Capitan - forwarding DYLD_LIBRARY_PATH

Herbert Valerio Riedel hvriedel at gmail.com
Wed Jan 27 10:57:44 UTC 2016


On 2016-01-27 at 11:37:53 +0100, tamarind code wrote:
> There was a discussion in github about stack (see link below) where the
> conclusion seems to be pointing towards a bug in Cabal on Mac OSX EL
> Capitan related to forwarding DYLD_LIBRARY_PATH

Is this really a bug *in Cabal*? Or is this rather a newly introduced OS
limitation of El Capitan, which may even be in conflict with the POSIX
specs. Quoting[1]:

> Spawning children processes of processes restricted by System
> Integrity Protection, such as by launching a helper process in a
> bundle with NSTask or calling the exec(2) command, resets the Mach
> special ports of that child process. Any dynamic linker (dyld)
> environment variables, such as DYLD_LIBRARY_PATH, are purged when
> launching protected processes.

So OSX deliberately interferes with environment-variable inheritance. So
what is Cabal even supposed to do here? This also seems like a rather
radical change, which will have probably broken a lot of other software
projects relying that DYLD_LIBRARY_PATH is inherited throughout process
creations.



 [1]: https://developer.apple.com/library/prerelease/mac/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html#//apple_ref/doc/uid/TP40016462-CH3-SW1


More information about the Libraries mailing list