From 75e5816cddae9722b405ac13e34d52a78ff6772e Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Tue, 3 Oct 2023 14:13:18 +0100 Subject: [PATCH 01/15] Add cross compile steps for x64 jdk8 on m1 macs --- build-farm/make-adopt-build-farm.sh | 3 ++- build-farm/platform-specific-configurations/mac.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build-farm/make-adopt-build-farm.sh b/build-farm/make-adopt-build-farm.sh index 7170eab15..759753149 100755 --- a/build-farm/make-adopt-build-farm.sh +++ b/build-farm/make-adopt-build-farm.sh @@ -132,6 +132,7 @@ CONFIGURE_ARGS_FOR_ANY_PLATFORM="" CONFIGURE_ARGS=${CONFIGURE_ARGS:-""} BUILD_ARGS=${BUILD_ARGS:-""} VARIANT_ARG="" +MAC_ROSETTA_PREFIX="" if [ -z "${JDK_BOOT_VERSION}" ] then @@ -245,4 +246,4 @@ echo "$PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boo CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM//\"/temporary_speech_mark_placeholder}" # shellcheck disable=SC2086 -bash -c "$PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args \"${CONFIGURE_ARGS_FOR_ANY_PLATFORM}\" --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" +bash -c "$MAC_ROSETTA_PREFIX $PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args \"${CONFIGURE_ARGS_FOR_ANY_PLATFORM}\" --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 94a7bab40..c7fc3bd79 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -22,10 +22,18 @@ source "$SCRIPT_DIR/../../sbin/common/constants.sh" export MACOSX_DEPLOYMENT_TARGET=10.9 export BUILD_ARGS="${BUILD_ARGS}" +## JDK8 only: If, at this point in the build, the architecure of the machine is arm64 while the ARCHITECTURE variable +## is x64 then we need to add the cross compilation option --openjdk-target=x86_64-apple-darwin +MACHINEARCHITECURE=$(uname -a) + if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then - XCODE_SWITCH_PATH="/Applications/Xcode.app" + XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" + if [ "${MACHINEARCHITECURE}" == "arm64" && "${ARCHITECTURE}" == "x64"]; then + export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" + MAC_ROSETTA_PREFIX="arch -x86_64" + fi if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-openssl=fetched --enable-openssl-bundling" export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" From e78ccb57fa7cd3d1092dfab8b861f3a61b94da92 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Tue, 3 Oct 2023 14:33:38 +0100 Subject: [PATCH 02/15] syntax error --- build-farm/platform-specific-configurations/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index c7fc3bd79..4f8444b50 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -30,7 +30,7 @@ if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" - if [ "${MACHINEARCHITECURE}" == "arm64" && "${ARCHITECTURE}" == "x64"]; then + if [ "${MACHINEARCHITECURE}" == "arm64" ] && [ "${ARCHITECTURE}" == "x64"]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" MAC_ROSETTA_PREFIX="arch -x86_64" fi From 901db33d49f702511474aa49fd481cfc021454bd Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Tue, 3 Oct 2023 14:39:34 +0100 Subject: [PATCH 03/15] syntax error --- build-farm/platform-specific-configurations/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 4f8444b50..c539e663c 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -30,7 +30,7 @@ if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" - if [ "${MACHINEARCHITECURE}" == "arm64" ] && [ "${ARCHITECTURE}" == "x64"]; then + if [[ "${MACHINEARCHITECURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" MAC_ROSETTA_PREFIX="arch -x86_64" fi From 66591071d792ed8810628f66536d21e6299dabd2 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Tue, 3 Oct 2023 14:55:14 +0100 Subject: [PATCH 04/15] resolve linter error --- build-farm/make-adopt-build-farm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/make-adopt-build-farm.sh b/build-farm/make-adopt-build-farm.sh index 759753149..2819be61a 100755 --- a/build-farm/make-adopt-build-farm.sh +++ b/build-farm/make-adopt-build-farm.sh @@ -32,7 +32,7 @@ if [ -z "$ARCHITECTURE" ]; then if [ "$ARCHITECTURE" = "powerpc" ]; then ARCHITECTURE=ppc64; fi # AIX if [ "$ARCHITECTURE" = "arm" ]; then ARCHITECTURE=aarch64; fi # mac/aarch64 if [ "$ARCHITECTURE" = "armv7l" ]; then ARCHITECTURE=arm; fi # Linux/arm32 - echo ARCHITECTURE not defined - assuming $ARCHITECTURE + echo ARCHITECTURE not defined - assuming "$ARCHITECTURE" export ARCHITECTURE fi From 76cff19cd9eb12a60815aaf980aa125a0f5f981a Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Tue, 3 Oct 2023 15:12:11 +0100 Subject: [PATCH 05/15] add export --- build-farm/platform-specific-configurations/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index c539e663c..421c41d9a 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -32,7 +32,7 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" if [[ "${MACHINEARCHITECURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" - MAC_ROSETTA_PREFIX="arch -x86_64" + export MAC_ROSETTA_PREFIX="arch -x86_64" fi if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-openssl=fetched --enable-openssl-bundling" From 30d0f6d41965d1bf2072a45522e15bbbd4be28fe Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Tue, 3 Oct 2023 15:32:44 +0100 Subject: [PATCH 06/15] make link to xcode11.7 using - instead of _ --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b06351200..13cd50c9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,6 +135,7 @@ jobs: run: | rm -rf /Applications/Xcode.app ln -s /Applications/Xcode_11.7.app /Applications/Xcode.app + ln -s /Applications/Xcode_11.7.app /Applications/Xcode-11.7.app - name: Build macOS run: | From 06166c4f8c9d83764bd3cb9afd9d82d43aab8b37 Mon Sep 17 00:00:00 2001 From: Haroon Khel <34969545+Haroon-Khel@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:08:42 +0100 Subject: [PATCH 07/15] Update build-farm/platform-specific-configurations/mac.sh Co-authored-by: Stewart X Addison <6487691+sxa@users.noreply.github.com> --- build-farm/platform-specific-configurations/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 421c41d9a..5d90318b3 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -24,7 +24,7 @@ export BUILD_ARGS="${BUILD_ARGS}" ## JDK8 only: If, at this point in the build, the architecure of the machine is arm64 while the ARCHITECTURE variable ## is x64 then we need to add the cross compilation option --openjdk-target=x86_64-apple-darwin -MACHINEARCHITECURE=$(uname -a) +MACHINEARCHITECTURE=$(uname -a) if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then From 41e62d70a6691aa8676228c02d8c2abd3cbc0f77 Mon Sep 17 00:00:00 2001 From: Haroon Khel <34969545+Haroon-Khel@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:08:48 +0100 Subject: [PATCH 08/15] Update build-farm/platform-specific-configurations/mac.sh Co-authored-by: Stewart X Addison <6487691+sxa@users.noreply.github.com> --- build-farm/platform-specific-configurations/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 5d90318b3..7f8c61621 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -30,7 +30,7 @@ if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" - if [[ "${MACHINEARCHITECURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then + if [[ "${MACHINEARCHITECTURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" export MAC_ROSETTA_PREFIX="arch -x86_64" fi From 27d0d3545a00715cfcb01facd560f98b094b2510 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 4 Oct 2023 13:52:51 +0100 Subject: [PATCH 09/15] debug --- build-farm/platform-specific-configurations/mac.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 7f8c61621..f4194dc6a 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -26,11 +26,15 @@ export BUILD_ARGS="${BUILD_ARGS}" ## is x64 then we need to add the cross compilation option --openjdk-target=x86_64-apple-darwin MACHINEARCHITECTURE=$(uname -a) +echo "MACHINEARCHITECTURE: ${MACHINEARCHITECTURE}" +echo "ARCHITECTURE: ${ARCHITECTURE}" + if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" if [[ "${MACHINEARCHITECTURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then + echo "MACHINEARCHITECTURE == arm64 and ARCHITECTURE (to build) == x64" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" export MAC_ROSETTA_PREFIX="arch -x86_64" fi From 55f09056b518cf76f7b3316a84899fa2d114120a Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 4 Oct 2023 13:55:13 +0100 Subject: [PATCH 10/15] wrong uname flag --- build-farm/platform-specific-configurations/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index f4194dc6a..1b568b71f 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -24,7 +24,7 @@ export BUILD_ARGS="${BUILD_ARGS}" ## JDK8 only: If, at this point in the build, the architecure of the machine is arm64 while the ARCHITECTURE variable ## is x64 then we need to add the cross compilation option --openjdk-target=x86_64-apple-darwin -MACHINEARCHITECTURE=$(uname -a) +MACHINEARCHITECTURE=$(uname -m) echo "MACHINEARCHITECTURE: ${MACHINEARCHITECTURE}" echo "ARCHITECTURE: ${ARCHITECTURE}" From 0d7cb88ddfc3273b2e8c369b8dd095bab4cb1fea Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 4 Oct 2023 13:58:07 +0100 Subject: [PATCH 11/15] add MAC_ROSETTA_PREFIX to the echo command --- build-farm/make-adopt-build-farm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/make-adopt-build-farm.sh b/build-farm/make-adopt-build-farm.sh index 2819be61a..d913e09c7 100755 --- a/build-farm/make-adopt-build-farm.sh +++ b/build-farm/make-adopt-build-farm.sh @@ -239,7 +239,7 @@ if [ "${JAVA_FEATURE_VERSION}" -lt 16 ]; then export BUILD_ARGS="${BUILD_ARGS} --create-jre-image" fi -echo "$PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args ${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" +echo "$MAC_ROSETTA_PREFIX $PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args ${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" # Convert all speech marks in config args to make them safe to pass in. # These will be converted back into speech marks shortly before we use them, in build.sh. From 2a72f3f3c7986c42308d5aba3db480a78016d0a8 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 4 Oct 2023 15:05:51 +0100 Subject: [PATCH 12/15] temp fix for xcode switch so I can run the tests with the build --- build-farm/make-adopt-build-farm.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-farm/make-adopt-build-farm.sh b/build-farm/make-adopt-build-farm.sh index d913e09c7..5d9a6c7e7 100755 --- a/build-farm/make-adopt-build-farm.sh +++ b/build-farm/make-adopt-build-farm.sh @@ -247,3 +247,7 @@ CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM//\"/temporary # shellcheck disable=SC2086 bash -c "$MAC_ROSETTA_PREFIX $PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args \"${CONFIGURE_ARGS_FOR_ANY_PLATFORM}\" --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" + +# Just temporary. Will remove before PR is merged +sudo xcode-select --switch / +echo "Switching back to command line tools Xcode" \ No newline at end of file From 35426d777cdcda010c546db566c2945bdab40730 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 6 Oct 2023 13:12:34 +0100 Subject: [PATCH 13/15] add /opt/homebrew/bin to beginning of PATH jdk8 mac build --- build-farm/make-adopt-build-farm.sh | 6 +++--- build-farm/platform-specific-configurations/mac.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build-farm/make-adopt-build-farm.sh b/build-farm/make-adopt-build-farm.sh index 5d9a6c7e7..98a4004f6 100755 --- a/build-farm/make-adopt-build-farm.sh +++ b/build-farm/make-adopt-build-farm.sh @@ -248,6 +248,6 @@ CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM//\"/temporary # shellcheck disable=SC2086 bash -c "$MAC_ROSETTA_PREFIX $PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args \"${CONFIGURE_ARGS_FOR_ANY_PLATFORM}\" --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" -# Just temporary. Will remove before PR is merged -sudo xcode-select --switch / -echo "Switching back to command line tools Xcode" \ No newline at end of file +# # Just temporary. Will remove before PR is merged +# sudo xcode-select --switch / +# echo "Switching back to command line tools Xcode" \ No newline at end of file diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index 1b568b71f..f9ab8795d 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -32,6 +32,7 @@ echo "ARCHITECTURE: ${ARCHITECTURE}" if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" + export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" if [[ "${MACHINEARCHITECTURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then echo "MACHINEARCHITECTURE == arm64 and ARCHITECTURE (to build) == x64" From f5b633fca488af3574bc322099c3aa2b95fd16da Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 6 Oct 2023 13:13:37 +0100 Subject: [PATCH 14/15] add /opt/homebrew/bin to beginning of PATH jdk8 mac build on arm machines --- build-farm/platform-specific-configurations/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index f9ab8795d..ff07f4f37 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -32,12 +32,12 @@ echo "ARCHITECTURE: ${ARCHITECTURE}" if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" - export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" if [[ "${MACHINEARCHITECTURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then echo "MACHINEARCHITECTURE == arm64 and ARCHITECTURE (to build) == x64" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" export MAC_ROSETTA_PREFIX="arch -x86_64" + export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH fi if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-openssl=fetched --enable-openssl-bundling" From 19ee7ed18d509c981c07a9c59a1c98531dfa3159 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 6 Oct 2023 18:23:31 +0100 Subject: [PATCH 15/15] remove debug --- build-farm/make-adopt-build-farm.sh | 6 +----- build-farm/platform-specific-configurations/mac.sh | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/build-farm/make-adopt-build-farm.sh b/build-farm/make-adopt-build-farm.sh index 98a4004f6..4d8f2e1a4 100755 --- a/build-farm/make-adopt-build-farm.sh +++ b/build-farm/make-adopt-build-farm.sh @@ -246,8 +246,4 @@ echo "$MAC_ROSETTA_PREFIX $PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clea CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM//\"/temporary_speech_mark_placeholder}" # shellcheck disable=SC2086 -bash -c "$MAC_ROSETTA_PREFIX $PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args \"${CONFIGURE_ARGS_FOR_ANY_PLATFORM}\" --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" - -# # Just temporary. Will remove before PR is merged -# sudo xcode-select --switch / -# echo "Switching back to command line tools Xcode" \ No newline at end of file +bash -c "$MAC_ROSETTA_PREFIX $PLATFORM_SCRIPT_DIR/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir ${JDK_BOOT_DIR} --configure-args \"${CONFIGURE_ARGS_FOR_ANY_PLATFORM}\" --target-file-name ${FILENAME} ${TAG_OPTION} ${OPTIONS} ${BUILD_ARGS} ${VARIANT_ARG} ${JAVA_TO_BUILD}" \ No newline at end of file diff --git a/build-farm/platform-specific-configurations/mac.sh b/build-farm/platform-specific-configurations/mac.sh index ff07f4f37..c519f8a5f 100755 --- a/build-farm/platform-specific-configurations/mac.sh +++ b/build-farm/platform-specific-configurations/mac.sh @@ -26,15 +26,11 @@ export BUILD_ARGS="${BUILD_ARGS}" ## is x64 then we need to add the cross compilation option --openjdk-target=x86_64-apple-darwin MACHINEARCHITECTURE=$(uname -m) -echo "MACHINEARCHITECTURE: ${MACHINEARCHITECTURE}" -echo "ARCHITECTURE: ${ARCHITECTURE}" - if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang" if [[ "${MACHINEARCHITECTURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then - echo "MACHINEARCHITECTURE == arm64 and ARCHITECTURE (to build) == x64" export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin" export MAC_ROSETTA_PREFIX="arch -x86_64" export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH