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

JAVA-3085: Initialize c.d.o.d.i.core.util.Dependency at Graal native image build-time #1674

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

hhughes
Copy link
Contributor

@hhughes hhughes commented Jul 10, 2023

No description provided.

@absurdfarce
Copy link
Contributor

absurdfarce commented Jul 10, 2023

I tried this change with a couple local Graal test cases (including one of the ones referenced on the original PR) and I don't see any fatal regressions. So far I've only tested with the following VM:

$ java -version
openjdk version "11.0.18" 2023-01-17
OpenJDK Runtime Environment GraalVM CE 22.3.1 (build 11.0.18+10-jvmci-22.3-b13)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.1 (build 11.0.18+10-jvmci-22.3-b13, mixed mode)

I am seeing the following set of warnings now which (I believe) are new:

> Task :nativeImage                                                                   
========================================================================================================================
GraalVM Native Image: Generating 'keyspaceCount' (executable)...                                 
========================================================================================================================
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.protobuf.ProtobufDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.protobuf.ProtobufDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite.
[1/7] Initializing...                                                                                    (5.0s @ 0.17GB)
 Version info: 'GraalVM 22.3.1 Java 11 CE'  
 Java version info: '11.0.18+10-jvmci-22.3-b13'

I don't think these were introduced by the change in this PR. Currently working on a quick re-test to confirm.

@absurdfarce
Copy link
Contributor

Confirmed: the warnings above appear with the same GraalVM version even when the changes contained in this PR are not present. Given that result I don't see any reason not to move forward with this.

@hhughes
Copy link
Contributor Author

hhughes commented Jul 11, 2023

tests failures appear unrelated, merging

@hhughes hhughes merged commit f3ff471 into 4.x Jul 11, 2023
3 checks passed
@absurdfarce absurdfarce changed the title JAVA-3085: Tell graal to initialize com.datastax.oss.driver.internal.… JAVA-3085: Tell graal to initialize com.datastax.oss.driver.internal.core.util.Dependency at build-time Jul 12, 2023
@absurdfarce absurdfarce changed the title JAVA-3085: Tell graal to initialize com.datastax.oss.driver.internal.core.util.Dependency at build-time JAVA-3085: Initialize c.d.o.d.i.core.util.Dependency at Graal native image build-time Jul 12, 2023
@hhughes hhughes deleted the JAVA-3085 branch July 26, 2023 19:02
@onobc
Copy link

onobc commented Jul 27, 2023

Thanks for this PR @hhughes and for all of the effort spent attempting to repro etc @absurdfarce .

It looks like the issue is labeled for 4.17.0. Any rough date on when that may be available?

@absurdfarce
Copy link
Contributor

@onobc Fortunately version 4.17.0 of the Java driver is already available! You can get it from Maven Central or from the release on Github!

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.

3 participants