Skip to content
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

Tracking issue for Gradle upgrade to 7.2 [LUCENE-9990] #11029

Closed
asfimport opened this issue Jun 4, 2021 · 11 comments
Closed

Tracking issue for Gradle upgrade to 7.2 [LUCENE-9990] #11029

asfimport opened this issue Jun 4, 2021 · 11 comments

Comments

@asfimport
Copy link

asfimport commented Jun 4, 2021

Gradle 7 has added support for running builds with arbitrary JVMs.

Today, Gradle 6 only supports running tests with Java 16 and so on.

I tried to upgrade our Gradle version to 7 and made some progress.

  1. Removed the JavaInstallationRegistry plugin because it is deprecated in Gradle 7 ( a simple build scan reveals this). This is replaced by the toolchain support added in Gradle 7 and works great. JavaInstallationRegistry is the only deprecated plugin
  2. Building Lucene with Java 16 gives some weird error when trying to access internal JVM classes. Fixing it with --add-opens does the trick. Related Github issue: Compilation with toolchain using JDK 16-ea28 fails due to illegal access to com.sun.tools.javac.code.Symbol$TypeSymbol (worked in 16-ea26) gradle/gradle#15538

What does not work?

As noted by @dweiss here, the gradle-consistent-versions plugin does not support Gradle 7. There was a related PR but it still a WIP

 

Attached is a WIP patch that breaks due to the gradle-consistent-versions plugin


Migrated from LUCENE-9990 by Gautam Worah (@gautamworah96), resolved Aug 25 2021
Attachments: wip_gradle7_upgrade_patch
Linked issues:

Pull requests: #175

@asfimport
Copy link
Author

Dawid Weiss (@dweiss) (migrated from JIRA)

Thanks! I'll be able to look through the changes you made on Monday though. Perhaps we should abandon palantir's plugin in the long run, if we can find a reasonable way of dealing with conflicts/ updates, etc.

@asfimport
Copy link
Author

Dawid Weiss (@dweiss) (migrated from JIRA)

This upgrades gradle to 7.2 (latest). It's the simplest patch I could provide. I've tried using toolchains but I found too many open problems there (unable to select from auto-discovered version-identical JVMs, unable to point at an exact JVM home to use as the default toolchain). I sticked to internal APIs that still work and are reliable.

The patch still doesn't make gradlew itself to work with Java 16 - seems like some external plugin upgrades would be required for this but I leave it to a follow-up issue.

@asfimport
Copy link
Author

Dawid Weiss (@dweiss) (migrated from JIRA)

@gautamworah96 I think this is ready. If you'd like to give it another spin, please go ahead!

@asfimport
Copy link
Author

ASF subversion and git services (migrated from JIRA)

Commit 45868a5 in lucene's branch refs/heads/main from Dawid Weiss
https://gitbox.apache.org/repos/asf?p=lucene.git;h=45868a5

LUCENE-9990: upgrade to gradle 7.2.

@asfimport
Copy link
Author

Dawid Weiss (@dweiss) (migrated from JIRA)

I've applied this patch since it moves us forward and is not crucial to anything else. Let's fix other things as a follow up (Java 16 compat).

@asfimport
Copy link
Author

Gautam Worah (@gautamworah96) (migrated from JIRA)

Thanks @dweiss, I'll try to run some checks (like the ones you've mentioned in LUCENE-10065). 

@asfimport
Copy link
Author

Dawid Weiss (@dweiss) (migrated from JIRA)

I actually ran those already. One of the generated files changes (fst.dat) - I think it's because of FST implementation changes; this could be regenerated and committed to make sure it's in sync with the codebase.

@asfimport
Copy link
Author

Uwe Schindler (@uschindler) (migrated from JIRA)

Hi,
Jenkins seems Happy on Windows, Linux and Map. Also passing RUNTIME_JAVA_HOME works on Policeman Jenkins. Build always runs with JDK 11 there, so I see no reason to improve compatibility yet. This should be solved by Gradle.

@asfimport
Copy link
Author

asfimport commented Aug 26, 2021

Dawid Weiss (@dweiss) (migrated from JIRA)

Everything works up to JDK16 – I'll commit #11104 shortly. If you regenerate your local gradle.properties it adds module opens for spotless, it's the only thing that wasn't compatible.

@asfimport
Copy link
Author

asfimport commented Sep 16, 2021

ASF subversion and git services (migrated from JIRA)

Commit de45b68 in lucene's branch refs/heads/main from Dawid Weiss
https://gitbox.apache.org/repos/asf?p=lucene.git;h=de45b68

#10488, LUCENE-9990: fix Luke's launcher task.

@asfimport
Copy link
Author

Adrien Grand (@jpountz) (migrated from JIRA)

Closing after the 9.0.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants