Skip to content

Commit

Permalink
Merge pull request #39965 from gsmet/3.9.3-backports-1
Browse files Browse the repository at this point in the history
3.9.3 backports 1
gsmet authored Apr 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 7d4d8e1 + 8be2978 commit 1337c28
Showing 79 changed files with 560 additions and 233 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
@@ -832,8 +832,7 @@ jobs:
env:
CAPTURE_BUILD_SCAN: true
run: |
git clone https://github.com/quarkusio/quarkus-quickstarts.git && cd quarkus-quickstarts
git checkout development
git clone -b 3.9 https://github.com/quarkusio/quarkus-quickstarts.git && cd quarkus-quickstarts
export LANG=en_US && ./mvnw -e -B -fae --settings .github/mvn-settings.xml clean verify -DskipTests
- name: Prepare build reports archive
if: always()
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -41,4 +41,5 @@ nb-configuration.xml
.envrc
.jekyll-cache
.mvn/.gradle-enterprise
.mvn/.develocity
.quarkus
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@
<smallrye-health.version>4.1.0</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.10.0</smallrye-open-api.version>
<smallrye-graphql.version>2.8.1</smallrye-graphql.version>
<smallrye-graphql.version>2.8.2</smallrye-graphql.version>
<smallrye-fault-tolerance.version>6.2.6</smallrye-fault-tolerance.version>
<smallrye-jwt.version>4.5.0</smallrye-jwt.version>
<smallrye-context-propagation.version>2.1.0</smallrye-context-propagation.version>
@@ -92,7 +92,7 @@
<!-- GraalVM sdk 23.1.2 has a minimum JDK requirement of 17+ at runtime -->
<graal-sdk.version>23.1.2</graal-sdk.version>
<gizmo.version>1.8.0</gizmo.version>
<jackson-bom.version>2.16.1</jackson-bom.version>
<jackson-bom.version>2.17.0</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-codec.version>1.16.1</commons-codec.version>
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@

<!-- These 2 properties are used in catalog-overrides.json -->
<minimum-java-version>${maven.compiler.release}</minimum-java-version>
<recommended-java-version>17</recommended-java-version>
<recommended-java-version>21</recommended-java-version>

<!--
Supported Maven versions, interpreted as a version range (Also defined in quarkus-enforcer-rules)
Original file line number Diff line number Diff line change
@@ -181,13 +181,25 @@ public static final class Version implements Comparable<Version> {
static final Version VERSION_21_3 = new Version("GraalVM 21.3", "21.3", Distribution.GRAALVM);
static final Version VERSION_21_3_0 = new Version("GraalVM 21.3.0", "21.3.0", Distribution.GRAALVM);
public static final Version VERSION_22_3_0 = new Version("GraalVM 22.3.0", "22.3.0", "17", Distribution.GRAALVM);
public static final Version VERSION_22_2_0 = new Version("GraalVM 22.2.0", "22.2.0", "17", Distribution.GRAALVM);
public static final Version VERSION_23_0_0 = new Version("GraalVM 23.0.0", "23.0.0", "17", Distribution.GRAALVM);
public static final Version VERSION_23_1_0 = new Version("GraalVM 23.1.0", "23.1.0", "21", Distribution.GRAALVM);
public static final Version VERSION_24_0_0 = new Version("GraalVM 24.0.0", "24.0.0", "22", Distribution.GRAALVM);

public static final Version MINIMUM = VERSION_22_2_0;
/**
* The minimum version of GraalVM supported by Quarkus.
* Versions prior to this are expected to cause major issues.
*/
public static final Version MINIMUM = VERSION_22_3_0;
/**
* The current version of GraalVM supported by Quarkus.
* This version is the one actively being tested and is expected to give the best experience.
*/
public static final Version CURRENT = VERSION_23_1_0;
/**
* The minimum version of GraalVM officially supported by Quarkus.
* Versions prior to this are expected to work but are not given the same level of testing or priority.
*/
public static final Version MINIMUM_SUPPORTED = CURRENT;

final String fullVersion;
public final Runtime.Version javaVersion;
@@ -227,6 +239,10 @@ boolean isObsolete() {
return this.compareTo(MINIMUM) < 0;
}

boolean isSupported() {
return this.compareTo(MINIMUM_SUPPORTED) >= 0;
}

boolean isMandrel() {
return distribution == Distribution.MANDREL;
}
Original file line number Diff line number Diff line change
@@ -473,9 +473,15 @@ private void checkGraalVMVersion(GraalVM.Version version) {
log.info("Running Quarkus native-image plugin on " + version.distribution.name() + " " + version.getVersionAsString()
+ " JDK " + version.javaVersion);
if (version.isObsolete()) {
throw new IllegalStateException("Out of date version of GraalVM detected: " + version.getVersionAsString() + "."
throw new IllegalStateException(
"Out of date version of GraalVM or Mandrel detected: " + version.getVersionAsString() + "."
+ " Quarkus currently supports " + GraalVM.Version.CURRENT.getVersionAsString()
+ ". Please upgrade to this version.");
}
if (!version.isSupported()) {
log.warn("You are using an older version of GraalVM or Mandrel : " + version.getVersionAsString() + "."
+ " Quarkus currently supports " + GraalVM.Version.CURRENT.getVersionAsString()
+ ". Please upgrade GraalVM to this version.");
+ ". Please upgrade to this version.");
}
}

Original file line number Diff line number Diff line change
@@ -78,28 +78,6 @@ public void write(String s, byte[] bytes) {
MethodCreator beforeAn = file.getMethodCreator("beforeAnalysis", "V", BEFORE_ANALYSIS_ACCESS);
TryBlock overallCatch = beforeAn.tryBlock();

ResultHandle beforeAnalysisParam = beforeAn.getMethodParam(0);

MethodCreator registerAsUnsafeAccessed = file
.getMethodCreator("registerAsUnsafeAccessed", void.class, Feature.BeforeAnalysisAccess.class)
.setModifiers(Modifier.PRIVATE | Modifier.STATIC);
for (UnsafeAccessedFieldBuildItem unsafeAccessedField : unsafeAccessedFields) {
TryBlock tc = registerAsUnsafeAccessed.tryBlock();
ResultHandle declaringClassHandle = tc.invokeStaticMethod(
ofMethod(Class.class, "forName", Class.class, String.class),
tc.load(unsafeAccessedField.getDeclaringClass()));
ResultHandle fieldHandle = tc.invokeVirtualMethod(
ofMethod(Class.class, "getDeclaredField", Field.class, String.class), declaringClassHandle,
tc.load(unsafeAccessedField.getFieldName()));
tc.invokeInterfaceMethod(
ofMethod(Feature.BeforeAnalysisAccess.class, "registerAsUnsafeAccessed", void.class, Field.class),
registerAsUnsafeAccessed.getMethodParam(0), fieldHandle);
CatchBlockCreator cc = tc.addCatch(Throwable.class);
cc.invokeVirtualMethod(ofMethod(Throwable.class, "printStackTrace", void.class), cc.getCaughtException());
}
registerAsUnsafeAccessed.returnVoid();
overallCatch.invokeStaticMethod(registerAsUnsafeAccessed.getMethodDescriptor(), beforeAnalysisParam);

overallCatch.invokeStaticMethod(BUILD_TIME_INITIALIZATION,
overallCatch.marshalAsArray(String.class, overallCatch.load(""))); // empty string means initialize everything

@@ -179,6 +157,35 @@ public void write(String s, byte[] bytes) {
overallCatch.invokeStaticMethod(runtimeReinitializedClasses.getMethodDescriptor());
}

// Ensure registration of fields being accessed through unsafe is done last to ensure that the class
// initialization configuration is done first. Registering the fields before configuring class initialization
// may results in classes being marked for runtime initialization even if not explicitly requested.
if (!unsafeAccessedFields.isEmpty()) {
ResultHandle beforeAnalysisParam = beforeAn.getMethodParam(0);
MethodCreator registerAsUnsafeAccessed = file
.getMethodCreator("registerAsUnsafeAccessed", void.class, Feature.BeforeAnalysisAccess.class)
.setModifiers(Modifier.PRIVATE | Modifier.STATIC);
ResultHandle thisClass = registerAsUnsafeAccessed.loadClassFromTCCL(GRAAL_FEATURE);
ResultHandle cl = registerAsUnsafeAccessed
.invokeVirtualMethod(ofMethod(Class.class, "getClassLoader", ClassLoader.class), thisClass);
for (UnsafeAccessedFieldBuildItem unsafeAccessedField : unsafeAccessedFields) {
TryBlock tc = registerAsUnsafeAccessed.tryBlock();
ResultHandle declaringClassHandle = tc.invokeStaticMethod(
ofMethod(Class.class, "forName", Class.class, String.class, boolean.class, ClassLoader.class),
tc.load(unsafeAccessedField.getDeclaringClass()), tc.load(false), cl);
ResultHandle fieldHandle = tc.invokeVirtualMethod(
ofMethod(Class.class, "getDeclaredField", Field.class, String.class), declaringClassHandle,
tc.load(unsafeAccessedField.getFieldName()));
tc.invokeInterfaceMethod(
ofMethod(Feature.BeforeAnalysisAccess.class, "registerAsUnsafeAccessed", void.class, Field.class),
registerAsUnsafeAccessed.getMethodParam(0), fieldHandle);
CatchBlockCreator cc = tc.addCatch(Throwable.class);
cc.invokeVirtualMethod(ofMethod(Throwable.class, "printStackTrace", void.class), cc.getCaughtException());
}
registerAsUnsafeAccessed.returnVoid();
overallCatch.invokeStaticMethod(registerAsUnsafeAccessed.getMethodDescriptor(), beforeAnalysisParam);
}

CatchBlockCreator print = overallCatch.addCatch(Throwable.class);
print.invokeVirtualMethod(ofMethod(Throwable.class, "printStackTrace", void.class), print.getCaughtException());

4 changes: 4 additions & 0 deletions core/runtime/pom.xml
Original file line number Diff line number Diff line change
@@ -160,6 +160,7 @@
<!-- support for GraalVM js -->
<parentFirstArtifact>org.graalvm.polyglot:js-community</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.js:js-language</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.js:js-scriptengine</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.polyglot:js</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.polyglot:polyglot</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.regex:regex</parentFirstArtifact>
@@ -170,6 +171,7 @@
<parentFirstArtifact>org.graalvm.shadowed:icu4j</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.sdk:jniutils</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.sdk:word</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.sdk:collections</parentFirstArtifact>
<parentFirstArtifact>org.graalvm.sdk:native-bridge</parentFirstArtifact>
<!-- /support for GraalVM js -->
<parentFirstArtifact>io.quarkus:quarkus-bootstrap-core</parentFirstArtifact>
@@ -220,6 +222,7 @@
<!-- support for GraalVM js -->
<runnerParentFirstArtifact>org.graalvm.polyglot:js-community</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.js:js-language</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.js:js-scriptengine</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.polyglot:js</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.polyglot:polyglot</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.regex:regex</runnerParentFirstArtifact>
@@ -230,6 +233,7 @@
<runnerParentFirstArtifact>org.graalvm.shadowed:icu4j</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.sdk:jniutils</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.sdk:word</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.sdk:collections</runnerParentFirstArtifact>
<runnerParentFirstArtifact>org.graalvm.sdk:native-bridge</runnerParentFirstArtifact>
<!-- /support for GraalVM js -->
<runnerParentFirstArtifact>io.quarkus:quarkus-bootstrap-runner</runnerParentFirstArtifact>
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ public class UpdateMojo extends QuarkusProjectStateMojoBase {

/**
* Version of the target platform (e.g: 2.0.0.Final)
* You may instead use streamId to target the latest version of a specific platform stream.
* You may instead use stream to target the latest version of a specific platform stream.
*/
@Parameter(property = "platformVersion", required = false)
private String platformVersion;
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/config-reference.adoc
Original file line number Diff line number Diff line change
@@ -341,6 +341,7 @@ With the `dev` profile enabled, the property `bar` has the value `hallo`, but th
`bonjour`. If the `prod` profile is enabled, `bar` has the value `hello` (as there is no specific value for the `prod`
profile), and `baz` the value `bonjour`.

[[default-profiles]]
=== Default Profiles

By default, Quarkus provides three profiles, that activate automatically in certain conditions:
Loading

0 comments on commit 1337c28

Please sign in to comment.