-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macos: use DYLD_FALLBACK_LIBRARY_PATH #16094
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just merge that first?
Probably
Probably. I suspect similar issues would arise on other BSD-derived systems, and merging #9221 would fix issues on those platforms as well.
Have people run into a similar issue on Linux systems? I'm tempted to say the Linux behavior should be left alone. The macOS behavior descends from BSD, not Linux. I think it's important to keep this platform distinction in mind, because there may not be equivalent features on these two classes of platforms, and if there aren't, it makes no sense trying to pigeonhole Linux to behave like BSD or vice versa -- doing so would be a waste of time. I couldn't find an For anyone interested, here are links to man pages for
|
@goxberry I don't think *BSDs suffer from this issue, since it doesn't look like BSD, uses DYLD, according to Apple's own BSD differences. However, I could be wrong, I don't think this issue affects anything else than Darwin. I think *BSD and Linux behavior should be left as it is, since it doesn't look like Linux or BSD users report similar issues. |
Maybe I should start a new issue for this, as it's kind of a tangent for this PR. |
@DiegoMagdaleno You're right, this issue is limited to Darwin/macOS, and not any other BSDs. |
`DYLD_LIBRARY_PATH` can frequently break builtin macOS software when pointed at Spack libraries. This is because it takes *higher* precedence than the default library search paths, which are used by system software. `DYLD_FALLBACK_LIBRARY_PATH`, on the other hand, takes lower precedence. At first glance, this might seem bad, because the software installed by Spack in an environment needs to find *its* libraries, and it should not use the defaults. However, Spack's isntallations are always `RPATH`'d, so they do not have this problem. `DYLD_FALLBACK_LIBRARY_PATH` is thus useful for things built in an environment that need to use Spack's libraries, that don't set *their* RPATHs correctly for whatever reason. We now prefer it to `DYLD_LIBRARY_PATH` in modules and in environments because it helps a little bit, and it is much less intrusive.
243b01a
to
e9e9df9
Compare
Closes #9221. (or should we just merge that first?)
Fixes #16084. @DiegoMagdaleno
DYLD_LIBRARY_PATH
can frequently break builtin macOS software when pointed at Spack libraries. This is because it takes higher precedence than the default library search paths, which are used by system software.DYLD_FALLBACK_LIBRARY_PATH
, on the other hand, takes lower precedence. At first glance, this might seem bad, because the software installed by Spack in an environment needs to find its libraries, and it should not use the defaults. However, Spack's isntallations are alwaysRPATH
'd, so they do not have this problem.DYLD_FALLBACK_LIBRARY_PATH
is thus useful for things built in an environment that need to use Spack's libraries, that don't set their RPATHs correctly for whatever reason. We now prefer it toDYLD_LIBRARY_PATH
in modules and in environments because it helps a little bit, and it is much less intrusive.I think we should probably also do this for
LD_LIBRARY_PATH
on Linux, as it can interfere in siilar ways. People do want to build against their environments, though, and it's much more common to useLD_LIBRARY_PATH
there, so I'm torn. Thoughts?@goxberry @adamjstewart @sethrj @gartung