Skip to content

Fix groovy substitutions for Groovy 5+#13097

Open
jerboaa wants to merge 1 commit intooracle:masterfrom
jerboaa:polyglot-fix-groovy-5
Open

Fix groovy substitutions for Groovy 5+#13097
jerboaa wants to merge 1 commit intooracle:masterfrom
jerboaa:polyglot-fix-groovy-5

Conversation

@jerboaa
Copy link
Copy Markdown
Collaborator

@jerboaa jerboaa commented Mar 5, 2026

The feature originally expects the org.codehaus.groovy.vmplugin.v7.IndyInterface class to be present for it to be "in config". This is no longer sufficient since Groovy 5 has the substituted method moved to the v8 package. See:

https://docs.groovy-lang.org/docs/groovy-5.0.0/html/api/org/codehaus/groovy/vmplugin/v8/IndyInterface.html

Instead, check that the method is present as well for the feature to be in config. Use the version specific substitution depending on the Groovy version.

Testing:

Closes: #13096

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 5, 2026
@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented Mar 5, 2026

@vjovanov Could you please help get a fix like this one integrated? Thank you!

@vjovanov
Copy link
Copy Markdown
Member

vjovanov commented Mar 9, 2026

Yes, ideally we want to move features like this into the language or library. However, this feature seems to be valid only for earlier versions of Groovy so we don't need to move it.

This should be also backported to 25 until we get the feature into Groovy and for Groovy previous versions.

@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented Mar 9, 2026

I can cover the GraalVM 25 community backport once this fix is integrated.

@oubidar-Abderrahim oubidar-Abderrahim self-assigned this Mar 10, 2026
@oubidar-Abderrahim
Copy link
Copy Markdown
Member

I mirrored the PR and should proceed with it once the gates are all green

@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented Mar 10, 2026

I mirrored the PR and should proceed with it once the gates are all green

Thanks!

@lissam1
Copy link
Copy Markdown
Member

lissam1 commented Mar 12, 2026

invalidateSwitchPoints() was moved to v8 package for groovy 5, i had a draft pr before my idea was to check in under v7 or v8 so to have backward compatibility. see #12986

The method to be substituted moved from the v7 to the
v8 package from Groovy 4 to Groovy 5

Closes: oracle#13096
@jerboaa jerboaa force-pushed the polyglot-fix-groovy-5 branch from 7e522b5 to 7552858 Compare March 25, 2026 17:39
@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented Mar 25, 2026

The updated patch checks both v7 and v8.

@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented Mar 25, 2026

GHA failure seems unrelated. I see the same math stubs failure in #13207

@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented Mar 26, 2026

@vjovanov @oubidar-Abderrahim Could we please move forward with this? It's causing test noise in our CI for testing quarkus on graal/master (which we run daily). Thank you!

@vjovanov
Copy link
Copy Markdown
Member

@jerboaa sorry for the delay. We had a miscommunication about who is managing this PR.

We have replaced the reflection acces with ReflectUtil and now it is being tested.

@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented Mar 27, 2026

OK, thanks!

Copy link
Copy Markdown

@linghengqian linghengqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that 7e522b5 is now on the master branch?

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

Labels

ibm-redhat-interest OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GR-60622][Native Image] GroovySubstitutions are Groovy 4 specific (break with Groovy 5).

6 participants