DYLD_LIBRARY_PATH missing on OSX

58 views
Skip to first unread message

Sam Richards

unread,
Feb 10, 2018, 8:53:08 PM2/10/18
to rez-config
I'm just discovering the painful way that OSX has implement something called SIP (https://en.wikipedia.org/wiki/System_Integrity_Protection)  that is now resetting DYLD_LIBRARY_PATH any time it hits bash or /usr/bin/env.

This is a bit of a nightmare since I have a bunch of legacy rez code that has lines like:
    if uname == 'darwin':
        env.DYLD_LIBRARY_PATH.append("{root}/python/PySide")

Which now do nothing in many cases.

Does anybody have a nifty workaround for this?

Sam.

Allan Johns

unread,
Feb 12, 2018, 3:39:33 PM2/12/18
to rez-c...@googlegroups.com
So far as I'm aware the only options are either disabling SIP, or linking at build time rather than using *LD_LIBRARY_PATH.

Hth
A


--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+unsubscribe@googlegroups.com.
To post to this group, send email to rez-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/rez-config.
For more options, visit https://groups.google.com/d/optout.

Sam Richards

unread,
Feb 12, 2018, 10:43:26 PM2/12/18
to rez-config
I did a crude workaround which was to copy $DYLD_LIBRARY_PATH to $MY_DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH=$MY_DYLD_FRAMEWORK_PATH
and copy it back in a wrapper script in my bin area, which seems to work.

It will also work if you call it with python directly, it seems like the problem is the /usr/bin/env python that screws it up. Would it be a horrendous hack to have rez-env read the first lines of the "executable" to see if it starts with "/usr/bin/env" (if its a mac), and then have it run python directly, bypassing /usr/bin/env?

If this makes sense, where would the right place be for this, I wondered about "spawn_shell"?

Sam.

On Monday, February 12, 2018 at 12:39:33 PM UTC-8, allan.johns wrote:
So far as I'm aware the only options are either disabling SIP, or linking at build time rather than using *LD_LIBRARY_PATH.

Hth
A

On Sun, Feb 11, 2018 at 12:53 PM, Sam Richards <tau...@gmail.com> wrote:
I'm just discovering the painful way that OSX has implement something called SIP (https://en.wikipedia.org/wiki/System_Integrity_Protection)  that is now resetting DYLD_LIBRARY_PATH any time it hits bash or /usr/bin/env.

This is a bit of a nightmare since I have a bunch of legacy rez code that has lines like:
    if uname == 'darwin':
        env.DYLD_LIBRARY_PATH.append("{root}/python/PySide")

Which now do nothing in many cases.

Does anybody have a nifty workaround for this?

Sam.

--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.

Allan Johns

unread,
Feb 13, 2018, 4:07:54 PM2/13/18
to rez-c...@googlegroups.com
Yeah SIP apparently only takes effect when using /usr/bin/env or shell script such as bash.

Yes doing what you said would be a horrendous hack :D It also doesn't help much, because after you've rez-env'd into a shell, the user could run any old executable which uses `/usr/bin/env python` and at that point nothing can be done. It would be inconsistent to do this only when a tool is invoked ala `rez-env pkgA pkgB -- mycommand`, which is what I assume you are referring to.

Just seems like you either need to play ball with Apple and not dynamic link at runtime, _or_ turn off SIP :/ Sorry, I wish I had a better suggestion.

A




To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages