-
Notifications
You must be signed in to change notification settings - Fork 63
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
build: Bump Gradle Wrapper to v8.4 #1419
Conversation
@microsoft-github-policy-service agree |
fe9ef0e
to
c46fead
Compare
Hi @jdneo! Yes, I was wrapping up some last details and writing a description. I just marked the PR ready for review 🙂 |
I guess one of the problem you are facing is that the build-server-for-gradle repo is not public but it is required to build this extension. (Our plan is to release a stable version of this extension at the end of this month containing the build server approach, meanwhile make the build-server-for-gradle repo public). |
Oh, btw, I tend to avoid making some big changes when close to the release date. Would you mind that merging this PR after the release at the end of this month? (We will have National Day holiday in China at beginning of Oct., I can review this PR after the holiday, which is Oct 7th) |
Makes sense. But that only causes problems if I try to build the jars with
I can open separate issues for each of these if they make sense. I think it'd be also great to update a few things, like the Node.js version, or the Gradle scripts, where possible 🙂
Sure, that sounds good to me. Thanks a lot! Any chance you can approve the workflow to see if all checks are passing? That way, I could attempt to fix anything failing in the meantime. |
Thank you JoseLion! I only took over this project recently. But I can confirm that I encountered those issues you mentioned above. It will be so great if you can help file issues for them! I apologize that I haven't done it before when I met them, though I should do that. :)
Yes, your finding is correct.
Sorry I haven't debugged the Language Server yet. I can ask my teammate about this next week.
Yes, I observed this as well when I was trying to update the CI pipeline. Only Java 11 can be used to run the tests.
We should definitely upgrate the node version, since the latest VS Code is using 18.x now. 14 is too old. |
No worries at all! I'll be happy to file those issues. I can also try to help with some of them after this month's release since I now have more context on the project 🙂 |
Thank you! It's so great to have users like you helping us make the product better! |
c46fead
to
3e69390
Compare
This PR is still in my todo list, sorry for the late responses. I'll review it after the holiday. |
gradle-server/src/main/java/com/github/badsyntax/gradle/utils/Utils.java
Outdated
Show resolved
Hide resolved
d1c9668
to
c76e6b7
Compare
Looks like build will fail when using new I'm thinking that, maybe a better way to run the CI is to first build the extension and then test it towards different Java versions? |
@jdneo, I was thinking something like that. We could run the tests in different Java versions using Gradle's Java Toolchain. That way, we won't need to install different Java versions on CI. Gradle will do that for us, and caching should make this process even faster after the first run. Also, we'll be able to run tests for all Java versions locally, so that's a win too! I can help with a PR for this. Let me know if you think this is a good idea 🙂 |
Checking the GitHub Actions workflow, another option is to move the |
On redhat-developer/vscode-java#3314 we found that eclipse buildship was breaking some JDK21/gradle8.4 builds eclipse-buildship/buildship#1271. I don't think this will block this PR but may be useful for other people trying to get JDK21 working |
@JoseLion Sounds like the second approach is easier. I would prefer the second one.
Like always, any contributions are welcome. Thank you! 👍 |
@slymon99 Thank you for the information. According to the compatibility matrix, 8.4 does not fully support JDK 21 now. We will keep an eye on it. https://docs.gradle.org/current/userguide/compatibility.html |
c76e6b7
to
202dc07
Compare
Looks like |
Hi @JoseLion Today I created a new Gradle project with 8.4, and set So, I guess maybe the project created by |
Hi @jdneo! I have been looking into that, and it seems I had it wrong! I was using the debug methods described in the CONTRIBUTING.md file, but I didn't notice that the client was failing to start. It looks like the problem is I'm missing the |
Sorry for that. One way of workaround I guess could be manually copied those required jars from the installed extension location. For example, if you are using VS Code stable, you can found it at |
Excellent! Thank you @jdneo, that worked. This is how I'm testing the changes: Without this PR changes:
With this PR changes:
The reason why it works on Gradle v8.4 with and without these changes is because how the Utils.hasCompatibilityError(..) method works: If the current Gradle version is equal to or higher than the version matching the current JDK version, it won't cause any compatibility error. That's how I understood this part of the code, but maybe that's incorrect. Let me know what you think and if the steps above work for you 🙂 |
134e2ff
to
e78c23a
Compare
PS: I rebased the PR branch onto |
I got following exception when using Gradle 8.0 and JDK 21:
I think it makes sense because according to the compatibility matrix, Gradle 8.0 won't support java 21. When you test locally, please just use |
Oh, I see what you mean! I've been testing it wrong all along 😅 The good news is that I found the problem. It seems that the GetBuildHandler.run() method relies on running I think we have two possible solutions:
IMO, option 2 is more straightforward and avoids coupling the code logic to Gradle's behavior (which changes from version to version). I quickly tested option 2, and things are working as expected. I even got the VSCode notification with the incompatibility message (screenshot below). What do you think? 😁 |
We need to make sure: it is on purpose or not that the compatibility handle logic will only execute in the try-catch block. For example, maybe, there are some cases that the compatibility matrix does not strictly match the real situation? I tend to not touch the execution logic unless we have a strong reason to change it :) But, I think it does not block this PR to be merged. IMO, we can slightly change the title of the PR and then merge it. For example, |
Yes, there could be other reasons for that. Checking for compatibility issues only in the catch-block is a more flexible approach. The downside is that users will never get the "VSCode incompatibility notification" when using Gradle v8.2 or higher. They will have to run a Gradle task within VSCode to ensure their Gradle version is compatible with the Java version used by VSCode. But I agree! That part is off-topic regarding |
e78c23a
to
e510b7b
Compare
… and update the text-fixtures Gradle Wrapper version
e510b7b
to
89f2521
Compare
@JoseLion Thank you for the contribution. |
Thanks for all the hard work. It’s a shame a lot of these subsystems don’t adhere to the Java forward compatibility promise. |
@JoseLion I've got some update about the Java 21 stuff. Because now the compatibility matirx has two column:
According to the definition, I think we should replace |
@jdneo, that's very useful to know! I've been using the Java Toolchain lately, so that may be why I didn't get into any trouble with Java 21 so far. I think it's a good idea to replace
Let me know what you think. |
Yes, we can wait until the |
Resolves #1420. This PR intends to add support for JDK21. Some details on the changes:
com.diffplug.spotless
plugin had to be updated to work with newer Java versions.v8.4-rc-1
. I'm not sure this is necessary for the project to build, but that is the minimum Gradle version that supports Java 21.