From f7a8a6f1ae0ac5034dad9ae84d0ea14e12d91f83 Mon Sep 17 00:00:00 2001 From: Vojin Jovanovic Date: Wed, 22 May 2019 19:20:54 +0200 Subject: [PATCH] Remove deprecated GraalVM native-image flags (#9118) Motivation: The first final version of GraalVM was released which deprecated some flags. We should use the new ones. Modifications: Removes the use of deprecated GraalVM native-image flags Adds a flag to initialize netty at build time. Result: Do not use deprecated flags --- .../io.netty/codec-http/native-image.properties | 3 ++- .../io.netty/codec-http2/native-image.properties | 4 ++-- docker/Dockerfile.centos | 3 +++ docker/docker-compose.centos-6.graalvm1.yaml | 2 +- pom.xml | 10 +++++----- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/codec-http/src/main/resources/META-INF/native-image/io.netty/codec-http/native-image.properties b/codec-http/src/main/resources/META-INF/native-image/io.netty/codec-http/native-image.properties index 96e9624e79..74e2af0842 100644 --- a/codec-http/src/main/resources/META-INF/native-image/io.netty/codec-http/native-image.properties +++ b/codec-http/src/main/resources/META-INF/native-image/io.netty/codec-http/native-image.properties @@ -12,4 +12,5 @@ # License for the specific language governing permissions and limitations # under the License. -Args = --delay-class-initialization-to-runtime=io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder +Args = --initialize-at-build-time=io.netty \ + --initialize-at-run-time=io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder diff --git a/codec-http2/src/main/resources/META-INF/native-image/io.netty/codec-http2/native-image.properties b/codec-http2/src/main/resources/META-INF/native-image/io.netty/codec-http2/native-image.properties index 9336d016eb..d8565cf881 100644 --- a/codec-http2/src/main/resources/META-INF/native-image/io.netty/codec-http2/native-image.properties +++ b/codec-http2/src/main/resources/META-INF/native-image/io.netty/codec-http2/native-image.properties @@ -12,5 +12,5 @@ # License for the specific language governing permissions and limitations # under the License. -Args = --rerun-class-initialization-at-runtime=io.netty.handler.codec.http2.Http2CodecUtil \ - --delay-class-initialization-to-runtime=io.netty.handler.codec.http2.DefaultHttp2FrameWriter +Args = --initialize-at-build-time=io.netty \ + --initialize-at-run-time=io.netty.handler.codec.http2.Http2CodecUtil,io.netty.handler.codec.http2.DefaultHttp2FrameWriter diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos index 4d88820902..e6df940e0c 100644 --- a/docker/Dockerfile.centos +++ b/docker/Dockerfile.centos @@ -25,3 +25,6 @@ RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | JABBA_COMMA RUN echo 'export JAVA_HOME="/jdk"' >> ~/.bashrc RUN echo 'PATH=/jdk/bin:$PATH' >> ~/.bashrc + +# when the JDK is GraalVM install native-image +RUN if [ -O /jdk/bin/gu ]; then /jdk/bin/gu install native-image; else echo "Not GraalVM, skip installation of native-image" ; fi diff --git a/docker/docker-compose.centos-6.graalvm1.yaml b/docker/docker-compose.centos-6.graalvm1.yaml index 8a1c5115ea..4d2fce97d6 100644 --- a/docker/docker-compose.centos-6.graalvm1.yaml +++ b/docker/docker-compose.centos-6.graalvm1.yaml @@ -7,7 +7,7 @@ services: build: args: centos_version : "6" - java_version : "graalvm@1.0.0-16" + java_version : "graalvm@19.0.0" test: image: netty:centos-6-1.8 diff --git a/pom.xml b/pom.xml index 34659d2e50..aa0883e825 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ - ${java.home}/bin/native-image + ${java.home}/bin/gu @@ -175,7 +175,7 @@ --illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras} - + true 3.0.0-M1 @@ -310,7 +310,7 @@ false true - 1.0.0-rc15 + 19.0.0 true @@ -446,7 +446,7 @@ true - @@ -915,7 +915,7 @@ ${testJvm} - + false