Skip to content

Commit

Permalink
Merge pull request #5358 from gwenneg/issue-4218-upgrade-graalvm-to-1…
Browse files Browse the repository at this point in the history
…9.3.0

Upgrade GraalVM to 19.3.0
  • Loading branch information
gwenneg authored Dec 5, 2019
2 parents 64d8612 + 85d8746 commit 0be78a6
Show file tree
Hide file tree
Showing 89 changed files with 145 additions and 112 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 @@ -796,7 +796,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 @@ -1546,7 +1546,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
2 changes: 1 addition & 1 deletion ci-templates/stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ stages:
parameters:
poolSettings: ${{parameters.poolSettings}}
expectUseVMs: ${{parameters.expectUseVMs}}
timeoutInMinutes: 25
timeoutInMinutes: 35
modules:
- kogito
- kubernetes-client
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ SecurityDomainBuildItem build(ElytronRecorder recorder, List<SecurityRealmBuildI
return null;
}

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
public void registerPasswordProvider(ElytronRecorder recorder) {
recorder.registerPasswordProvider();
}

@BuildStep
@Record(ExecutionTime.STATIC_INIT)
void identityManager(ElytronRecorder recorder, SecurityDomainBuildItem securityDomain, BeanContainerBuildItem bc) {
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ public void addRealm(RuntimeValue<SecurityDomain.Builder> builder, String realmN
* @return the security domain runtime value
*/
public RuntimeValue<SecurityDomain> buildDomain(RuntimeValue<SecurityDomain.Builder> builder) {
Security.addProvider(new WildFlyElytronPasswordProvider());
return new RuntimeValue<>(builder.getValue().build());
}

/**
* As of Graal 19.3.0 this has to be registered at runtime, due to a bug.
*
* 19.3.1 should fix this, see https://github.com/oracle/graal/issues/1883
*/
public void registerPasswordProvider() {
Security.addProvider(new WildFlyElytronPasswordProvider());
}
}
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
2 changes: 1 addition & 1 deletion extensions/jaeger/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<artifactId>jaeger-thrift</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/jaxb/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<description>XML serialization support</description>
<dependencies>
<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/jdbc/jdbc-derby/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<artifactId>derbyclient</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit 0be78a6

Please sign in to comment.