netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Upgrade to nb-javac from JDK 23, build 26

Open lahodaj opened this issue 1 year ago • 3 comments

A draft for now, but if/when tests are OK with this version of javac, I think we should include it. (And, eventually, upgrade to a newer version when it becomes available, of course.)

lahodaj avatar Jun 14 '24 15:06 lahodaj

goodbye string templates, lets hope they will be back at some point in future.

This is something we should mention on the download page since it might be surprising for users that NB 23 won't know about STs anymore even when the project is on JDK 21.

mbien avatar Jun 14 '24 15:06 mbien

goodbye string templates, lets hope they will be back at some point in future.

This is something we should mention on the download page since it might be surprising for users that NB 23 won't know about STs anymore even when the project is on JDK 21.

Agreed. Although I don't see anything we could reasonably technically do to mitigate the situation.

lahodaj avatar Jun 14 '24 15:06 lahodaj

Although I don't see anything we could reasonably technically do to mitigate the situation.

agreed. String templates were API+language and implemented in java.base and jdk.compiler. So even when we would create a frankenstein nb-javac and partially revert https://github.com/openjdk/jdk/pull/18688 it would create problems. We also don't know how the next version of string templates will look like or when it will arrive - as soon it is available it would break the JDK 21 templates anyway. (preview features are locked to the JDK version for a reason - otherwise the JDK would have to provide multiple implementations of the same feature)

This is the simplest approach, so +1 from me. Thanks for working on this!

mbien avatar Jun 14 '24 18:06 mbien

@lahodaj would you mind finalizing this? While looking into the JSF modules in the NetBeans codebase I also got exceptions from the ThisEscapeAnalyser and I have some hopes, that they are fixed by the update of nb-javac. I would test this one, but the referenced binaries seem not to have been released and thus were not promoted to central, so the nb-javac release has to be respun.

matthiasblaesing avatar Jul 06 '24 19:07 matthiasblaesing

Build a local test version of nb-javac and build netbeans with this applied: build.patch.txt

First impression is good, I plan to run with it the next week.

matthiasblaesing avatar Jul 07 '24 19:07 matthiasblaesing

The plan is to finalize with a new (currently up-to-date) javac. Ideally, sometime during this week, I think. Thanks for the comments!

lahodaj avatar Jul 08 '24 04:07 lahodaj

this PR would have to bump the two 22 values to 23-ea for the java hints job like we did in past a few times: https://github.com/apache/netbeans/blob/76e1f35de7a67b9dbba66d59be6840a81fd4ae8a/.github/workflows/main.yml#L1465-L1468

this would allow us to merge https://github.com/apache/netbeans/pull/7525 without having to wait for the nb-javac changes.

mbien avatar Jul 08 '24 15:07 mbien

The nb-javac binary download has been updated to JDK 23 build 30, as uploaded to Maven central, I think I've fixed all the comments so far. So I think this is ready for review now. Thanks!

lahodaj avatar Jul 10 '24 11:07 lahodaj

Thanks! I'll merge if there's a clean test run.

lahodaj avatar Jul 10 '24 13:07 lahodaj

had to restart the platform batch2 and groovy jobs, but the failures look like normal flakiness unrelated to nb-javac. Should be green in a few minutes.

mbien avatar Jul 10 '24 15:07 mbien