From 63565c737c3b162722d8557493e4263e9c346835 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 10:06:45 +0000 Subject: [PATCH 01/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 7 ++++++- .../platform-specific-configurations/alpine-linux.sh | 9 +++++++-- build-farm/platform-specific-configurations/linux.sh | 10 ++++++++-- build-farm/platform-specific-configurations/mac.sh | 5 +++++ build-farm/platform-specific-configurations/windows.sh | 5 +++++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index 2babd73a5..27f62fc2b 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -59,7 +59,12 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread" fi -export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin jdk-21+ uses "bundled" FreeType + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" +else + export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" +fi if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then export LDR_CNTRL=MAXDATA=0x80000000 diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index 5aee36e90..24709bc12 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -28,8 +28,13 @@ fi # ccache seems flaky on alpine export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache" -# We don't bundle freetype on alpine anymore, and expect the user to have it. -export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin jdk-21+ uses "bundled" FreeType + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" +else + # We don't bundle freetype on alpine anymore, and expect the user to have it. + export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" +fi BOOT_JDK_VARIABLE="JDK${JDK_BOOT_VERSION}_BOOT_DIR" if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index 3fea89ac3..c82b6861e 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -18,8 +18,14 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=sbin/common/constants.sh source "$SCRIPT_DIR/../../sbin/common/constants.sh" -# Bundling our own freetype can cause problems, so we skip that on linux. -export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" + +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin jdk-21+ uses "bundled" FreeType + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" +else + # Bundling our own freetype can cause problems, so we skip that on linux. + export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" +fi NATIVE_API_ARCH=$(uname -m) if [ "${NATIVE_API_ARCH}" = "x86_64" ]; then NATIVE_API_ARCH=x64; fi diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index e99a06366..d84ec3921 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -68,6 +68,11 @@ else fi fi +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin jdk-21+ uses "bundled" FreeType + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" +fi + # The configure option '--with-macosx-codesign-identity' is supported in JDK8 OpenJ9 and JDK11 and JDK14+ if [[ ( "$JAVA_FEATURE_VERSION" -eq 11 ) || ( "$JAVA_FEATURE_VERSION" -ge 14 ) ]] then diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index e41514035..a12e0e071 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -231,6 +231,11 @@ then fi fi +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin jdk-21+ uses "bundled" FreeType + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" +fi + if [ "${ARCHITECTURE}" == "aarch64" ]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache --openjdk-target=aarch64-unknown-cygwin" fi From 24b40a0da1b9316a266d2e1666d79a62588536c0 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 10:16:19 +0000 Subject: [PATCH 02/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 2 +- build-farm/platform-specific-configurations/alpine-linux.sh | 2 +- build-farm/platform-specific-configurations/linux.sh | 2 +- build-farm/platform-specific-configurations/mac.sh | 2 +- build-farm/platform-specific-configurations/windows.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index 27f62fc2b..d237b50c4 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -61,7 +61,7 @@ fi if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin jdk-21+ uses "bundled" FreeType - export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" fi diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index 24709bc12..f61fab296 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -30,7 +30,7 @@ export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --dis if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin jdk-21+ uses "bundled" FreeType - export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else # We don't bundle freetype on alpine anymore, and expect the user to have it. export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index c82b6861e..7ae9a745c 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -21,7 +21,7 @@ source "$SCRIPT_DIR/../../sbin/common/constants.sh" if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin jdk-21+ uses "bundled" FreeType - export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else # Bundling our own freetype can cause problems, so we skip that on linux. export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index d84ec3921..ff359e767 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -70,7 +70,7 @@ fi if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin jdk-21+ uses "bundled" FreeType - export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi # The configure option '--with-macosx-codesign-identity' is supported in JDK8 OpenJ9 and JDK11 and JDK14+ diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index a12e0e071..ca5156a71 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -233,7 +233,7 @@ fi if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin jdk-21+ uses "bundled" FreeType - export BUILD_ARGS="${BUILD_ARGS} --freetype-dir=bundled" + export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi if [ "${ARCHITECTURE}" == "aarch64" ]; then From e52863eb1023f3d79fd7127c55d583dfd7ebbad1 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 10:20:09 +0000 Subject: [PATCH 03/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index d237b50c4..d9442cfe4 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -69,7 +69,7 @@ fi if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then export LDR_CNTRL=MAXDATA=0x80000000 fi -echo LDR_CNTRL=$LDR_CNTRL +echo LDR_CNTRL="$LDR_CNTRL" BOOT_JDK_VARIABLE="JDK${JDK_BOOT_VERSION}_BOOT_DIR" if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then From 9992ed78499496f39a776e3e40afd2568e28841d Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 13:40:07 +0000 Subject: [PATCH 04/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 4 ++-- build-farm/platform-specific-configurations/alpine-linux.sh | 4 ++-- build-farm/platform-specific-configurations/linux.sh | 4 ++-- build-farm/platform-specific-configurations/mac.sh | 4 ++-- build-farm/platform-specific-configurations/windows.sh | 4 ++-- .../src/net/adoptium/test/BundledFreetypeTest.java | 6 +++++- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index d9442cfe4..c32cf28df 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -59,8 +59,8 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread" fi -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then - # Temurin jdk-21+ uses "bundled" FreeType +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index f61fab296..314637408 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -28,8 +28,8 @@ fi # ccache seems flaky on alpine export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache" -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then - # Temurin jdk-21+ uses "bundled" FreeType +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else # We don't bundle freetype on alpine anymore, and expect the user to have it. diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index 7ae9a745c..b75168719 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -19,8 +19,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=sbin/common/constants.sh source "$SCRIPT_DIR/../../sbin/common/constants.sh" -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then - # Temurin jdk-21+ uses "bundled" FreeType +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else # Bundling our own freetype can cause problems, so we skip that on linux. diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index ff359e767..051f725ea 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -68,8 +68,8 @@ else fi fi -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then - # Temurin jdk-21+ uses "bundled" FreeType +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index ca5156a71..9515933f9 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -231,8 +231,8 @@ then fi fi -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then - # Temurin jdk-21+ uses "bundled" FreeType +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then + # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi diff --git a/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java b/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java index baf413120..7d991d69c 100644 --- a/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java +++ b/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java @@ -74,7 +74,11 @@ public void freetypeOnlyBundledOnCertainPlatforms() throws IOException { .filter(name -> freetypePattern.matcher(name).matches()) .collect(Collectors.toSet()); - if (jdkPlatform.runsOn(OperatingSystem.MACOS)) { + if (!jdkVersion.usesVM(VM.OPENJ9) && jdkVersion.isNewerOrEqual(21)) { + // Temurin/hotspot jdk-21+ uses "bundled" FreeType + assertTrue(freetypeFiles.size() > 0, + "Expected libfreetype.dylib to be bundled but it is not."); + } else if (jdkPlatform.runsOn(OperatingSystem.MACOS)) { assertTrue(freetypeFiles.size() > 0, "Expected libfreetype.dylib to be bundled but it is not."); } else if (jdkPlatform.runsOn(OperatingSystem.WINDOWS)) { From 75c8150dc598b3d3dd6c67f764c40b63324f8124 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 13:47:36 +0000 Subject: [PATCH 05/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 2 +- build-farm/platform-specific-configurations/alpine-linux.sh | 2 +- build-farm/platform-specific-configurations/linux.sh | 2 +- build-farm/platform-specific-configurations/mac.sh | 2 +- build-farm/platform-specific-configurations/windows.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index c32cf28df..6296abb4e 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -59,7 +59,7 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread" fi -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index 314637408..03a4a46fb 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -28,7 +28,7 @@ fi # ccache seems flaky on alpine export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache" -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index b75168719..aa37e4f87 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -19,7 +19,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=sbin/common/constants.sh source "$SCRIPT_DIR/../../sbin/common/constants.sh" -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 051f725ea..d1ff93fdd 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -68,7 +68,7 @@ else fi fi -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index 9515933f9..af0e00beb 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -231,7 +231,7 @@ then fi fi -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi From a6d5394221ce041599155e302d79ccff649201f1 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 14:00:56 +0000 Subject: [PATCH 06/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index 6296abb4e..c32cf28df 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -59,7 +59,7 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread" fi -if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else From 39e6c058bc41888ef31effc0c12a863365c70261 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 14:04:57 +0000 Subject: [PATCH 07/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 1 + build-farm/platform-specific-configurations/alpine-linux.sh | 3 ++- build-farm/platform-specific-configurations/linux.sh | 3 ++- build-farm/platform-specific-configurations/mac.sh | 3 ++- build-farm/platform-specific-configurations/windows.sh | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index c32cf28df..1159d9322 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -59,6 +59,7 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread" fi +# shellcheck disable=SC2109 if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index 03a4a46fb..32539c499 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -28,7 +28,8 @@ fi # ccache seems flaky on alpine export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache" -if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +# shellcheck disable=SC2109 +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index aa37e4f87..096f6837f 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -19,7 +19,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=sbin/common/constants.sh source "$SCRIPT_DIR/../../sbin/common/constants.sh" -if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +# shellcheck disable=SC2109 +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index d1ff93fdd..70107f4b4 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -68,7 +68,8 @@ else fi fi -if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +# shellcheck disable=SC2109 +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index af0e00beb..82461b39c 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -231,7 +231,8 @@ then fi fi -if [[ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}"] || ["${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ]] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +# shellcheck disable=SC2109 +if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi From 2167e706ed2f2f968798c2e0e3c0c16fd90caef4 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 1 Dec 2023 14:46:51 +0000 Subject: [PATCH 08/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 3 +-- build-farm/platform-specific-configurations/alpine-linux.sh | 3 +-- build-farm/platform-specific-configurations/linux.sh | 3 +-- build-farm/platform-specific-configurations/mac.sh | 3 +-- build-farm/platform-specific-configurations/windows.sh | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index 1159d9322..2dae51487 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -59,8 +59,7 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread" fi -# shellcheck disable=SC2109 -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index 32539c499..1f9678283 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -28,8 +28,7 @@ fi # ccache seems flaky on alpine export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache" -# shellcheck disable=SC2109 -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index 096f6837f..ac96f3b50 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -19,8 +19,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=sbin/common/constants.sh source "$SCRIPT_DIR/../../sbin/common/constants.sh" -# shellcheck disable=SC2109 -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 70107f4b4..5f50fda93 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -68,8 +68,7 @@ else fi fi -# shellcheck disable=SC2109 -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index 82461b39c..13cd96687 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -231,8 +231,7 @@ then fi fi -# shellcheck disable=SC2109 -if [ "${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}" ] && [ "$JAVA_FEATURE_VERSION" -ge 21 ]; then +if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then # Temurin/hotspot jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi From 796d86bd8d1201dc18e647b086a0c9d0c2cbb548 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 4 Dec 2023 14:55:16 +0000 Subject: [PATCH 09/10] Default Temurin jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35c0dc9b9..d7763c3e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,9 +165,9 @@ jobs: - name: Build macOS run: | export JAVA_HOME=$JAVA_HOME_11_X64 - # Skip freetype build on jdk11+ + # jdk11u+ uses two part exploded & assemble build if [ ${{ matrix.version.name }} != "jdk8u" ]; then - export BUILD_ARGS="--skip-freetype --make-exploded-image --create-sbom" + export BUILD_ARGS="--make-exploded-image --create-sbom" ./build-farm/make-adopt-build-farm.sh export BUILD_ARGS="--assemble-exploded-image --create-sbom" ./build-farm/make-adopt-build-farm.sh From 65dd287e10eb03f642326fb5433732c3c151895e Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 5 Dec 2023 13:20:21 +0000 Subject: [PATCH 10/10] Default jdk-21+ to use bundled FreeType Signed-off-by: Andrew Leonard --- build-farm/platform-specific-configurations/aix.sh | 4 ++-- build-farm/platform-specific-configurations/alpine-linux.sh | 4 ++-- build-farm/platform-specific-configurations/linux.sh | 4 ++-- build-farm/platform-specific-configurations/mac.sh | 4 ++-- build-farm/platform-specific-configurations/windows.sh | 4 ++-- .../src/net/adoptium/test/BundledFreetypeTest.java | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build-farm/platform-specific-configurations/aix.sh b/build-farm/platform-specific-configurations/aix.sh index 2dae51487..fea9acefb 100755 --- a/build-farm/platform-specific-configurations/aix.sh +++ b/build-farm/platform-specific-configurations/aix.sh @@ -59,8 +59,8 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread" fi -if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then - # Temurin/hotspot jdk-21+ uses "bundled" FreeType +if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then + # jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index 1f9678283..1b3eedbcf 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -28,8 +28,8 @@ fi # ccache seems flaky on alpine export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache" -if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then - # Temurin/hotspot jdk-21+ uses "bundled" FreeType +if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then + # jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else # We don't bundle freetype on alpine anymore, and expect the user to have it. diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index ac96f3b50..655cd16c0 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -19,8 +19,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=sbin/common/constants.sh source "$SCRIPT_DIR/../../sbin/common/constants.sh" -if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then - # Temurin/hotspot jdk-21+ uses "bundled" FreeType +if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then + # jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" else # Bundling our own freetype can cause problems, so we skip that on linux. diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 5f50fda93..7283ceb82 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -68,8 +68,8 @@ else fi fi -if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then - # Temurin/hotspot jdk-21+ uses "bundled" FreeType +if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then + # jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index 13cd96687..25d5756a8 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -231,8 +231,8 @@ then fi fi -if [[ ("${VARIANT}" == "${BUILD_VARIANT_TEMURIN}" || "${VARIANT}" == "${BUILD_VARIANT_HOTSPOT}") && "$JAVA_FEATURE_VERSION" -ge 21 ]]; then - # Temurin/hotspot jdk-21+ uses "bundled" FreeType +if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then + # jdk-21+ uses "bundled" FreeType export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled" fi diff --git a/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java b/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java index 7d991d69c..a6e103201 100644 --- a/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java +++ b/test/functional/buildAndPackage/src/net/adoptium/test/BundledFreetypeTest.java @@ -74,8 +74,8 @@ public void freetypeOnlyBundledOnCertainPlatforms() throws IOException { .filter(name -> freetypePattern.matcher(name).matches()) .collect(Collectors.toSet()); - if (!jdkVersion.usesVM(VM.OPENJ9) && jdkVersion.isNewerOrEqual(21)) { - // Temurin/hotspot jdk-21+ uses "bundled" FreeType + if (jdkVersion.isNewerOrEqual(21)) { + // jdk-21+ uses "bundled" FreeType assertTrue(freetypeFiles.size() > 0, "Expected libfreetype.dylib to be bundled but it is not."); } else if (jdkPlatform.runsOn(OperatingSystem.MACOS)) {