randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

Add support for `ldpaths` detection on macOS via `DYLD_FALLBACK_LIBRARY_PATH` #417

Closed mjsteinbaugh closed 10 months ago

mjsteinbaugh commented 1 year ago

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 commented 1 year ago

Attempts to address related issue https://github.com/randy3k/radian/issues/413

mjsteinbaugh commented 1 year ago

For reference, this patch is now applied in koopa: https://github.com/acidgenomics/koopa/blob/main/lang/bash/include/install/common/shared/radian.sh

randy3k commented 10 months ago

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 commented 10 months ago

@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: https://github.com/rstudio/rstudio/issues/13085

randy3k commented 10 months ago

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 :)