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

Graalvm native image cause with Groovy 4 #17779

Closed
jonaskahn opened this issue May 18, 2022 · 17 comments · Fixed by #18175
Closed

Graalvm native image cause with Groovy 4 #17779

jonaskahn opened this issue May 18, 2022 · 17 comments · Fixed by #18175
Labels
type: dependencies Pull requests that update a dependency file
Milestone

Comments

@jonaskahn
Copy link

jonaskahn commented May 18, 2022

Bug Report

Which version of ShardingSphere did you use?

  • 5.1.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

  • ShardingSphere-JDBC

Expected behavior

  • Can build native-image with graalvm

Since lib using Groovy 4, some api was remove in version 3. jar file can build to native-image

@linghengqian
Copy link
Member

linghengqian commented May 18, 2022

@linghengqian
Copy link
Member

Do you mean IndyInterface. InvalidateSwitchPoints ()? Refer to oracle/graal#4492 .

@jonaskahn
Copy link
Author

Oh, that's the point @linghengqian . Should I leave the issue to keep track with oracle

@linghengqian
Copy link
Member

Oh, that's the point @linghengqian . Should I leave the issue to keep track with oracle

It looks like Graal's team is tracking this problem. So I'm personally not going to dive into the Groovy problem until the Calcite problem is solved.

@linghengqian
Copy link
Member

It seems that compared to 4.0.1, Groovy 4.0.2 introduces additional bugs(maybe?👨‍🔧) that prevent smooth upgrades, see #17785 . I don't see additional information from the changelog, refer to http://groovy-lang.org/changelogs/changelog-4.0.2.html .

@jonaskahn
Copy link
Author

jonaskahn commented May 19, 2022

@linghengqian Method IndyInterface. InvalidateSwitchPoints () only exist in Groovy 3 and removed in Groovy 4. I think Graalvm need time to adapt new change. But I will try Groovy 4.0.2 in my local to see can it resolved the problem

@linghengqian
Copy link
Member

@linghengqian Method IndyInterface. InvalidateSwitchPoints () only exist in Groovy 3 and removed in Groovy 4. I think Graalvm need time to adapt new change. But I will try Groovy 4.0.2 in my local to see can it resolved the problem

IndyInterface.InvalidateSwitchPoints() being removed is expected behavior, I pointed out Classic bytecode generation removal at #15303 .

@linghengqian
Copy link
Member

It seems that compared to 4.0.1, Groovy 4.0.2 introduces additional bugs(maybe?👨‍🔧) that prevent smooth upgrades, see #17785 . I don't see additional information from the changelog, refer to http://groovy-lang.org/changelogs/changelog-4.0.2.html .

Fixed by #17796 .

@linghengqian
Copy link
Member

linghengqian commented May 19, 2022

@linghengqian
Copy link
Member

I've started a discussion on dropping Groovy 3 support on Graalvm's Slack community's Polygolt channel, and I welcome comments.

@jonaskahn
Copy link
Author

jonaskahn commented May 22, 2022

@linghengqian Sorry for lately reply. I will continue checking on Monday next week. I’m currently in my days off 🌝, I will give you feedback as soon as posbile cause i dont have my PC now

@jonaskahn
Copy link
Author

Tested and still failed.
I also don't have expericence with Groovy, so I think we need to waited Graalvm adapt the change .

@linghengqian
Copy link
Member

Tested and still failed.
I also don't have expericence with Groovy, so I think we need to waited Graalvm adapt the change .

Perhaps you can do some of this in Groovy's main branch. If you're in Groovy slack group's Groovy channel.

If you are talking about GROOVY-10643, then indeed, it wasn't intended to "fix" the GraalVM issue per se. It was just a point of "arguably unintended" binary breakage on the Groovy side - where unintended means that existing compiled classes, e.g. a Grails plugin compiled with Groovy 3 could have technically extended the v7 IndyInterface overriding the invalidateSwitchPoints method. Mind you, it was deemed an internal class and was deprecated so we didn't keep it in place previously. As to whether that helps or makes no difference to the GraalVM issue, I'd have to dive into it a bit more to say.
I'd be keen to make Groovy 4 more Graal friendly regardless of this particular issue if you have any suggestions.

@linghengqian
Copy link
Member

@tuyendev Cheers for the solution of the https://issues.apache.org/jira/projects/GROOVY/issues/GROOVY-10643 ! You can use Groovy's main branch experiment natively!

@linghengqian
Copy link
Member

linghengqian commented Jun 3, 2022

@tuyendev

  • I don't think this problem has to wait until 4.0.3 is released, you can add the following fields to your project's conf/reflect-config.json to solve it. Refer to Groovy Slack Channel. Of course you need to install the master branch of ShardingSphere locally.
 {
   "name": "org.codehaus.groovy.runtime.dgm$53",
   "allDeclaredConstructors": true,
   "allPublicConstructors": true,
   "allDeclaredMethods": true,
   "allPublicMethods": true
 }
  • I don't feel the need to put an incomplete graal configuration directly into the master branch of the shardingsphere at this stage.

  • If the groovy's gral support is ok after configuration, turn off this issue? (Other dependent graal support is not part of this issue discussion)

@linghengqian
Copy link
Member

I plan to close this issue in a PR, because my local verification is successful. If you still have problems, please reopen.

@linghengqian
Copy link
Member

@tuyendev

  • I don't think this problem has to wait until 4.0.3 is released, you can add the following fields to your project's conf/reflect-config.json to solve it. Refer to Groovy Slack Channel. Of course you need to install the master branch of ShardingSphere locally.
 {
   "name": "org.codehaus.groovy.runtime.dgm$53",
   "allDeclaredConstructors": true,
   "allPublicConstructors": true,
   "allDeclaredMethods": true,
   "allPublicMethods": true
 }
  • I don't feel the need to put an incomplete graal configuration directly into the master branch of the shardingsphere at this stage.

  • If the groovy's gral support is ok after configuration, turn off this issue? (Other dependent graal support is not part of this issue discussion)

For revision, this question must be upgraded to Groovy 4.0.3, cf. oracle/graal#4492 (comment) . The master branch of ShardingSphere has resolved this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants