RFR: Upgrade to Gradle 8.0.2
Jorn Vernee
jvernee at openjdk.org
Wed Mar 8 18:06:44 UTC 2023
On Wed, 8 Mar 2023 14:55:36 GMT, James Yuzawa <duke at openjdk.org> wrote:
>> 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).
@yuzawa-san We've discussed this with the team and I want to note that we have to go through an approval process in order to use a particular version of Gradle. So, if we're not sure here which version of Gradle we want, maybe it's better to wait a bit for Gradle 8.1.
-------------
PR: https://git.openjdk.org/jextract/pull/110
More information about the jextract-dev
mailing list