Skip to content

Commit

Permalink
Upgrade GraalVM to 19.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenneg authored and stuartwdouglas committed Dec 3, 2019
1 parent 3ab024e commit 8e20d02
Show file tree
Hide file tree
Showing 90 changed files with 232 additions and 110 deletions.
6 changes: 3 additions & 3 deletions bom/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<maven-plugin-annotations.version>3.5.2</maven-plugin-annotations.version>
<plexus-component-annotations.version>1.7.1</plexus-component-annotations.version>
<!-- What we actually depend on for the annotations, as latest Graal is not available in Maven fast enough: -->
<graal-sdk.version>19.2.1</graal-sdk.version>
<graal-sdk.version>19.3.0</graal-sdk.version>
<gizmo.version>1.0.0.Final</gizmo.version>
<jackson.version>2.9.10.20191020</jackson.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
Expand Down Expand Up @@ -791,7 +791,7 @@
<version>${jboss-logmanager.version}</version>
<exclusions>
<exclusion>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</exclusion>
<exclusion>
Expand Down Expand Up @@ -1541,7 +1541,7 @@
</dependency>

<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
<version>${graal-sdk.version}</version>
<scope>provided</scope>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- These properties are needed in order for them to be resolvable by the documentation -->
<!-- The Graal version we suggest using in documentation - as that's
what we work with by self downloading it: -->
<graal-sdk.version-for-documentation>19.2.1</graal-sdk.version-for-documentation>
<graal-sdk.version-for-documentation>19.3.0</graal-sdk.version-for-documentation>
<rest-assured.version>4.1.1</rest-assured.version>
<axle-client.version>0.0.9</axle-client.version>
<vertx.version>3.8.4</vertx.version>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class NativeConfig {
/**
* If JNI should be enabled
*/
@ConfigItem(defaultValue = "false")
@ConfigItem(defaultValue = "true")
public boolean enableJni;

/**
Expand Down Expand Up @@ -132,7 +132,7 @@ public class NativeConfig {
/**
* The docker image to use to do the image build
*/
@ConfigItem(defaultValue = "quay.io/quarkus/ubi-quarkus-native-image:19.2.1")
@ConfigItem(defaultValue = "quay.io/quarkus/ubi-quarkus-native-image:19.3.0-java8")
public String builderImage;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa

final String runnerJarName = runnerJar.getFileName().toString();

boolean vmVersionOutOfDate = isThisGraalVMVersionObsolete();
isThisGraalVMVersionObsolete();

HashMap<String, String> env = new HashMap<>(System.getenv());
List<String> nativeImage;
Expand Down Expand Up @@ -178,8 +178,6 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa
command.add("-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime"); //the default collection policy results in full GC's 50% of the time
command.add("-jar");
command.add(runnerJarName);
//https://github.com/oracle/graal/issues/660
command.add("-J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1");
if (nativeConfig.enableFallbackImages) {
command.add("-H:FallbackThreshold=5");
} else {
Expand Down Expand Up @@ -296,16 +294,14 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa
}

//FIXME remove after transition period
private boolean isThisGraalVMVersionObsolete() {
private void isThisGraalVMVersionObsolete() {
final String vmName = System.getProperty("java.vm.name");
log.info("Running Quarkus native-image plugin on " + vmName);
final List<String> obsoleteGraalVmVersions = Arrays.asList("1.0.0", "19.0.", "19.1.", "19.2.0");
final List<String> obsoleteGraalVmVersions = Arrays.asList("1.0.0", "19.0.", "19.1.", "19.2.");
final boolean vmVersionIsObsolete = obsoleteGraalVmVersions.stream().anyMatch(vmName::contains);
if (vmVersionIsObsolete) {
log.error("Out of date build of GraalVM detected! Please upgrade to GraalVM 19.2.1.");
return true;
log.error("Out of date build of GraalVM detected! Please upgrade to GraalVM 19.3.0.");
}
return false;
}

private static File getNativeImageExecutable(Optional<String> graalVmHome, File javaHome, Map<String, String> env) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class NativeImageAutoFeatureStep {
static final String RUNTIME_REFLECTION = RuntimeReflection.class.getName();
static final String BEFORE_ANALYSIS_ACCESS = Feature.BeforeAnalysisAccess.class.getName();
static final String DYNAMIC_PROXY_REGISTRY = "com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry";
static final String LOCALIZATION_SUPPORT = "com.oracle.svm.core.jdk.LocalizationSupport";
static final String LOCALIZATION_FEATURE = "com.oracle.svm.core.jdk.LocalizationFeature";

@BuildStep
List<NativeImageResourceBuildItem> registerPackageResources(
Expand Down Expand Up @@ -205,7 +205,7 @@ public void write(String s, byte[] bytes) {
}

if (!resourceBundles.isEmpty()) {
ResultHandle locClass = overallCatch.loadClass(LOCALIZATION_SUPPORT);
ResultHandle locClass = overallCatch.loadClass(LOCALIZATION_FEATURE);

ResultHandle params = overallCatch.marshalAsArray(Class.class, overallCatch.loadClass(String.class));
ResultHandle registerMethod = overallCatch.invokeVirtualMethod(
Expand Down
2 changes: 1 addition & 1 deletion core/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<artifactId>graal-sdk</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package io.quarkus.runtime.graal;

import java.lang.reflect.Field;
import java.util.Map;
import java.util.function.BooleanSupplier;

import org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.hosted.SecurityServicesFeature;

/**
* @deprecated This class contains a workaround for a NPE that is thrown when a third-party security provider (meaning not one
* from the JDK) is used in Quarkus. A GraalVM issue has been created for it, the fix should be part of GraalVM
* 19.3.1. This class should be removed as soon as we integrate a GraalVM release that includes the fix.<br>
* See https://github.com/oracle/graal/issues/1883 for more details about the bug and the fix.
*/
@Deprecated
@TargetClass(value = SecurityServicesFeature.class, onlyWith = GraalVersion19_3_0.class)
final class Target_com_oracle_svm_hosted_SecurityServicesFeature {

@Substitute
private static Class<?> lambda$getConsParamClassAccessor$0(Map<String, Object> knownEngines, Field consParamClassNameField,
BeforeAnalysisAccess access, java.lang.String serviceType) {
try {
/*
* Access the Provider.knownEngines map and extract the EngineDescription
* corresponding to the serviceType. Note that the map holds EngineDescription(s) of
* only those service types that are shipped in the JDK. From the EngineDescription
* object extract the value of the constructorParameterClassName field then, if the
* class name is not null, get the corresponding Class<?> object and return it.
*/
/* EngineDescription */Object engineDescription = knownEngines.get(serviceType);
/*
* This isn't an engine known to the Provider (which actually means that it isn't
* one that's shipped in the JDK), so we don't have the predetermined knowledge of
* the constructor param class.
*/
if (engineDescription == null) {
return null;
}
String constrParamClassName = (String) consParamClassNameField.get(engineDescription);
if (constrParamClassName != null) {
return access.findClassByName(constrParamClassName);
}
} catch (IllegalAccessException e) {
VMError.shouldNotReachHere(e);
}
return null;

}
}

final class GraalVersion19_3_0 implements BooleanSupplier {
public boolean getAsBoolean() {
final String version = System.getProperty("org.graalvm.version");
return version.startsWith("19.3.");
}
}
2 changes: 1 addition & 1 deletion core/test-extension/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class QuarkusNative extends QuarkusTask {

private boolean enableServer = false;

private boolean enableJni = false;
private boolean enableJni = true;

private boolean autoServiceLoaderRegistration = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class NativeImageMojo extends AbstractMojo {
@Parameter(defaultValue = "false")
private Boolean enableServer;

@Parameter(defaultValue = "false")
@Parameter(defaultValue = "true")
private Boolean enableJni;

@Parameter(defaultValue = "false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
<enableServer>false</enableServer>
<dumpProxies>false</dumpProxies>
<graalvmHome>${graalvmHome}</graalvmHome>
<enableJni>true</enableJni>
<enableAllSecurityServices>true</enableAllSecurityServices>
<enableReports>false</enableReports>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/native-and-ssl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ And build again:

If you check carefully the native executable build options, you can see that the SSL related options are gone:
```
[INFO] [io.quarkus.creator.phase.nativeimage.NativeImagePhase] /opt/graalvm/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dcom.sun.xml.internal.bind.v2.bytecode.ClassTailor.noOptimize=true -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar rest-client-1.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:+PrintAnalysisCallTree -H:EnableURLProtocols=http -H:-SpawnIsolates -H:-JNI --no-server -H:-UseServiceLoaderFeature -H:+StackTrace
[INFO] [io.quarkus.creator.phase.nativeimage.NativeImagePhase] /opt/graalvm/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dcom.sun.xml.internal.bind.v2.bytecode.ClassTailor.noOptimize=true -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar rest-client-1.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:+PrintAnalysisCallTree -H:EnableURLProtocols=http -H:-SpawnIsolates -H:+JNI --no-server -H:-UseServiceLoaderFeature -H:+StackTrace
```

And we end up with:
Expand Down
2 changes: 1 addition & 1 deletion extensions/agroal/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<artifactId>quarkus-narayana-jta</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion extensions/amazon-lambda-http/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<artifactId>quarkus-amazon-lambda-http</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions extensions/amazon-lambda-http/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<artifactId>quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand All @@ -54,4 +54,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 1 addition & 1 deletion extensions/artemis-core/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</dependency>

<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extensions/azure-functions-http/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<artifactId>quarkus-vertx-http-deployment</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extensions/azure-functions-http/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<artifactId>quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion extensions/caffeine/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extensions/elasticsearch-rest-client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<artifactId>quarkus-elytron-security</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion extensions/elytron-security/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<artifactId>quarkus-vertx-http</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion extensions/flyway/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<artifactId>quarkus-narayana-jta</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extensions/hibernate-orm/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<artifactId>jakarta.transaction-api</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion extensions/hibernate-search-elasticsearch/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<artifactId>hibernate-search-mapper-orm</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extensions/hibernate-validator/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extensions/infinispan-client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<artifactId>protostream-processor</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extensions/infinispan-embedded/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit 8e20d02

Please sign in to comment.