Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

if DYLD_FALLBACK_LIBRARY_PATH is empty, use default from man dyld #37

Merged
merged 2 commits into from
Aug 12, 2014
Merged

if DYLD_FALLBACK_LIBRARY_PATH is empty, use default from man dyld #37

merged 2 commits into from
Aug 12, 2014

Conversation

nonrational
Copy link
Contributor

I believe this fixes #23

When $DYLD_FALLBACK_LIBRARY_PATH is empty, the default path is used internally. From man dyld

  DYLD_FALLBACK_LIBRARY_PATH
          This is a colon  separated  list  of  directories  that  contain
          libraries.  It is used as the default location for libraries not
          found  in  their  install  path.   By  default,  it  is  set  to
          $(HOME)/lib:/usr/local/lib:/lib:/usr/lib.

By always appending homebrew's lib path to DYLD_FALLBACK_LIBRARY_PATH we end up breaking compatibility between java's ability to correctly reference the default paths for C libs, which breaks, among other things, parts of jruby.

Further Reading:
http://stackoverflow.com/questions/3146274/is-it-ok-to-use-dyld-library-path-on-mac-os-x-and-whats-the-dynamic-library-s#comment21758755_3172515
Homebrew/legacy-homebrew#13463

@gabetax
Copy link

gabetax commented Jul 19, 2014

Encountered a similar issue with 1.7.12 and 1.7.13, filed issue upstream at jruby/jruby#1830

@@ -3,6 +3,10 @@
# Invoke java with the $DYLD_LIBRARY_PATH set with the homebrew lib dir.
# This allows java to load native libraries installed via homebrew.

if [ -z "$DYLD_FALLBACK_LIBRARY_PATH" ]; then
export DYLD_FALLBACK_LIBRARY_PATH="$HOME/lib:/usr/local/lib:/lib:/usr/lib"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't need to export here

@dgoodlad
Copy link
Contributor

Sorry for the long delay on this. It looks fine except for the small change I noted about not needing to export in your conditional block. Ping me when you've fixed that up and I'll happily merge.

@nonrational
Copy link
Contributor Author

@dgoodlad doh! good catch. consider it removed.

dgoodlad added a commit that referenced this pull request Aug 12, 2014
Fix blank DYLD_FALLBACK_LIBRARY_PATH behavior
@dgoodlad dgoodlad merged commit a6b24ff into boxen:master Aug 12, 2014
@dgoodlad
Copy link
Contributor

Released in 1.6.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Cannot locate dyld's (libc) when using jruby with boxen/puppet-java shim
3 participants