r-universe-org / help

Support and bug tracker for R-universe
https://docs.r-universe.dev/
9 stars 2 forks source link

r-universe and Java 17 #185

Closed AQLT closed 2 years ago

AQLT commented 2 years ago

Hello, I was wondering why R-universe uses Java 11 and not the last LTS release Java 17. Indeed, since October 2021 all the CRAN packages have to be compatible with this Java version and newer developments in Java (and so R packages that depend on it) might not be compatible with older Java version (this is for example the case of several R package that I’m working on). I think all the packages in R-Universe that depend on Java are also compatible with Java 17: they are either on CRAN or do not specify any restriction on the Java version in the description. The only exception I've seen is tabulizer, that has been removed fromCRAN for that reason, but a PR has been made 4 months ago to fix this compatibility problem. So I was wondering if there was any plan to update the Java version used in r-universe or to enable the user to change it? Thanks

jeroen commented 2 years ago

Which platform specifically do you mean? On Windows and Linux we use the stock Java I think? On MacOS indeed I think we set it to JDK 11 here: https://github.com/r-universe-org/build-and-check/blob/32d148d090b2c24a76b2ffde1b983abcf49db700/action.yml#L50

We could bump it I suppose, if that fixes more packages than it breaks. Can you link any examples from packages that don't work right now?

AQLT commented 2 years ago

I think Java 11 is used on Linux (default value: https://github.com/actions/virtual-environments/blob/ubuntu20/20220717.1/images/linux/Ubuntu2004-Readme.md#java) and Java 8 on Windows (default: https://github.com/actions/virtual-environments/blob/win22/20220710.1/images/win/Windows2022-Readme.md#java).

I've tested for only one package and it failed here: https://github.com/r-universe/aqlt/runs/7513923074?check_suite_focus=true All the other packages that are in r-universe don't fail with Java 11 and none of the CRAN packages require (yet) Java >= 17. Use Java 17 will then only fix a few number of packages (in my case ~15 packages with this requirement are being developped)

jeroen commented 2 years ago

On Linux we use a custom build image, that runs ubuntu jammy (22.04) and the default-jre package. Looks like this is indeed JDK11 now: https://packages.ubuntu.com/jammy/amd64/default-jre

jeroen commented 2 years ago

I think given that default-jre on Linux is Java 11, and Java 17 actually breaks quite a few things it is beter for now if we stick with Java 11 in our builds. CRAN also uses default-jdk in their Debian check servers.

I see Debian is currently experimenting with bumping default-jdk to Java 17, but that is still WIP: https://packages.debian.org/experimental/default-jdk

I would recommend package authors not to assume Java 17, as most linux systems will run JDK 11. But we can revisit this when more packages require Java 17.