-
Notifications
You must be signed in to change notification settings - Fork 917
Gradle 9 compatibility fixes #8703
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
Conversation
|
would be nice if a heavy gradle user could run this against some of their projects as smoke test. (hello world worked with gradle 5-9) |
|
added a second commit which works analog to #8606 but locks the major version component of the returned version. Currently set to 9. This should make it a bit safer (+ it fits that gradle 9 started to use semantic versioning). Commits meant to be squashed if we decide to do that. |
aca346c to
7e1d11e
Compare
Can you file an issue for this + assign it (to me ?) |
Note to self:
|
NB can only support the versions that the Tooling API supports. I'm not sure if the current version supports 3.x. Think I saw once we upgrade to v9 that the lowest support would be 4.x.
It's much older but for some reason not in the docs. We've been using since at least #5014 This usage appears to have been missed in that. As discussed on Slack, longer term it would be good to see whether the Tooling API and models can now actually cover all of the introspection we need - make some of this someone else's problem! |
Makes sense! The change in #8606 was intended to stabilise the existing semantics, and remove the starting of two daemons / download of two distributions problem. Is the |
neilcsmith-net
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with limited testing. New project working, and some old projects tested.
Added versioning API a good idea.
Thanks @mbien !
Aside : In testing old projects I'm curious why the changes in #5158 disable the Java runtime setting in certain circumstances? Seems hit and miss whether this can be changed on a broken project that needs a lower JDK.
| "shouldRunAfter", | ||
| "enabled", | ||
| "description", | ||
| "vendor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just as note: this fixes the cycle (OOME) by excluding the updateDaemonJvm.vendor.* path
this had similar symptoms as #6674 (comment) but surfaced as OOME instead of stack overflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me propose a different fix -- I've debugged this and (mea culpa !!!) it's caused by serializing STATIC properties reported by the metaobject. And in the JvmVendorSpec case, each instance has another set of 13 properties. Although recursive serialization of the same instance is guarded ... combinatiorial explosion is not.
- gradle 9 removed some deprecated API - introspecting 'updateDaemonJvm.vendor.*' causes OOME in daemon added 'vendor' to exclude set - init with latest supported gradle version by locking the major component (instead of using 'current')
I wondered about that too, but @lkishalmi explained to me on slack that I shouldn't worry about this since the class is in fact super old. My hypothesis is that the class moved from tooling to distribution (or the other way around) at least once, thats why its missing in javadoc.
the oldest gradle version where hello world project loading worked seems to be 5.0 but I could have made some mistakes while backporting the project config while testing. going to squash |
FWIW, i use in The development IDE (and about everyone) happily gradles, but the debugged NetBeans creates another daemon instance. Yes, sometimes I need to kill all gradles |
yes, this is also fixed by this PR |
|
Seems like I've cloned your repo, but still has old code. Sorry. Checking it |
|
After rebuilding from correct branch I can confirm project using Gradle 9 loads correctly. |
|
since we have merges on hold atm and this would stabilize CI, I am going to merge this to RC 3 will be later this week so there would be still time to add more safeguards against introspection cycles if needed, without delaying other progress unnecessarily. |
updateDaemonJvm.vendor.*causes OOME in daemon (uses 512MB by default, but 4GB were also not sufficient). Added 'vendor' to exclude set.tested hello world project loading between gradle 5 and 9.
for future reference:
I found this by increasing daemon Xmx, setting
MAX_INTROSPECTION_DEPTHto a low value, e.g 8, then setting a breakpoint atnetbeans/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
Line 590 in e54117d
MAX_INTROSPECTION_DEPTHis probably far too high to protect from OOMEs but it will depend on the shape of the graph.The annoying part was to debug a daemon while
extide/gradle/netbeans-gradle-toolingis trying to start daemons too, given that it is a gradle project ;)