4.x: upgrades Hibernate to 6.6.*; fixes related native-image problems#10904
4.x: upgrades Hibernate to 6.6.*; fixes related native-image problems#10904ljnelson wants to merge 11 commits intohelidon-io:mainfrom
Conversation
Signed-off-by: Laird Nelson <[email protected]>
...io/helidon/integrations/cdi/jpa/chirp/TestJpaTransactionScopedSynchronizedEntityManager.java
Outdated
Show resolved
Hide resolved
…opedSynchronizedEntityManager.java Signed-off-by: Laird Nelson <[email protected]>
|
When run under my machine's local …the |
|
Or, given the arbitrary cancellation, perhaps a timeout is being hit? |
|
It's hard to understand the pipeline failures, but it now appears that The Linux-only (?!) failure has the following partial stack trace: …which also says: I'm not sure why only the Linux native image |
|
This seems vaguely (and I do mean vaguely) related: oracle/graal#7789 |
…e image test to pass Signed-off-by: Laird Nelson <[email protected]>
|
I've pushed a somewhat blind commit (since I don't have a Linux box locally) to try to get |
…ddy classes at build time Signed-off-by: Laird Nelson <[email protected]>
|
Looking harder at the stack trace above: Hibernate loads a For some reason the Mac OS The error that the stack trace shows is because the Loading the
Since Byte Buddy is inexorably part of Hibernate, it might pay to build-time-initialize certain Byte Buddy classes such as these. My latest commit does this. As usual my local native image test runs fine. I'm expecting the Linux test to fail again but hopefully with more useful information. |
|
So far so good: https://github.com/helidon-io/helidon/actions/runs/20178140513/job/57931887990?pr=10904 {time passes} Boo. But it's a better error this time: |
Signed-off-by: Laird Nelson <[email protected]>
|
My latest commit adds |
|
Moving forward. Now see: |
Signed-off-by: Laird Nelson <[email protected]>
|
My latest commit follows the |
|
Moving back to draft status |
…ild-time initializations Signed-off-by: Laird Nelson <[email protected]>
…ild-time initializations Signed-off-by: Laird Nelson <[email protected]>
Signed-off-by: Laird Nelson <[email protected]>
Signed-off-by: Laird Nelson <[email protected]>
Signed-off-by: Laird Nelson <[email protected]>
|
Slugging away but it is beginning to look like aggressive build-time initialization won't work either. Having spent a day or so on this I will probably end up closing it. It appears that indeed the only path forward is via native image substitutions and related surgery. If I can't make any further headway then I'll simply approve #10487 in whatever its current state is. |
This PR addresses (at least) two issues with a (very deliberately) minimal number of changes, and is intended to supersede #10487.
First, it addresses #10441, and should unlock the door for future Hibernate upgrades.
The tricky part here is that Hibernate has chosen to deliberately ignore (!) a very specific prescription of the Jakarta Persistence 3.1 specification in their 6.6 "series" and beyond, despite very explicit text in the JPA specification to the contrary. Our tests, which have always enforced this area of the specification, broke, and are here amended to make a special case for modern Hibernate versions such that they pass. Is that good or bad? I don't know, but Hibernate is widely used. At least we can now tell whether a given future test failure is due to one provider or the other.
(This is a strange and blunt enough (alleged) specification violation that it might be worth an official Jakarta EE Challenge™, whatever that might mean. I can't see how anyone could read the relevant section to permit what Hibernate does here.)
This required the ability for a given JUnit test to detect whether it is running "with" Hibernate or not (our JUnit tests already run all tests under both Hibernate and Eclipselink). That change is part of this PR.
Next, it addresses (I hope) #10688. It appears that this was fixed by modern versions of the Hibernate 6.x series.
Finally, it permits (at least, locally) the
mp-2test to pass when run with thenative-imageprofile. This did not require any code changes, unlike in #10487, but did require an additional--initialize-at-run-timeclause in theMETA-INF/native-image.propertiesclasspath resource. Unlike with #10487, this also didn't require using the Hibernate-supplied GraalVM native imageFeatureimplementation recommended by the Hibernate team (the features it provides seem already to be effectively provided in a non-standard way by the Helidonio.helidon.integrations.graal.mp.nativeimage.extension.HelidonMpFeatureor the Helidonio.helidon.integrations.graal.nativeimage.extension.HelidonReflectionFeature(can't remember which), or perhaps they really weren't ever needed here). The recommended "trace" agent clumsily provided, if you know how to read its output, the options fornative-image.propertiesI've added, as recommended.I will let the pipelines be the final judge of whether this all works or not, since as of writing this description I'm sure I haven't locally accounted for all possible failures.