-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Move JSON-related JPA tests to their own module #37561
Move JSON-related JPA tests to their own module #37561
Conversation
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.
Hmm, could we stand by a bit?
I'm not exactly a big fan of adding yet another native module (it wasn't declared as one but probably should be).
Also I'm a bit worried that just adding Jackson makes our ORM optimization go away.
Because, well, most people add Jackson so this optimization is then completely useless in a lot of cases.
... True. Especially since it seems we don't support XML serialization with Jackson; at least I couldn't find that in the docs. So, I guess the problem becomes that Jackson (hopefully) or Hibernate ORM (I hope not!) leads to XML parsers being detected as used by GraalVM. I can't work on this right now, so either this will wait, or someone will have to work on native reports... fun stuff. |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
@zakkak any chance you could help us to understand what's going on and if the Jackson extension needs some tuning? |
Sure, I will have a look, but it might take a while. |
I'm not sure the issue is really related to Jackson, but more the fact that when JSON integration was added, XML integration was also included and JAXB was added as an optional dependency: https://github.com/quarkusio/quarkus/pull/35113/files#diff-af9399740cc05097b1e4d8ae864622d81b6ab8f927375a047f81bbf8e9d1477bR146-R160 Seems to me you need different modules for Hibernate and JAXB integration, separate from those that integrate Hibernate and JSON (Jackson). You already have that differentation in the integration test when you test postgresql with xml and the standard postgresql integration test. |
Thanks for having a look.
I'd rather avoid that if possible... It's not very intuitive, especially since upstream bundles it all in a single module.
Alright, but it's optional; I hope an optional dependency, by itself, won't trigger code from that dependency to be added to the native image... ? The very point of an optional dependency is that it's ignored at runtime unless someone else adds a non-optional dependency to the same artifact... Anyway, if that's not the case, I imagine that PR did add some code that might confuse GraalVM into thinking we use JAXB. This looks like a prime suspect: Lines 31 to 34 in 47ecd0a
Maybe that code, or Would that make sense @galderz? |
Optional dependencies are just a concept of Maven. Neither JDK nor GraalVM really has such a concept so anything you bring in through that is considered part of the universe. I wrote about the issues these have here.
I think it's more nuanced than that, because the last GraalVM and/or Mandrel releases work fine with this. So this is not an immediate issue. The problem arises when you try with the very latest GraalVM code along with a newer JDK (the issue seems to appear with both latest JDK 21 and 22). Either of these two parts is causing this to break now but I don't know yet. All my investigations so far lead up to this entry point which is a bit of a dead end:
I'll see if I can git bisect on either the GraalVM or JDK code to try to narrow down the cause. |
FYI I've located the commit that triggers this. I'm trying to understand its effects and how it affects us and will ping the GraalVM author shortly to discuss options. I'll post more details on #37498 when I have them. For now let's leave this PR as is pending a resolution to my investigation. |
This has been fixed in GraalVM upstream so this PR is no longer needed. |
Nice! thank you @galderz 🎉 |
fixes #37498