rstudio / r-builds

an opinionated environment for compiling R
GNU General Public License v3.0
99 stars 19 forks source link

Adds Oracle Linux support #203

Closed tiagomlalves closed 7 months ago

tiagomlalves commented 7 months ago

Fixes https://github.com/rstudio/r-builds/issues/202. Adds Oracle Linux support which, in version 9, requires different logic than RedHat 9 to install repositories.

Changes validated in both Oracle Linux 8 and 9 versions.

tiagomlalves commented 7 months ago

Just one question from testing it out briefly, since I'm not familiar with Oracle Linux. With a stock oraclelinux:9 Docker image, there is no repo named crb, and there's no /usr/bin/crb utility either. So the install script's dnf config-manager --set-enabled crb command doesn't work in this Docker image at least.

You're right - neither docker image (nor my system) has /usr/bin/crb utility. This has been installed when running the below from install.sh (see line 389):

        ${SUDO} dnf install ${yes} https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

Does this work for your Oracle Linux systems? Or did you already have CodeReady Builder enabled by any chance? In this OL9 Docker image, dnf config-manager --enable ol9_codeready_builder does work though.

As, I'm double checking the code I see calling dnf config-manager --set-enabled crb does not work 😿 ... which is great reminder that I should have done a clean test after creating these changes.

I'll fix this PR and push new changes. Thank you for doing due diligence and please accept my apologies due to a broken PR!

tiagomlalves commented 7 months ago

I've fixed my original PR and validated changes by running the following:

for LINUX_VERSION in 8 9; do 
  for R_VERSION in 4.3.2 3.4.2; do
    docker run \
      -i --platform=linux/amd64 \
      -v "$(pwd)/install.sh":/install.sh \
      -e R_VERSION=${R_VERSION} -e RUN_UNATTENDED=yes \
      oraclelinux:${LINUX_VERSION} \
      sh -c "bash /install.sh ; /opt/R/\${R_VERSION}/bin/R --version"
  done
done

This has installed successfully R 4.3.2 and 3.4.2 in both Oracle Linux 8 and 9 versions.

NOTES:

glin commented 7 months ago

Awesome, it works well now. I don't think the function naming is a big deal, but we could always rename it later if really confusing :shrug:.