Skip to content

Commit

Permalink
Fix native compilation for Netty and Mutiny
Browse files Browse the repository at this point in the history
See quarkusio#39819 and quarkusio#39788

(cherry picked from commit b35ae00)
  • Loading branch information
jponge authored and gsmet committed Apr 9, 2024
1 parent 257c5a9 commit b2078f6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion extensions/mutiny/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny-smallrye-context-propagation</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>nativeimage</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.quarkus.mutiny.runtime;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.RecomputeFieldValue;
import com.oracle.svm.core.annotate.TargetClass;

class JCToolsSupport {
}

// Thanks to https://github.com/DataDog/dd-trace-java/pull/6020
@TargetClass(className = "org.jctools.util.UnsafeRefArrayAccess")
final class Target_org_jctools_util_UnsafeRefArrayAccess {

@Alias
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.ArrayIndexShift, declClass = Object[].class)
public static int REF_ELEMENT_SHIFT;
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ NativeImageConfigBuildItem build(
.addRuntimeInitializedClass("io.netty.handler.ssl.ReferenceCountedOpenSslEngine")
.addRuntimeInitializedClass("io.netty.handler.ssl.ReferenceCountedOpenSslContext")
.addRuntimeInitializedClass("io.netty.handler.ssl.ReferenceCountedOpenSslClientContext")
.addRuntimeInitializedClass("io.netty.handler.ssl.JdkSslServerContext")
.addRuntimeInitializedClass("io.netty.handler.ssl.JdkSslClientContext")
.addRuntimeInitializedClass("io.netty.handler.ssl.util.ThreadLocalInsecureRandom")
.addRuntimeInitializedClass("io.netty.buffer.ByteBufUtil$HexUtil")
.addRuntimeInitializedClass("io.netty.buffer.PooledByteBufAllocator")
Expand Down

0 comments on commit b2078f6

Please sign in to comment.