RFR: Upgrade to Gradle 8.0.2
James Yuzawa
duke at openjdk.org
Wed Mar 8 14:57:50 UTC 2023
On Tue, 7 Mar 2023 18:23:28 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Upgrade to the most recent gradle version. The prior version (7.3.3) did not support Java versions after 17 per https://docs.gradle.org/current/userguide/compatibility.html This change will allow user to build jextract on Java 19. I had to make sure I had a JDK 17 around for the gradle, set the JAVA_HOME, then make sure I had another proper JDK to bootstrap the build. Additionally, I added a gradle wrapper validation github action to ensure the integrity of the wrapper.
>>
>> Question: is "master" not longer the default branch in this repo? Should these changes to into master and then ported to the various versions branches? Let me know how you may want to proceed.
>
> Thanks for the patch!
>
> I'm testing it out on my Windows machine but it seems like there is an issue with this version of gradle:
>
>
>> .\gradlew clean build
>> Task :compileJava FAILED
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> Execution failed for task ':compileJava'.
>> Error while evaluating property 'javaCompiler' of task ':compileJava'.
> > Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
> > The configured executable does not exist (<path to jdk>\bin\javac)
>
>
> It seems like we need to append `.exe` to the javac executable path explicitly now for Windows to work:
>
>
> diff --git a/build.gradle b/build.gradle
> index c349359..45bc921 100644
> --- a/build.gradle
> +++ b/build.gradle
> @@ -32,6 +32,7 @@ def clang_include_dir = "${llvm_home}/lib/clang/${clang_version}/include"
> checkPath(clang_include_dir)
> def os_lib_dir = Os.isFamily(Os.FAMILY_WINDOWS)? "bin" : "lib"
> def os_script_extension = Os.isFamily(Os.FAMILY_WINDOWS)? ".bat" : ""
> +def os_exe_extension = Os.isFamily(Os.FAMILY_WINDOWS)? ".exe" : ""
> def libclang_dir = "${llvm_home}/${os_lib_dir}"
> checkPath(libclang_dir)
>
> @@ -43,7 +44,7 @@ compileJava {
> options.release = 21
> options.compilerArgs << "--enable-preview"
> options.fork = true
> - options.forkOptions.executable = "${jdk21_home}/bin/javac"
> + options.forkOptions.executable = "${jdk21_home}/bin/javac${os_exe_extension}"
> }
>
> jar {
> ```
>
> ---
>
>> Question: is "master" not longer the default branch in this repo? Should these changes to into master and then ported to the various versions branches? Let me know how you may want to proceed.
>
> The `master` branch is targeting the Java 19 API, which is currently the latest release version. The panama branch targets the API we have in the panama-foreign repo, which is Java 21 now. I don't see support for 21 in the Gradle compatibility matrix though.
>
> Which version of jextract are you interested in building?
@JornVernee I found your relative paths bug https://github.com/gradle/gradle/issues/20837 and also I found https://github.com/gradle/gradle/pull/23887. The good news is that both are slated for gradle 8.1 which is coming soon so I suppose I can hold off until that is released. I will add your exe extension patch at that time.
I was using java 19 to bootstrap the jextract build for java 20 (and will soon likely build for java 21). If I branch off and PR into master could the changes get applied to the jdk* and panama branches? I guess minimally the new gradle version should be in jdk20 (and panama branches).
-------------
PR: https://git.openjdk.org/jextract/pull/110
More information about the jextract-dev
mailing list