Skip to content

Commit

Permalink
Merge pull request #9486 from gsmet/graalvm-20.1.0
Browse files Browse the repository at this point in the history
Upgrade GraalVM to 20.1.0
  • Loading branch information
gsmet authored Jun 2, 2020
2 parents d480dba + edd539f commit 706b857
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:
env:
# Workaround testsuite locale issue
LANG: en_US.UTF-8
NATIVE_TEST_MAVEN_OPTS: "-B --settings .github/mvn-settings.xml --fail-at-end -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:19.3.1-java11 -Dtest-postgresql -Dtest-elasticsearch -Dtest-keycloak -Dtest-amazon-services -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test' -Dtest-mssql -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dnative-image.xmx=5g -Dnative -Dformat.skip install"
NATIVE_TEST_MAVEN_OPTS: "-B --settings .github/mvn-settings.xml --fail-at-end -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:20.1.0-java11 -Dtest-postgresql -Dtest-elasticsearch -Dtest-keycloak -Dtest-amazon-services -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test' -Dtest-mssql -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dnative-image.xmx=5g -Dnative -Dformat.skip install"
JVM_TEST_MAVEN_OPTS: "-e -B --settings .github/mvn-settings.xml -Dtest-postgresql -Dtest-elasticsearch -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test' -Dtest-mssql -Dtest-amazon-services -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dtest-keycloak -Dformat.skip"
DB_USER: hibernate_orm_test
DB_PASSWORD: hibernate_orm_test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/native-cron-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: sudo systemctl stop mysql

- name: Pull docker image
run: docker pull quay.io/quarkus/ubi-quarkus-native-image:19.3.1-java${{ matrix.java }}
run: docker pull quay.io/quarkus/ubi-quarkus-native-image:20.1.0-java${{ matrix.java }}

- name: Set up JDK ${{ matrix.java }}
# Uses sha for added security since tags can be updated
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
run: mvn -B install -DskipTests -DskipITs -Dformat.skip

- name: Run integration tests in native
run: mvn -B --settings .github/mvn-settings.xml verify -f integration-tests/pom.xml --fail-at-end -Dno-format -Ddocker -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:19.3.1-java${{ matrix.java }} -Dtest-postgresql -Dtest-elasticsearch -Dtest-mysql -Dtest-amazon-services -Dtest-vault -Dtest-neo4j -Dtest-keycloak -Dtest-kafka -Dtest-mssql -Dtest-mariadb -Dmariadb.url="jdbc:mariadb://localhost:3308/hibernate_orm_test"
run: mvn -B --settings .github/mvn-settings.xml verify -f integration-tests/pom.xml --fail-at-end -Dno-format -Ddocker -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:20.1.0-java${{ matrix.java }} -Dtest-postgresql -Dtest-elasticsearch -Dtest-mysql -Dtest-amazon-services -Dtest-vault -Dtest-neo4j -Dtest-keycloak -Dtest-kafka -Dtest-mssql -Dtest-mariadb -Dmariadb.url="jdbc:mariadb://localhost:3308/hibernate_orm_test"

- name: Report
if: always()
Expand Down
2 changes: 1 addition & 1 deletion bom/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<maven-plugin-annotations.version>3.6.0</maven-plugin-annotations.version>
<plexus-component-annotations.version>2.1.0</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.3.1</graal-sdk.version>
<graal-sdk.version>20.1.0</graal-sdk.version>
<gizmo.version>1.0.3.Final</gizmo.version>
<jackson.version>2.10.4</jackson.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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.3.1</graal-sdk.version-for-documentation>
<graal-sdk.version-for-documentation>20.1.0</graal-sdk.version-for-documentation>
<rest-assured.version>4.1.1</rest-assured.version>
<axle-client.version>0.0.16</axle-client.version>
<mutiny-client.version>0.0.16</mutiny-client.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public class NativeConfig {
/**
* The docker image to use to do the image build
*/
@ConfigItem(defaultValue = "quay.io/quarkus/ubi-quarkus-native-image:19.3.1-java11")
@ConfigItem(defaultValue = "quay.io/quarkus/ubi-quarkus-native-image:20.1.0-java11")
public String builderImage;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ private RuntimeException imageGenerationFailed(int exitValue, List<String> comma

private void checkGraalVMVersion(String version) {
log.info("Running Quarkus native-image plugin on " + version);
final List<String> obsoleteGraalVmVersions = Arrays.asList("1.0.0", "19.0.", "19.1.", "19.2.", "19.3.0");
final List<String> obsoleteGraalVmVersions = Arrays.asList("1.0.0", "19.0.", "19.1.", "19.2.", "19.3.0", "20.0.");
final boolean vmVersionIsObsolete = obsoleteGraalVmVersions.stream().anyMatch(v -> version.contains(" " + v));
if (vmVersionIsObsolete) {
throw new IllegalStateException("Out of date version of GraalVM detected: " + version + "."
+ " Quarkus currently supports GraalVM 19.3.1 and 20.0.0. Please upgrade GraalVM to one of these versions.");
+ " Quarkus currently supports GraalVM 19.3.2 and 20.1.0. Please upgrade GraalVM to one of these versions.");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.runtime.graal;

import java.io.ObjectStreamClass;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

@TargetClass(java.io.ObjectStreamClass.class)
@SuppressWarnings({ "unused" })
final class Target_java_io_ObjectStreamClass {

@Substitute
private static ObjectStreamClass lookup(Class<?> cl, boolean all) {
throw new UnsupportedOperationException("Serialization of class definitions not supported");
}

private Target_java_io_ObjectStreamClass(final Class<?> cl) {
throw new UnsupportedOperationException("Serialization of class definitions not supported");
}

private Target_java_io_ObjectStreamClass() {
throw new UnsupportedOperationException("Not supported");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
import java.security.PrivilegedAction;
import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.NoInitialContextException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.spi.InitialContextFactory;
import javax.naming.spi.InitialContextFactoryBuilder;
import javax.naming.spi.NamingManager;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
Expand Down Expand Up @@ -107,6 +112,10 @@ private DirContext createDirContext(String securityPrincipal, char[] securityCre
InitialLdapContext initialContext;

try {
if (!NamingManager.hasInitialContextFactoryBuilder()) {
NamingManager.setInitialContextFactoryBuilder(new QuarkusInitialContextFactoryBuilder());
}

initialContext = new InitialLdapContext(env, null);
} catch (NamingException ne) {
// log.debugf(ne, "Could not create [%s]. Failed to connect to LDAP server.", InitialLdapContext.class);
Expand Down Expand Up @@ -148,4 +157,19 @@ private static <T> T doPrivileged(final PrivilegedAction<T> action) {
return System.getSecurityManager() != null ? AccessController.doPrivileged(action) : action.run();
}

private static final class QuarkusInitialContextFactoryBuilder implements InitialContextFactoryBuilder {
@Override
public InitialContextFactory createInitialContextFactory(Hashtable<?, ?> environment) throws NamingException {
final String className = (String) environment.get(Context.INITIAL_CONTEXT_FACTORY);
try {
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
return (InitialContextFactory) Class.forName(className, true, cl).newInstance();
} catch (Exception e) {
NoInitialContextException ne = new NoInitialContextException(
"Cannot instantiate class: " + className);
ne.setRootCause(e);
throw ne;
}
}
}
}
2 changes: 1 addition & 1 deletion independent-projects/bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<asm.version>7.3.1</asm.version>
<shrinkwrap-depchain.version>1.2.6</shrinkwrap-depchain.version>
<jboss-logmanager-embedded.version>1.0.4</jboss-logmanager-embedded.version>
<graal-sdk.version>19.3.1</graal-sdk.version>
<graal-sdk.version>20.1.0</graal-sdk.version>
<plexus-classworlds.version>2.6.0</plexus-classworlds.version> <!-- not actually used but ClassRealm class is referenced from the API used in BootstrapWagonConfigurator -->
</properties>
<modules>
Expand Down

0 comments on commit 706b857

Please sign in to comment.