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 support fixes #1611

Closed
wants to merge 2 commits into from
Closed

Conversation

sdeleuze
Copy link

This PR fixes 2 blocking issues (native build broken) observed on https://github.com/spring-projects/spring-aot-smoke-tests/tree/main/data-cassandra which is used to validate the native support of Spring Boot 3. I have provided detailed explanation in the commit messages.

Tested with GraalVM 22.2 and upcoming GraalVM 22.3, but those changes should be fine with previous versions as well.

@delete is not supported (native build broken) on classes
that have a field of their own type with GraalVM 22.2 and
upcoming 22.3, and that's the case for Lz4Compressor which
has a Lz4Compressor field.

In practice, those @delete substitutions are useless because
Lz4Compressor and SnappyCompressor won't be reachable after
newInstance substitution has been applied, so this commit
removes them.
The Dependency class is used in the various BooleanSupplier
implementations for the class specified in the @TargetClass
onlyWith annotation attribute.

Without an explicit initialization of this class at build time,
the native build is broken with a "Dependency was unintentionally
initialized at build time error" message.

This commit initializes the Dependency class at build time, which
seems to be safe in terms of compatibility as it does not require
transitively the initialization of other classes at build time.
@absurdfarce absurdfarce self-requested a review October 12, 2022 15:32
@absurdfarce
Copy link
Contributor

Thanks for the PR @sdeleuze!

Have you signed the Contributor License Agreement for contributions to DataStax open source projects? If not you can find it at https://cla.datastax.com/. Thanks!

@sdeleuze
Copy link
Author

sdeleuze commented Oct 12, 2022

Not yet, I will see if I can sign it and let you know.

@sdeleuze
Copy link
Author

sdeleuze commented Oct 13, 2022

Since I won't be able to have the CLA signed by my company is a reasonable amount of time and effort, I have turned this PR into the issue JAVA-3045 and kindly ask one of the committers of this project to commit the simple fixes proposed in the related issue (should match the changes of this PR, feel free to reuse the commit messages).

@absurdfarce
Copy link
Contributor

Replaced with #1612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants