cctbx_project
cctbx_project copied to clipboard
DYLD_LIBRARY does not work as expected
if [ -n "$DYLD_FALLBACK_LIBRARY_PATH" ]; then
DYLD_FALLBACK_LIBRARY_PATH="$LIBTBX_BUILD/lib:$LIBTBX_BUILD/../conda_base/lib:$DYLD_FALLBACK_LIBRARY_PATH"
export DYLD_FALLBACK_LIBRARY_PATH
else
DYLD_FALLBACK_LIBRARY_PATH="$LIBTBX_BUILD/lib:$LIBTBX_BUILD/../conda_base/lib:/usr/X11/lib:/usr/lib::"
export DYLD_FALLBACK_LIBRARY_PATH
fi
does not do what we would expect
silver-surfer viewer :( $ python3 -c 'import os; print(os.environ["DYLD_FALLBACK_LIBRARY_PATH"])'
/usr/X11/lib:/usr/lib::
silver-surfer viewer :) $ cctbx.python -c 'import os; print(os.environ["DYLD_FALLBACK_LIBRARY_PATH"])'
/Users/graeme/git/dials/build/lib:/Users/graeme/git/dials/build/../conda_base/lib
which means anything which depends on system libraries fails e.g.
OSError: dlopen(libobjc.dylib, 6): image not found
fails
silver-surfer tmp :) $ cat test.sh
echo $DYLD_FALLBACK_LIBRARY_PATH
if [ -n "$DYLD_FALLBACK_LIBRARY_PATH" ] ; then echo $DYLD_FALLBACK_LIBRARY_PATH ; fi
silver-surfer tmp :) $ ./test.sh
/usr/X11/lib:/usr/lib::
/usr/X11/lib:/usr/lib::
silver-surfer tmp :) $ bash test.sh
silver-surfer tmp :) $
OK, I suspect we have something to do with SIP happening in here
When I add the #!/bin/bash
to the top of the script I reproduce the issue here ->
silver-surfer tmp :) $ cat test.sh
#!/bin/bash
echo $DYLD_FALLBACK_LIBRARY_PATH
if [ -n "$DYLD_FALLBACK_LIBRARY_PATH" ] ; then echo $DYLD_FALLBACK_LIBRARY_PATH ; fi
silver-surfer tmp :) $ ./test.sh
-> I do not know what the right solution is here; disable SIP seems nasty.