Skip to content
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

Add support for ldpaths detection on macOS via DYLD_FALLBACK_LIBRARY_PATH #417

Merged
merged 2 commits into from
Aug 26, 2023
Merged

Add support for ldpaths detection on macOS via DYLD_FALLBACK_LIBRARY_PATH #417

merged 2 commits into from
Aug 26, 2023

Conversation

mjsteinbaugh
Copy link
Contributor

This proposed pull request parses the etc/ldpaths file in R.home() for DYLD_FALLBACK_LIBRARY_PATH on macOS.

I've confirmed that this works on my machine after testing with python3 setup.py install.

Best,
Mike

@mjsteinbaugh
Copy link
Contributor Author

Attempts to address related issue #413

@mjsteinbaugh
Copy link
Contributor Author

mjsteinbaugh commented May 2, 2023

@randy3k
Copy link
Owner

randy3k commented Aug 25, 2023

As indicated in the ldpaths file.

## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.

I thought that this trick no longer works for macOS >=10.11 with sip, apparently it is not the case?

@mjsteinbaugh
Copy link
Contributor Author

@randy3k That patch works on my Mac running Ventura 13.5 with SIP enabled.

This is also a known issue with RStudio, which they're working to address in a new release:
rstudio/rstudio#13085

@randy3k
Copy link
Owner

randy3k commented Aug 25, 2023

Oh, I think I have been misunderstanding the text in ldpaths for years. Actually it meant that we have to set the variable manually, the variable will not be passed automatically.

Thanks for raising it. Will take a look later today :)

@@ -75,35 +75,35 @@ def main(cleanup=None):
if not r_home:
raise RuntimeError("Cannot find R binary. Expose it via the `PATH` variable.")

if sys.platform.startswith("linux"):
Copy link
Owner

Choose a reason for hiding this comment

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

I think we should still restrict ourself to non-window.

For example

 if not sys.platform.startswith("win"):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed yeah that makes sense

Copy link
Owner

Choose a reason for hiding this comment

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

Do you want to do the edit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@randy3k Sure let me add that, 1 sec

@randy3k randy3k merged commit fb643c4 into randy3k:master Aug 26, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants