From e8127877ce8b1bb597e814939698b881e3cfc738 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 29 Jan 2022 21:37:50 -0600 Subject: [PATCH] [ci] manually create symlinks to R entrypoints on macOS (fixes #4988) --- .ci/test_r_package.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index e7d36e59ceeb..f18e7bbf1e27 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -81,6 +81,17 @@ if [[ $OS_NAME == "macos" ]]; then -pkg $(pwd)/R.pkg \ -target / + # Older R versions (<= 4.1.1) on newer macOS (>= 11.0.0) cannot create the necessary symlinks. + # See https://github.com/r-lib/actions/issues/412. + sudo ln \ + -sf \ + /Library/Frameworks/R.framework/Resources/bin/R \ + /usr/local/bin/R + sudo ln \ + -sf \ + /Library/Frameworks/R.framework/Resources/bin/Rscript \ + /usr/local/bin/Rscript + # Fix "duplicate libomp versions" issue on Mac # by replacing the R libomp.dylib with a symlink to the one installed with brew if [[ $COMPILER == "clang" ]]; then