Skip to content

Commit 54cd152

Browse files
authored
[DE-812] Vert.x 4.5.7 (#559)
* updated Vert.x to version 4.5.7 (DE-812) * updated shaded driver native image (DE-812) * fixed native tests for GraalVM CE * CI upd * updated shaded native configuration
1 parent e0935a8 commit 54cd152

File tree

28 files changed

+396
-1112
lines changed

28 files changed

+396
-1112
lines changed

.github/workflows/native.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ jobs:
2727
- uses: actions/checkout@v2
2828
- uses: graalvm/setup-graalvm@v1
2929
with:
30-
java-version: '21.0.1'
31-
distribution: 'graalvm'
30+
java-version: '22.0.1'
31+
distribution: 'graalvm-community'
32+
components: 'js'
3233
cache: 'maven'
3334
native-image-job-reports: 'true'
3435
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -66,8 +67,9 @@ jobs:
6667
- uses: actions/checkout@v2
6768
- uses: graalvm/setup-graalvm@v1
6869
with:
69-
java-version: '21.0.1'
70-
distribution: 'graalvm'
70+
java-version: '22.0.1'
71+
distribution: 'graalvm-community'
72+
components: 'js'
7173
cache: 'maven'
7274
native-image-job-reports: 'true'
7375
github-token: ${{ secrets.GITHUB_TOKEN }}

driver/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,16 @@
225225
<version>${graalvm.version}</version>
226226
<type>pom</type>
227227
<scope>test</scope>
228+
<exclusions>
229+
<exclusion>
230+
<groupId>org.graalvm.truffle</groupId>
231+
<artifactId>truffle-runtime</artifactId>
232+
</exclusion>
233+
<exclusion>
234+
<groupId>org.graalvm.truffle</groupId>
235+
<artifactId>truffle-enterprise</artifactId>
236+
</exclusion>
237+
</exclusions>
228238
</dependency>
229239
<dependency>
230240
<groupId>io.smallrye.config</groupId>

driver/src/main/resources/META-INF/native-image/com.arangodb/arangodb-java-driver/native-image.properties

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,4 @@ Args=\
22
-H:ResourceConfigurationResources=${.}/resource-config.json,${.}/resource-config-spi.json \
33
-H:ReflectionConfigurationResources=${.}/reflect-config.json,${.}/reflect-config-serde.json,${.}/reflect-config-spi.json,${.}/reflect-config-mp-config.json \
44
-H:SerializationConfigurationResources=${.}/serialization-config.json \
5-
-H:DynamicProxyConfigurationResources=${.}/proxy-config.json \
6-
--initialize-at-build-time=\
7-
org.slf4j \
8-
--initialize-at-run-time=\
9-
io.netty.handler.ssl.BouncyCastleAlpnSslUtils,\
10-
io.netty.handler.codec.compression.ZstdOptions,\
11-
io.netty.handler.codec.compression.BrotliOptions,\
12-
io.netty.handler.codec.compression.Brotli \
13-
-Dio.netty.noUnsafe=true \
14-
-Dio.netty.leakDetection.level=DISABLED
5+
-H:DynamicProxyConfigurationResources=${.}/proxy-config.json

driver/src/test/java/graal/BrotliSubstitutions.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
import com.oracle.svm.core.annotate.Substitute;
44
import com.oracle.svm.core.annotate.TargetClass;
55

6+
public class BrotliSubstitutions {
67

7-
@TargetClass(className = "io.netty.handler.codec.compression.Brotli")
8-
final class Target_com_arangodb_shaded_netty_handler_codec_compression_Brotli {
9-
@Substitute
10-
public static boolean isAvailable() {
11-
return false;
12-
}
8+
@TargetClass(className = "io.netty.handler.codec.compression.Brotli")
9+
static final class Target_io_netty_handler_codec_compression_Brotli {
10+
@Substitute
11+
public static boolean isAvailable() {
12+
return false;
13+
}
1314

14-
@Substitute
15-
public static void ensureAvailability() throws Throwable {
16-
throw new UnsupportedOperationException();
15+
@Substitute
16+
public static void ensureAvailability() throws Throwable {
17+
throw new UnsupportedOperationException();
18+
}
1719
}
1820
}
19-
20-
public class BrotliSubstitutions {
21-
22-
}

driver/src/test/java/graal/HttpContentCompressorSubstitutions.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

driver/src/test/java/graal/EmptyByteBufStub.java renamed to driver/src/test/java/graal/netty/EmptyByteBufStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package graal;
1+
package graal.netty;
22

33
import io.netty.util.internal.PlatformDependent;
44

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package graal.netty.graal;
2+
3+
import java.util.function.BooleanSupplier;
4+
5+
import com.oracle.svm.core.annotate.Substitute;
6+
import com.oracle.svm.core.annotate.TargetClass;
7+
8+
import io.netty.buffer.ByteBuf;
9+
import io.netty.channel.ChannelHandlerContext;
10+
11+
public class HttpContentCompressorSubstitutions {
12+
13+
@TargetClass(className = "io.netty.handler.codec.compression.ZstdEncoder", onlyWith = IsZstdAbsent.class)
14+
public static final class ZstdEncoderFactorySubstitution {
15+
16+
@Substitute
17+
protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect) throws Exception {
18+
throw new UnsupportedOperationException();
19+
}
20+
21+
@Substitute
22+
protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) {
23+
throw new UnsupportedOperationException();
24+
}
25+
26+
@Substitute
27+
public void flush(final ChannelHandlerContext ctx) {
28+
throw new UnsupportedOperationException();
29+
}
30+
}
31+
32+
@Substitute
33+
@TargetClass(className = "io.netty.handler.codec.compression.ZstdConstants", onlyWith = IsZstdAbsent.class)
34+
public static final class ZstdConstants {
35+
36+
// The constants make <clinit> calls to com.github.luben.zstd.Zstd so we cut links with that substitution.
37+
38+
static final int DEFAULT_COMPRESSION_LEVEL = 0;
39+
40+
static final int MIN_COMPRESSION_LEVEL = 0;
41+
42+
static final int MAX_COMPRESSION_LEVEL = 0;
43+
44+
static final int MAX_BLOCK_SIZE = 0;
45+
46+
static final int DEFAULT_BLOCK_SIZE = 0;
47+
}
48+
49+
public static class IsZstdAbsent implements BooleanSupplier {
50+
51+
private boolean zstdAbsent;
52+
53+
public IsZstdAbsent() {
54+
try {
55+
Class.forName("com.github.luben.zstd.Zstd");
56+
zstdAbsent = false;
57+
} catch (Exception e) {
58+
// It can be a classloading issue (the library is not available), or a native issue
59+
// (the library for the current OS/arch is not available)
60+
zstdAbsent = true;
61+
}
62+
}
63+
64+
@Override
65+
public boolean getAsBoolean() {
66+
return zstdAbsent;
67+
}
68+
}
69+
}

driver/src/test/java/graal/NettySubstitutions.java renamed to driver/src/test/java/graal/netty/graal/NettySubstitutions.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
package graal;
1+
package graal.netty.graal;
22

33
import com.oracle.svm.core.annotate.Alias;
44
import com.oracle.svm.core.annotate.RecomputeFieldValue;
55
import com.oracle.svm.core.annotate.RecomputeFieldValue.Kind;
66
import com.oracle.svm.core.annotate.Substitute;
77
import com.oracle.svm.core.annotate.TargetClass;
8+
import graal.netty.EmptyByteBufStub;
89
import io.netty.bootstrap.AbstractBootstrapConfig;
910
import io.netty.bootstrap.ChannelFactory;
1011
import io.netty.buffer.ByteBuf;
@@ -65,7 +66,7 @@ public static boolean isAlpnSupported(final SslProvider provider) {
6566
case OPENSSL_REFCNT:
6667
return false;
6768
default:
68-
throw new Error("SslProvider unsupported: " + provider);
69+
throw new Error("SslProvider unsupported on Quarkus " + provider);
6970
}
7071
}
7172
}
@@ -86,7 +87,7 @@ final class Target_io_netty_handler_ssl_OpenSsl {
8687

8788
@Alias
8889
@RecomputeFieldValue(kind = Kind.FromAlias)
89-
private static Throwable UNAVAILABILITY_CAUSE = new RuntimeException("OpenSsl unsupported!");
90+
private static Throwable UNAVAILABILITY_CAUSE = new RuntimeException("OpenSsl unsupported on Quarkus");
9091

9192
@Alias
9293
@RecomputeFieldValue(kind = Kind.FromAlias)

driver/src/test/java/graal/ZLibSubstitutions.java renamed to driver/src/test/java/graal/netty/graal/ZLibSubstitutions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package graal;
1+
package graal.netty.graal;
22

33
import com.oracle.svm.core.annotate.Substitute;
44
import com.oracle.svm.core.annotate.TargetClass;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* from io.quarkus:quarkus-netty:3.10.1
3+
*/
4+
package graal.netty;

0 commit comments

Comments
 (0)