RFR: Update gradle to version 8.11.1 and fix GitHub actions

Jorn Vernee jvernee at openjdk.org
Tue Dec 17 13:39:29 UTC 2024


On Tue, 17 Dec 2024 13:35:13 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Currently the github actions are failing because we depend on versions of the JDK (17 and 22), that are no longer available through the oracle/setup-java github action.
> 
> There are 2 barriers to upgrading these JDK version to ones that are supported:
> 1. The current version of Gradle we are using doesn't run on newer Java versions
> 2. Due to our use of `--enable-preview` and `--release 22` to compile, we are locked to JDK 22.
> 
> This PR updates Gradle to the latest version, which supports running on Java 23. It also drops the `--enable-preview` flag from compilation, which is not actually needed, allowing us to compile using JDK 23 as well. Both these changes then allow us to use JDK 23 to run Gradle, and as a toolchain JDK, in the GitHub actions. Since JDK 23 is available through oracle/setup-java, GitHub actions will work again.

build.gradle line 41:

> 39: def clang_version = clang_versions[0]
> 40: 
> 41: def buildDir = layout.buildDirectory.get()

`$buildDir` is deprecated in the latest version of Gradle. This is a workaround.

build.gradle line 64:

> 62:     options.release = 22
> 63:     options.fork = true
> 64:     options.forkOptions.executable = "${jdk22_home}/bin/javac${os_exe_suffix}"

This change also seemed to be needed for the build to work in GHA on Windows.

-------------

PR Review Comment: https://git.openjdk.org/jextract/pull/264#discussion_r1888531610
PR Review Comment: https://git.openjdk.org/jextract/pull/264#discussion_r1888530970


More information about the jextract-dev mailing list