-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Gradle 8.4 #12655
Comments
Handled by #12650 |
There seems to be an issue with compiling the distribution tests:
Not sure why the test runner ARGS are used for compilation. Jenkins passes those as Gradle property. I have no idea why they are only used for compilation of those tests. |
Hmmm I checked this with So it must be something w/ Gradle property being sent in :( - do you have a Jenkins job url? I can dig if not. |
See this build. Gradle command line and env cars can be found there: https://jenkins.thetaphi.de/job/Lucene-main-Linux/44942/console |
Jenkins uses: RUNTIME_JAVA_HOME and TEST_ARGS environment variables. |
I have no idea why those are injected only for compilation of those tests. Core test compilation works fine. So there seems to be some difference on the distribution tests. @dweiss ? |
but for
I'm still digging. |
I locally reverted gradlew changes and that didn't help fix anything. So it looks like its something in the newer gradle version and how |
snippet from:
|
The cause is If I comment out |
@dweiss already filed gradle/gradle#22746 and it looks like somehow the workaround in @uschindler do you want me to revert the changes? I'm happy to do so. |
Hrrrrrm.... Let's see how this affects us us. |
It has to be the interaction with
in |
Let me take a look. |
So it seems something has changed and the javaCompiler property is now always non-null, causing -X options to be passed to the forked compiler (instead of -J...). I've changed this check to this:
and it seems to pass for me. The toolchains condition was about dodging some problem with jdk api regeneration (like generateJdkApiJar19) but I just ran it with and without RUNTIME_JAVA_HOME and it worked fine... Perhaps @uschindler will remember what the problem was. I'll commit the above as a temporary workaround. |
I don't remember any problem there. The toolchain use for |
I did check that file's history - it used an explicit exclusion for compileMain19Java:
Not worth spending more time on it - if something fails, we'll fix it. |
Hi, there are some other problem with the regenerate task, toolchains do not automatically download, although enabled. I am digging. |
Very strange output if I clean the JDK cache in
Please not the wrong version numbers, it looks like the variable name is incorrectly used. But actually also Java 21 should be available on Adoptium. |
Task info by generateJdkApiJar19 - Regenerate the API-only JAR file with public Panama Foreign & Vector API from JDK 19 |
This is no longer relevant, as we no longer use the toolkit specific compiler. We now generate tha API jars and patch them into Toolkits are only used for launching the API extractor. This is somehow broken since Gradle 8.4, I try to figure out what's wrong. |
OK, I found the bug for the icorrect logger output, but that's not the issue here. The fix is easy. I will provide a PR for the regenerator. The reason is that it looks like the But it looks like at least for windows,, Gradle toolkits can't autodownload the JDK version. I will dig further. |
This fixes the logging problem: diff --git a/gradle/generation/extract-jdk-apis.gradle b/gradle/generation/extract-jdk-apis.gradle
index 28f56ea6432..020dc052813 100644
--- a/gradle/generation/extract-jdk-apis.gradle
+++ b/gradle/generation/extract-jdk-apis.gradle
@@ -38,7 +38,7 @@ configure(project(":lucene:core")) {
apiextractor "org.ow2.asm:asm:${scriptDepVersions['asm']}"
}
- for (jdkVersion : mrjarJavaVersions) {
+ mrjarJavaVersions.each { jdkVersion ->
def task = tasks.create(name: "generateJdkApiJar${jdkVersion}", type: JavaExec) {
description "Regenerate the API-only JAR file with public Panama Foreign & Vector API from JDK ${jdkVersion}"
group "generation" |
It looks like gradle toolchain download is fully broken in Gradle 8.4. It always says that it cannot find any JDK, no matter which OS (Windows, Linux). |
Here is the draft PR, it only fixes the logging, but I have no idea why the toolchains are not downloaded: #12662 If you clean |
I found the issue, in Gradle 8+ you need to explicitely configure toolchain repositories:
I will add the foojay one in the PR. |
In groovy closures do have access to their full context (including local variables outside). That code used gstring, which is a dynamically evaluated string - if you used a string concatenation, it'd be immutable and worked fine. |
OK, PR is ready. The plugin needs to be in settings.gradle (it is a so-called "settings" plugin, which works on gradle toplevel without project context. PR: #12662 (please review) |
The problem was not the gstring/strings. Problem was that the |
Thanks @uschindler and @dweiss sorry for the work here :( I'll try to make sure I test all these cases next time. |
Ah, thanks for clarifying, Uwe. I only looked at the diff and suspected the gstring to blame - overall it's the same thing - the previous code referenced a local variable (not the current loop's value, the variable). Switching to 'each' makes the variable a closure argument, so it's indeed constant (as in: a parameter)... it sometimes gets tricky because if you nest another loop/closure, it can still observe the parameter's value and you can change it... It's a virtue and a pain, depends on when you use it... For what it's worth, I've tried switching a few builds to Kotlin... but I wasn't convinced. It's nice to have a type checker but there were many things that required more verbose constructs to achieve. |
No worries, @risdenk - it's a big effort already, there'll always be problems, especially with major version upgrades. |
Description
Upgrade Gradle from 7.6 to 8.4 - supports building directly with JDK 21 LTS.
https://docs.gradle.org/8.4/release-notes.html
The text was updated successfully, but these errors were encountered: