Skip to content

Commit

Permalink
Merge branch 'main' into downstreamcontrolscript
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen authored Jan 15, 2024
2 parents 865a882 + 15bf7c1 commit 6067c4d
Show file tree
Hide file tree
Showing 304 changed files with 8,473 additions and 1,326 deletions.
11 changes: 11 additions & 0 deletions .mvn/gradle-enterprise-custom-user-data.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ if(session?.getRequest()?.getBaseDirectory() != null) {
if(!publish) {
// do not publish a build scan for test builds
log.debug("Disabling build scan publication for " + session.getRequest().getBaseDirectory())

// change storage location on CI to avoid Develocity scan dumps with disabled publication to be captured for republication
if (System.env.GITHUB_ACTIONS) {
try {
def storageLocationTmpDir = java.nio.file.Files.createTempDirectory(java.nio.file.Paths.get(System.env.RUNNER_TEMP), "buildScanTmp").toAbsolutePath()
log.debug('Update storage location to ' + storageLocationTmpDir)
gradleEnterprise.setStorageDirectory(storageLocationTmpDir)
} catch (IOException e) {
log.error('Temporary storage location directory cannot be created, the Build Scan will be published', e)
}
}
}
}
buildScan.publishAlwaysIf(publish)
Expand Down
20 changes: 10 additions & 10 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<opentelemetry-alpha.version>1.32.0-alpha</opentelemetry-alpha.version>
<opentelemetry-semconv.version>1.21.0-alpha</opentelemetry-semconv.version> <!-- keep in sync with opentelemetry-java-instrumentation in the alpha bom-->
<quarkus-http.version>5.1.0.Final</quarkus-http.version>
<micrometer.version>1.11.5</micrometer.version><!-- keep in sync with hdrhistogram -->
<micrometer.version>1.12.2</micrometer.version><!-- keep in sync with hdrhistogram -->
<hdrhistogram.version>2.1.12</hdrhistogram.version><!-- keep in sync with micrometer -->
<google-auth.version>0.22.0</google-auth.version>
<graphql-java.version>21.1</graphql-java.version> <!-- keep in sync with smallrye-graphql -->
Expand All @@ -51,18 +51,18 @@
<microprofile-lra.version>2.0</microprofile-lra.version>
<microprofile-openapi.version>3.1.1</microprofile-openapi.version>
<smallrye-common.version>2.2.0</smallrye-common.version>
<smallrye-config.version>3.5.1</smallrye-config.version>
<smallrye-health.version>4.0.4</smallrye-health.version>
<smallrye-config.version>3.5.2</smallrye-config.version>
<smallrye-health.version>4.1.0</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.8.0</smallrye-open-api.version>
<smallrye-graphql.version>2.6.1</smallrye-graphql.version>
<smallrye-graphql.version>2.7.0</smallrye-graphql.version>
<smallrye-fault-tolerance.version>6.2.6</smallrye-fault-tolerance.version>
<smallrye-jwt.version>4.4.0</smallrye-jwt.version>
<smallrye-context-propagation.version>2.1.0</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-reactive-types-converter.version>3.0.1</smallrye-reactive-types-converter.version>
<smallrye-mutiny-vertx-binding.version>3.8.0</smallrye-mutiny-vertx-binding.version>
<smallrye-reactive-messaging.version>4.14.0</smallrye-reactive-messaging.version>
<smallrye-reactive-messaging.version>4.15.0</smallrye-reactive-messaging.version>
<smallrye-stork.version>2.5.0</smallrye-stork.version>
<jakarta.activation.version>2.1.2</jakarta.activation.version>
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
Expand Down Expand Up @@ -100,17 +100,17 @@
bytebuddy.version (just below), hibernate-orm.version-for-documentation (in docs/pom.xml)
and both hibernate-orm.version and antlr.version in build-parent/pom.xml
WARNING again for diffs that don't provide enough context: when updating, see above -->
<hibernate-orm.version>6.4.0.Final</hibernate-orm.version>
<hibernate-orm.version>6.4.1.Final</hibernate-orm.version>
<bytebuddy.version>1.14.7</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.2.0.Final</hibernate-reactive.version>
<hibernate-reactive.version>2.2.1.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<!-- When updating, align hibernate-search.version-for-documentation in docs/pom.xml -->
<hibernate-search.version>7.0.0.Final</hibernate-search.version>
<narayana.version>7.0.0.Final</narayana.version>
<agroal.version>2.1</agroal.version>
<jboss-transaction-spi.version>8.0.0.Final</jboss-transaction-spi.version>
<elasticsearch-opensource-components.version>8.11.1</elasticsearch-opensource-components.version>
<elasticsearch-opensource-components.version>8.11.3</elasticsearch-opensource-components.version>
<rxjava.version>2.2.21</rxjava.version>
<wildfly.openssl-java.version>2.2.5.Final</wildfly.openssl-java.version>
<wildfly.openssl-linux.version>2.2.2.Final</wildfly.openssl-linux.version>
Expand Down Expand Up @@ -202,10 +202,10 @@
<commons-text.version>1.11.0</commons-text.version>
<gson.version>2.10.1</gson.version>
<log4j2-jboss-logmanager.version>1.1.2.Final</log4j2-jboss-logmanager.version>
<log4j2-api.version>2.22.0</log4j2-api.version>
<log4j2-api.version>2.22.1</log4j2-api.version>
<log4j-jboss-logmanager.version>1.3.0.Final</log4j-jboss-logmanager.version>
<avro.version>1.11.3</avro.version>
<apicurio-registry.version>2.5.7.Final</apicurio-registry.version>
<apicurio-registry.version>2.5.8.Final</apicurio-registry.version>
<apicurio-common-rest-client.version>0.1.18.Final</apicurio-common-rest-client.version> <!-- must be the version Apicurio Registry uses -->
<testcontainers.version>1.19.3</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
<docker-java.version>3.3.4</docker-java.version> <!-- must be the version Testcontainers use -->
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

<unboundid-ldap.version>6.0.11</unboundid-ldap.version>

<assertj.version>3.24.2</assertj.version>
<assertj.version>3.25.1</assertj.version>

<wiremock.version>3.3.1</wiremock.version>
<wiremock-maven-plugin.version>7.3.0</wiremock-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ public static BuiltInType fromString(String value) {
@ConfigItem(defaultValue = "jar")
public String type;

/**
* Whether the created jar will be compressed. This setting is not used when building a native image
*/
@ConfigItem
@ConfigDocDefault("false")
public Optional<Boolean> compressJar;

/**
* Manifest configuration of the runner jar.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ static final class VersionParseHelper {
private static final String JVMCI_BUILD_PREFIX = "jvmci-";
private static final String MANDREL_VERS_PREFIX = "Mandrel-";

private static final String LIBERICA_NIK_VERS_PREFIX = "Liberica-NIK-";

// Java version info (suitable for Runtime.Version.parse()). See java.lang.VersionProps
private static final String VNUM = "(?<VNUM>[1-9][0-9]*(?:(?:\\.0)*\\.[1-9][0-9]*)*)";
private static final String PRE = "(?:-(?<PRE>[a-zA-Z0-9]+))?";
Expand Down Expand Up @@ -68,19 +70,47 @@ static Version parse(List<String> lines) {
if (vendorVersion.contains("-dev")) {
graalVersion = graalVersion + "-dev";
}
String mandrelVersion = mandrelVersion(vendorVersion);
Distribution dist = isMandrel(vendorVersion) ? Distribution.MANDREL : Distribution.GRAALVM;
String versNum = (dist == Distribution.MANDREL ? mandrelVersion : graalVersion);
String versNum;
Distribution dist;
if (isMandrel(vendorVersion)) {
dist = Distribution.MANDREL;
versNum = mandrelVersion(vendorVersion);
} else if (isLiberica(vendorVersion)) {
dist = Distribution.LIBERICA;
versNum = libericaVersion(vendorVersion);
} else {
dist = Distribution.GRAALVM;
versNum = graalVersion;
}
if (versNum == null) {
return UNKNOWN_VERSION;
}
return new Version(lines.stream().collect(Collectors.joining("\n")),
return new Version(String.join("\n", lines),
versNum, v, dist);
} else {
return UNKNOWN_VERSION;
}
}

private static boolean isLiberica(String vendorVersion) {
if (vendorVersion == null) {
return false;
}
return !vendorVersion.isBlank() && vendorVersion.startsWith(LIBERICA_NIK_VERS_PREFIX);
}

private static String libericaVersion(String vendorVersion) {
if (vendorVersion == null) {
return null;
}
int idx = vendorVersion.indexOf(LIBERICA_NIK_VERS_PREFIX);
if (idx < 0) {
return null;
}
String version = vendorVersion.substring(idx + LIBERICA_NIK_VERS_PREFIX.length());
return matchVersion(version);
}

private static boolean isMandrel(String vendorVersion) {
if (vendorVersion == null) {
return false;
Expand Down Expand Up @@ -244,7 +274,7 @@ public static Version of(Stream<String> output) {
String stringOutput = output.collect(Collectors.joining("\n"));
List<String> lines = stringOutput.lines()
.dropWhile(l -> !l.startsWith("GraalVM") && !l.startsWith("native-image"))
.collect(Collectors.toUnmodifiableList());
.toList();

if (lines.size() == 3) {
// Attempt to parse the new 3-line version scheme first.
Expand Down Expand Up @@ -322,6 +352,7 @@ public boolean isJava17() {

enum Distribution {
GRAALVM,
LIBERICA,
MANDREL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ private void buildUberJar0(CurateOutcomeBuildItem curateOutcomeBuildItem,
MainClassBuildItem mainClassBuildItem,
ClassLoadingConfig classLoadingConfig,
Path runnerJar) throws Exception {
try (FileSystem runnerZipFs = ZipUtils.newZip(runnerJar)) {
try (FileSystem runnerZipFs = createNewZip(runnerJar, packageConfig)) {

log.info("Building uber jar: " + runnerJar);

Expand Down Expand Up @@ -530,7 +530,7 @@ private JarBuildItem buildLegacyThinJar(CurateOutcomeBuildItem curateOutcomeBuil
Files.deleteIfExists(runnerJar);
IoUtils.createOrEmptyDir(libDir);

try (FileSystem runnerZipFs = ZipUtils.newZip(runnerJar)) {
try (FileSystem runnerZipFs = createNewZip(runnerJar, packageConfig)) {

log.info("Building thin jar: " + runnerJar);

Expand Down Expand Up @@ -629,7 +629,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
if (!transformedClasses.getTransformedClassesByJar().isEmpty()) {
Path transformedZip = quarkus.resolve(TRANSFORMED_BYTECODE_JAR);
fastJarJarsBuilder.setTransformed(transformedZip);
try (FileSystem out = ZipUtils.newZip(transformedZip)) {
try (FileSystem out = createNewZip(transformedZip, packageConfig)) {
for (Set<TransformedClassesBuildItem.TransformedClass> transformedSet : transformedClasses
.getTransformedClassesByJar().values()) {
for (TransformedClassesBuildItem.TransformedClass transformed : transformedSet) {
Expand All @@ -650,7 +650,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
//now generated classes and resources
Path generatedZip = quarkus.resolve(GENERATED_BYTECODE_JAR);
fastJarJarsBuilder.setGenerated(generatedZip);
try (FileSystem out = ZipUtils.newZip(generatedZip)) {
try (FileSystem out = createNewZip(generatedZip, packageConfig)) {
for (GeneratedClassBuildItem i : generatedClasses) {
String fileName = i.getName().replace('.', '/') + ".class";
Path target = out.getPath(fileName);
Expand Down Expand Up @@ -683,7 +683,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
if (!rebuild) {
Predicate<String> ignoredEntriesPredicate = getThinJarIgnoredEntriesPredicate(packageConfig);

try (FileSystem runnerZipFs = ZipUtils.newZip(runnerJar)) {
try (FileSystem runnerZipFs = createNewZip(runnerJar, packageConfig)) {
copyFiles(applicationArchivesBuildItem.getRootArchive(), runnerZipFs, null, ignoredEntriesPredicate);
}
}
Expand All @@ -695,7 +695,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
if (!rebuild) {
copyDependency(parentFirstKeys, outputTargetBuildItem, copiedArtifacts, mainLib, baseLib,
fastJarJarsBuilder::addDep, true,
classPath, appDep, transformedClasses, removed);
classPath, appDep, transformedClasses, removed, packageConfig);
} else if (includeAppDep(appDep, outputTargetBuildItem.getIncludedOptionalDependencies(), removed)) {
appDep.getResolvedPaths().forEach(fastJarJarsBuilder::addDep);
}
Expand Down Expand Up @@ -768,7 +768,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
}
}
if (!rebuild) {
try (FileSystem runnerZipFs = ZipUtils.newZip(initJar)) {
try (FileSystem runnerZipFs = createNewZip(initJar, packageConfig)) {
ResolvedDependency appArtifact = curateOutcomeBuildItem.getApplicationModel().getAppArtifact();
generateManifest(runnerZipFs, classPath.toString(), packageConfig, appArtifact,
QuarkusEntryPoint.class.getName(),
Expand All @@ -783,7 +783,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
copyDependency(parentFirstKeys, outputTargetBuildItem, copiedArtifacts, deploymentLib, baseLib, (p) -> {
},
false, classPath,
appDep, new TransformedClassesBuildItem(Map.of()), removed); //we don't care about transformation here, so just pass in an empty item
appDep, new TransformedClassesBuildItem(Map.of()), removed, packageConfig); //we don't care about transformation here, so just pass in an empty item
}
Map<ArtifactKey, List<String>> relativePaths = new HashMap<>();
for (Map.Entry<ArtifactKey, List<Path>> e : copiedArtifacts.entrySet()) {
Expand Down Expand Up @@ -884,7 +884,8 @@ private Set<ArtifactKey> getRemovedKeys(ClassLoadingConfig classLoadingConfig) {
private void copyDependency(Set<ArtifactKey> parentFirstArtifacts, OutputTargetBuildItem outputTargetBuildItem,
Map<ArtifactKey, List<Path>> runtimeArtifacts, Path libDir, Path baseLib, Consumer<Path> targetPathConsumer,
boolean allowParentFirst, StringBuilder classPath, ResolvedDependency appDep,
TransformedClassesBuildItem transformedClasses, Set<ArtifactKey> removedDeps)
TransformedClassesBuildItem transformedClasses, Set<ArtifactKey> removedDeps,
PackageConfig packageConfig)
throws IOException {

// Exclude files that are not jars (typically, we can have XML files here, see https://github.com/quarkusio/quarkus/issues/2852)
Expand Down Expand Up @@ -912,7 +913,7 @@ private void copyDependency(Set<ArtifactKey> parentFirstArtifacts, OutputTargetB
// This case can happen when we are building a jar from inside the Quarkus repository
// and Quarkus Bootstrap's localProjectDiscovery has been set to true. In such a case
// the non-jar dependencies are the Quarkus dependencies picked up on the file system
packageClasses(resolvedDep, targetPath);
packageClasses(resolvedDep, targetPath, packageConfig);
} else {
Set<TransformedClassesBuildItem.TransformedClass> transformedFromThisArchive = transformedClasses
.getTransformedClassesByJar().get(resolvedDep);
Expand All @@ -934,8 +935,8 @@ private void copyDependency(Set<ArtifactKey> parentFirstArtifacts, OutputTargetB
}
}

private void packageClasses(Path resolvedDep, final Path targetPath) throws IOException {
try (FileSystem runnerZipFs = ZipUtils.newZip(targetPath)) {
private void packageClasses(Path resolvedDep, final Path targetPath, PackageConfig packageConfig) throws IOException {
try (FileSystem runnerZipFs = createNewZip(targetPath, packageConfig)) {
Files.walkFileTree(resolvedDep, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE,
new SimpleFileVisitor<Path>() {
@Override
Expand Down Expand Up @@ -1649,4 +1650,12 @@ public boolean decompile(Path jarToDecompile) {
}
}

private static FileSystem createNewZip(Path runnerJar, PackageConfig config) throws IOException {
boolean useUncompressedJar = config.compressJar.map(o -> !o).orElse(false);
if (useUncompressedJar) {
return ZipUtils.newZip(runnerJar, Map.of("compressionMethod", "STORED"));
}
return ZipUtils.newZip(runnerJar);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
package io.quarkus.deployment.recording;

import java.lang.reflect.Method;
import java.lang.reflect.RecordComponent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand All @@ -19,6 +21,12 @@ final class PropertyUtils {
private static final Function<Class<?>, Property[]> FUNCTION = new Function<Class<?>, Property[]>() {
@Override
public Property[] apply(Class<?> type) {
if (type.isRecord()) {
RecordComponent[] recordComponents = type.getRecordComponents();
return Arrays.stream(recordComponents)
.map(rc -> new Property(rc.getName(), rc.getAccessor(), null, rc.getType())).toArray(Property[]::new);
}

List<Property> ret = new ArrayList<>();
Method[] methods = type.getMethods();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ static void assertVersion(Version graalVmVersion, Distribution distro, Version v
}
}

@Test
public void testGraalVM21LibericaVersionParser() {
Version graalVM21Dev = Version.of(Stream.of(("native-image 21.0.1 2023-10-17\n"
+ "GraalVM Runtime Environment Liberica-NIK-23.1.1-1 (build 21.0.1+12-LTS)\n"
+ "Substrate VM Liberica-NIK-23.1.1-1 (build 21.0.1+12-LTS, serial gc)").split("\\n")));
assertThat(graalVM21Dev.distribution.name()).isEqualTo("LIBERICA");
assertThat(graalVM21Dev.getVersionAsString()).isEqualTo("23.1.1");
assertThat(graalVM21Dev.javaVersion.toString()).isEqualTo("21.0.1+12-LTS");
assertThat(graalVM21Dev.javaVersion.feature()).isEqualTo(21);
assertThat(graalVM21Dev.javaVersion.update()).isEqualTo(1);
}

@Test
public void testGraalVM21VersionParser() {
Version graalVM21Dev = Version.of(Stream.of(("native-image 21 2023-09-19\n"
Expand Down
Loading

0 comments on commit 6067c4d

Please sign in to comment.