From 608831265c92c23f1347b51fd904a151c1a79cd8 Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sat, 14 Jun 2025 14:10:28 -0500 Subject: [PATCH 1/8] [CI] Attempt to add intel mac builds with separate build step --- .gitlab-ci.yml | 11 +++++++++++ CI/before_install.osx.sh | 2 +- CI/before_script.osx.sh | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d55e554905..d715956a25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -534,6 +534,17 @@ Ubuntu_GCC_integration_tests_asan: paths: - build/OpenMW-*.dmg +macOS14_Xcode15_x86-64: + extends: .MacOS + image: macos-14-xcode-15 + tags: + - saas-macos-medium-m1 + cache: + key: macOS14_Xcode15_x86-64.v1 + variables: + CCACHE_SIZE: 3G + MACOS_X86_64: true + macOS14_Xcode15_arm64: extends: .MacOS image: macos-14-xcode-15 diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 30822f5d00..b1666690ef 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -20,7 +20,7 @@ ccache --version cmake --version qmake --version -if [[ "${MACOS_AMD64}" ]]; then +if [[ "${MACOS_X86_64}" ]]; then curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240802.zip -o ~/openmw-deps.zip unzip -o ~/openmw-deps.zip -d /tmp > /dev/null else diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index 9be91f1632..7957514e88 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -29,6 +29,12 @@ declare -a CMAKE_CONF_OPTS=( -D OPENMW_OSX_DEPLOYMENT=TRUE ) +if [[ "${MACOS_X86_64}" ]]; then + CMAKE_CONF_OPTS+=( + -D CMAKE_OSX_ARCHITECTURES="x86_64" + ) +fi + if [[ "${CMAKE_BUILD_TYPE}" ]]; then CMAKE_CONF_OPTS+=( -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} From 0f551c823374ca5f14b8cac7631953ee30ff86eb Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sat, 14 Jun 2025 15:38:05 -0500 Subject: [PATCH 2/8] [CI] Always use arm deps --- CI/before_install.osx.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index b1666690ef..e5f63a89a6 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -20,10 +20,5 @@ ccache --version cmake --version qmake --version -if [[ "${MACOS_X86_64}" ]]; then - curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240802.zip -o ~/openmw-deps.zip - unzip -o ~/openmw-deps.zip -d /tmp > /dev/null -else - curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz - tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null -fi +curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz +tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null From 139bde6420c1833893925976aa0425cd168f9c24 Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sat, 21 Jun 2025 13:53:40 -0500 Subject: [PATCH 3/8] [CI] Fork before install mac arm/intel steps, prefix with arch command --- CI/before_install.osx.sh | 23 ++++---------- CI/before_script.osx.sh | 50 +++++++++++++++++++++---------- CI/macos/before_install.arm.sh | 20 +++++++++++++ CI/macos/before_install.x86_64.sh | 8 +++++ 4 files changed, 67 insertions(+), 34 deletions(-) create mode 100755 CI/macos/before_install.arm.sh create mode 100755 CI/macos/before_install.x86_64.sh diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index e5f63a89a6..2e333261ab 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -4,21 +4,8 @@ export HOMEBREW_NO_EMOJI=1 export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_AUTOREMOVE=1 -brew tap --repair -brew update --quiet - -brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd - -command -v ccache >/dev/null 2>&1 || brew install ccache -command -v cmake >/dev/null 2>&1 || brew install cmake -command -v qmake >/dev/null 2>&1 || brew install qt@6 - -# Install deps -brew install openal-soft icu4c yaml-cpp sqlite - -ccache --version -cmake --version -qmake --version - -curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz -tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null +if [[ "${MACOS_X86_64}" ]]; then + ./CI/macos/before_install.x86_64.sh +else + ./CI/macos/before_install.arm.sh +fi diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index 7957514e88..ceabaef280 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -9,10 +9,17 @@ cd build DEPENDENCIES_ROOT="/tmp/openmw-deps" -QT_PATH=$(brew --prefix qt@6) -ICU_PATH=$(brew --prefix icu4c) -OPENAL_PATH=$(brew --prefix openal-soft) -CCACHE_EXECUTABLE=$(brew --prefix ccache)/bin/ccache +if [[ "${MACOS_X86_64}" ]]; then + QT_PATH=$(arch -x86_64 brew --prefix qt@6) + ICU_PATH=$(arch -x86_64 brew --prefix icu4c) + OPENAL_PATH=$(arch -x86_64 brew --prefix openal-soft) + CCACHE_EXECUTABLE=$(arch -x86_64 brew --prefix ccache)/bin/ccache +else + QT_PATH=$(brew --prefix qt@6) + ICU_PATH=$(brew --prefix icu4c) + OPENAL_PATH=$(brew --prefix openal-soft) + CCACHE_EXECUTABLE=$(brew --prefix ccache)/bin/ccache +fi declare -a CMAKE_CONF_OPTS=( -D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH;$OPENAL_PATH" @@ -29,6 +36,18 @@ declare -a CMAKE_CONF_OPTS=( -D OPENMW_OSX_DEPLOYMENT=TRUE ) +declare -a BUILD_OPTS=( +-D BUILD_OPENMW=TRUE +-D BUILD_OPENCS=TRUE +-D BUILD_ESMTOOL=TRUE +-D BUILD_BSATOOL=TRUE +-D BUILD_ESSIMPORTER=TRU +-D BUILD_NIFTEST=TRUE +-D BUILD_NAVMESHTOOL=TRUE +-D BUILD_BULLETOBJECTTOOL=TRUE +-G"Unix Makefiles" +) + if [[ "${MACOS_X86_64}" ]]; then CMAKE_CONF_OPTS+=( -D CMAKE_OSX_ARCHITECTURES="x86_64" @@ -45,15 +64,14 @@ else ) fi -cmake \ -"${CMAKE_CONF_OPTS[@]}" \ --D BUILD_OPENMW=TRUE \ --D BUILD_OPENCS=TRUE \ --D BUILD_ESMTOOL=TRUE \ --D BUILD_BSATOOL=TRUE \ --D BUILD_ESSIMPORTER=TRUE \ --D BUILD_NIFTEST=TRUE \ --D BUILD_NAVMESHTOOL=TRUE \ --D BUILD_BULLETOBJECTTOOL=TRUE \ --G"Unix Makefiles" \ -.. +if [[ "${MACOS_X86_64}" ]]; then + arch -x86_64 cmake \ + "${CMAKE_CONF_OPTS[@]}" \ + "${BUILD_OPTS[@]}" \ + .. +else + cmake \ + "${CMAKE_CONF_OPTS[@]}" \ + "${BUILD_OPTS[@]}" \ + .. +fi diff --git a/CI/macos/before_install.arm.sh b/CI/macos/before_install.arm.sh new file mode 100755 index 0000000000..1be5f7b740 --- /dev/null +++ b/CI/macos/before_install.arm.sh @@ -0,0 +1,20 @@ +#!/bin/sh -ex + +brew tap --repair +brew update --quiet + +brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd + +command -v ccache >/dev/null 2>&1 || brew install ccache +command -v cmake >/dev/null 2>&1 || brew install cmake +command -v qmake >/dev/null 2>&1 || brew install qt@6 + +# Install deps +brew install openal-soft icu4c yaml-cpp sqlite + +ccache --version +cmake --version +qmake --version + +curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz +tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null diff --git a/CI/macos/before_install.x86_64.sh b/CI/macos/before_install.x86_64.sh new file mode 100755 index 0000000000..6e5664c3b0 --- /dev/null +++ b/CI/macos/before_install.x86_64.sh @@ -0,0 +1,8 @@ +#!/bin/sh -ex + +arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +arch -x86_64 brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd ccache cmake qt@6 openal-soft icu4c yaml-cpp sqlite + +curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240802.zip -o ~/openmw-deps.zip +unzip -o ~/openmw-deps.zip -d /tmp > /dev/null From 12f359622057ba735cc45bd615dea579768d4f18 Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sat, 21 Jun 2025 14:19:43 -0500 Subject: [PATCH 4/8] [CI] Specify intel brew location --- CI/before_script.osx.sh | 8 ++++---- CI/macos/before_install.x86_64.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index ceabaef280..9281089c43 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -10,10 +10,10 @@ cd build DEPENDENCIES_ROOT="/tmp/openmw-deps" if [[ "${MACOS_X86_64}" ]]; then - QT_PATH=$(arch -x86_64 brew --prefix qt@6) - ICU_PATH=$(arch -x86_64 brew --prefix icu4c) - OPENAL_PATH=$(arch -x86_64 brew --prefix openal-soft) - CCACHE_EXECUTABLE=$(arch -x86_64 brew --prefix ccache)/bin/ccache + QT_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix qt@6) + ICU_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix icu4c) + OPENAL_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix openal-soft) + CCACHE_EXECUTABLE=$(arch -x86_64 /usr/local/bin/brew --prefix ccache)/bin/ccache else QT_PATH=$(brew --prefix qt@6) ICU_PATH=$(brew --prefix icu4c) diff --git a/CI/macos/before_install.x86_64.sh b/CI/macos/before_install.x86_64.sh index 6e5664c3b0..642f2c2c62 100755 --- a/CI/macos/before_install.x86_64.sh +++ b/CI/macos/before_install.x86_64.sh @@ -2,7 +2,7 @@ arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -arch -x86_64 brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd ccache cmake qt@6 openal-soft icu4c yaml-cpp sqlite +arch -x86_64 /usr/local/bin/brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd ccache cmake qt@6 openal-soft icu4c yaml-cpp sqlite curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240802.zip -o ~/openmw-deps.zip unzip -o ~/openmw-deps.zip -d /tmp > /dev/null From faa9af4428f87db9d0844eace8d0875ef8472e9f Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sat, 21 Jun 2025 19:53:02 -0500 Subject: [PATCH 5/8] [CI] Overhaul mac CI flow --- .github/workflows/push.yml | 8 +++--- .gitlab-ci.yml | 25 +++++++++---------- ...install.osx.sh => before_install.macos.sh} | 6 ++--- ...e_script.osx.sh => before_script.macos.sh} | 6 ++--- ...tall.x86_64.sh => before_install.amd64.sh} | 0 ...install.arm.sh => before_install.arm64.sh} | 0 CI/macos/build.sh | 9 +++++++ CI/macos/ccache_prep.sh | 12 +++++++++ CI/macos/ccache_save.sh | 7 ++++++ 9 files changed, 49 insertions(+), 24 deletions(-) rename CI/{before_install.osx.sh => before_install.macos.sh} (51%) rename CI/{before_script.osx.sh => before_script.macos.sh} (95%) rename CI/macos/{before_install.x86_64.sh => before_install.amd64.sh} (100%) rename CI/macos/{before_install.arm.sh => before_install.arm64.sh} (100%) create mode 100755 CI/macos/build.sh create mode 100755 CI/macos/ccache_prep.sh create mode 100755 CI/macos/ccache_save.sh diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 41fa39b78d..3c4f4c45a7 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -73,7 +73,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Building Dependencies - run: CI/before_install.osx.sh + run: CI/before_install.macos.sh - name: Prime ccache uses: hendrikmuhs/ccache-action@v1 @@ -82,11 +82,9 @@ jobs: max-size: 1000M - name: Configure - run: CI/before_script.osx.sh + run: CI/before_script.macos.sh - name: Build - run: | - cd build - make -j $(sysctl -n hw.logicalcpu) package + run: CI/macos/build.sh Output-Envs: name: Read .env file and expose it as output diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d715956a25..ab8aa3d76d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -507,14 +507,11 @@ Ubuntu_GCC_integration_tests_asan: paths: - ccache/ script: - - CI/before_install.osx.sh - - export CCACHE_BASEDIR="$(pwd)" - - export CCACHE_DIR="$(pwd)/ccache" - - mkdir -pv "${CCACHE_DIR}" - - ccache -z -M "${CCACHE_SIZE}" - - CI/before_script.osx.sh - - cd build; make -j $(sysctl -n hw.logicalcpu) package - - for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${CI_COMMIT_REF_NAME##*/}.dmg"; done + - CI/before_install.macos.sh + - CI/macos/ccache_prep.sh + - CI/before_script.macos.sh + - CI/macos/build.sh + - for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${CI_COMMIT_REF_NAME##*/}_${DMG_IDENTIFIER}.dmg"; done - | if [[ -n "${AWS_ACCESS_KEY_ID}" ]]; then echo "[default]" > ~/.s3cfg @@ -529,21 +526,22 @@ Ubuntu_GCC_integration_tests_asan: s3cmd put "${dmg}" s3://openmw-artifacts/${artifactDirectory} done fi - - ccache -s + - CI/macos/ccache_save.sh artifacts: paths: - build/OpenMW-*.dmg -macOS14_Xcode15_x86-64: +macOS14_Xcode15_amd64: extends: .MacOS image: macos-14-xcode-15 tags: - saas-macos-medium-m1 cache: - key: macOS14_Xcode15_x86-64.v1 + key: macOS14_Xcode15_amd64.v1 variables: CCACHE_SIZE: 3G - MACOS_X86_64: true + DMG_IDENTIFIER: amd64 + MACOS_AMD64: true macOS14_Xcode15_arm64: extends: .MacOS @@ -553,6 +551,7 @@ macOS14_Xcode15_arm64: cache: key: macOS14_Xcode15_arm64.v1 variables: + DMG_IDENTIFIER: arm64 CCACHE_SIZE: 3G .Compress_And_Upload_Symbols_Base: @@ -979,7 +978,7 @@ Windows_MSBuild_CacheInit: - flatpak build-bundle ./repo openmw.flatpak org.openmw.OpenMW.devel cache: key: flatpak - paths: + paths: - ".flatpak-builder" artifacts: untracked: false diff --git a/CI/before_install.osx.sh b/CI/before_install.macos.sh similarity index 51% rename from CI/before_install.osx.sh rename to CI/before_install.macos.sh index 2e333261ab..f466dd06a7 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.macos.sh @@ -4,8 +4,8 @@ export HOMEBREW_NO_EMOJI=1 export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_AUTOREMOVE=1 -if [[ "${MACOS_X86_64}" ]]; then - ./CI/macos/before_install.x86_64.sh +if [[ "${MACOS_AMD64}" ]]; then + ./CI/macos/before_install.amd64.sh else - ./CI/macos/before_install.arm.sh + ./CI/macos/before_install.arm64.sh fi diff --git a/CI/before_script.osx.sh b/CI/before_script.macos.sh similarity index 95% rename from CI/before_script.osx.sh rename to CI/before_script.macos.sh index 9281089c43..1d4b02e380 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.macos.sh @@ -41,14 +41,14 @@ declare -a BUILD_OPTS=( -D BUILD_OPENCS=TRUE -D BUILD_ESMTOOL=TRUE -D BUILD_BSATOOL=TRUE --D BUILD_ESSIMPORTER=TRU +-D BUILD_ESSIMPORTER=TRUE -D BUILD_NIFTEST=TRUE -D BUILD_NAVMESHTOOL=TRUE -D BUILD_BULLETOBJECTTOOL=TRUE -G"Unix Makefiles" ) -if [[ "${MACOS_X86_64}" ]]; then +if [[ "${MACOS_AMD64}" ]]; then CMAKE_CONF_OPTS+=( -D CMAKE_OSX_ARCHITECTURES="x86_64" ) @@ -64,7 +64,7 @@ else ) fi -if [[ "${MACOS_X86_64}" ]]; then +if [[ "${MACOS_AMD64}" ]]; then arch -x86_64 cmake \ "${CMAKE_CONF_OPTS[@]}" \ "${BUILD_OPTS[@]}" \ diff --git a/CI/macos/before_install.x86_64.sh b/CI/macos/before_install.amd64.sh similarity index 100% rename from CI/macos/before_install.x86_64.sh rename to CI/macos/before_install.amd64.sh diff --git a/CI/macos/before_install.arm.sh b/CI/macos/before_install.arm64.sh similarity index 100% rename from CI/macos/before_install.arm.sh rename to CI/macos/before_install.arm64.sh diff --git a/CI/macos/build.sh b/CI/macos/build.sh new file mode 100755 index 0000000000..64986717ce --- /dev/null +++ b/CI/macos/build.sh @@ -0,0 +1,9 @@ +#!/bin/sh -ex + +cd build + +if [[ "${MACOS_AMD64}" ]]; then + arch -x86_64 make -j $(sysctl -n hw.logicalcpu) package +else + make -j $(sysctl -n hw.logicalcpu) package +fi diff --git a/CI/macos/ccache_prep.sh b/CI/macos/ccache_prep.sh new file mode 100755 index 0000000000..17af2f9b55 --- /dev/null +++ b/CI/macos/ccache_prep.sh @@ -0,0 +1,12 @@ +#!/bin/sh -ex + +export CCACHE_BASEDIR="$(pwd)" +export CCACHE_DIR="$(pwd)/ccache" +mkdir -pv "${CCACHE_DIR}" +ccache -z -M "${CCACHE_SIZE}" + +if [[ "${MACOS_AMD64}" ]]; then + arch -x86_64 ccache -z -M "${CCACHE_SIZE}" +else + ccache -z -M "${CCACHE_SIZE}" +fi diff --git a/CI/macos/ccache_save.sh b/CI/macos/ccache_save.sh new file mode 100755 index 0000000000..d06d16fb0c --- /dev/null +++ b/CI/macos/ccache_save.sh @@ -0,0 +1,7 @@ +#!/bin/sh -ex + +if [[ "${MACOS_AMD64}" ]]; then + arch -x86_64 ccache -s +else + ccache -s +fi From adc4698c4460763eccb8e0c42f10bea2c74610a0 Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sat, 21 Jun 2025 21:14:44 -0500 Subject: [PATCH 6/8] [CI] Revert ccache script forking, rename try, cleanup --- .gitlab-ci.yml | 4 ++-- CI/macos/before_install.arm64.sh | 4 ---- CI/macos/ccache_prep.sh | 7 +------ CI/macos/ccache_save.sh | 7 ------- 4 files changed, 3 insertions(+), 19 deletions(-) delete mode 100755 CI/macos/ccache_save.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab8aa3d76d..30654a8471 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -511,7 +511,7 @@ Ubuntu_GCC_integration_tests_asan: - CI/macos/ccache_prep.sh - CI/before_script.macos.sh - CI/macos/build.sh - - for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${CI_COMMIT_REF_NAME##*/}_${DMG_IDENTIFIER}.dmg"; done + - for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${DMG_IDENTIFIER}_${CI_COMMIT_REF_NAME##*/}.dmg"; done - | if [[ -n "${AWS_ACCESS_KEY_ID}" ]]; then echo "[default]" > ~/.s3cfg @@ -526,7 +526,7 @@ Ubuntu_GCC_integration_tests_asan: s3cmd put "${dmg}" s3://openmw-artifacts/${artifactDirectory} done fi - - CI/macos/ccache_save.sh + - ccache -s artifacts: paths: - build/OpenMW-*.dmg diff --git a/CI/macos/before_install.arm64.sh b/CI/macos/before_install.arm64.sh index 1be5f7b740..84120dfba2 100755 --- a/CI/macos/before_install.arm64.sh +++ b/CI/macos/before_install.arm64.sh @@ -12,9 +12,5 @@ command -v qmake >/dev/null 2>&1 || brew install qt@6 # Install deps brew install openal-soft icu4c yaml-cpp sqlite -ccache --version -cmake --version -qmake --version - curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null diff --git a/CI/macos/ccache_prep.sh b/CI/macos/ccache_prep.sh index 17af2f9b55..06dd5c8479 100755 --- a/CI/macos/ccache_prep.sh +++ b/CI/macos/ccache_prep.sh @@ -3,10 +3,5 @@ export CCACHE_BASEDIR="$(pwd)" export CCACHE_DIR="$(pwd)/ccache" mkdir -pv "${CCACHE_DIR}" -ccache -z -M "${CCACHE_SIZE}" -if [[ "${MACOS_AMD64}" ]]; then - arch -x86_64 ccache -z -M "${CCACHE_SIZE}" -else - ccache -z -M "${CCACHE_SIZE}" -fi +ccache -z -M "${CCACHE_SIZE}" diff --git a/CI/macos/ccache_save.sh b/CI/macos/ccache_save.sh deleted file mode 100755 index d06d16fb0c..0000000000 --- a/CI/macos/ccache_save.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -ex - -if [[ "${MACOS_AMD64}" ]]; then - arch -x86_64 ccache -s -else - ccache -s -fi From 50e3c9d50079917ddd8224dfbfef10994034e62d Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sun, 22 Jun 2025 10:35:16 -0500 Subject: [PATCH 7/8] [CI] Ccache flow tweak, use forked commands, cd build --- .gitlab-ci.yml | 8 ++++++-- CI/macos/ccache_prep.sh | 10 +++++----- CI/macos/ccache_save.sh | 7 +++++++ 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100755 CI/macos/ccache_save.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30654a8471..f275702d2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -508,9 +508,13 @@ Ubuntu_GCC_integration_tests_asan: - ccache/ script: - CI/before_install.macos.sh + - export CCACHE_BASEDIR="$(pwd)" + - export CCACHE_DIR="$(pwd)/ccache" + - mkdir -pv "${CCACHE_DIR}" - CI/macos/ccache_prep.sh - CI/before_script.macos.sh - CI/macos/build.sh + - cd build - for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${DMG_IDENTIFIER}_${CI_COMMIT_REF_NAME##*/}.dmg"; done - | if [[ -n "${AWS_ACCESS_KEY_ID}" ]]; then @@ -526,7 +530,7 @@ Ubuntu_GCC_integration_tests_asan: s3cmd put "${dmg}" s3://openmw-artifacts/${artifactDirectory} done fi - - ccache -s + - CI/macos/ccache_save.sh artifacts: paths: - build/OpenMW-*.dmg @@ -537,7 +541,7 @@ macOS14_Xcode15_amd64: tags: - saas-macos-medium-m1 cache: - key: macOS14_Xcode15_amd64.v1 + key: macOS14_Xcode15_amd64.v2 variables: CCACHE_SIZE: 3G DMG_IDENTIFIER: amd64 diff --git a/CI/macos/ccache_prep.sh b/CI/macos/ccache_prep.sh index 06dd5c8479..abd0103be0 100755 --- a/CI/macos/ccache_prep.sh +++ b/CI/macos/ccache_prep.sh @@ -1,7 +1,7 @@ #!/bin/sh -ex -export CCACHE_BASEDIR="$(pwd)" -export CCACHE_DIR="$(pwd)/ccache" -mkdir -pv "${CCACHE_DIR}" - -ccache -z -M "${CCACHE_SIZE}" +if [[ "${MACOS_AMD64}" ]]; then + arch -x86_64 ccache -z -M "${CCACHE_SIZE}" +else + ccache -z -M "${CCACHE_SIZE}" +fi diff --git a/CI/macos/ccache_save.sh b/CI/macos/ccache_save.sh new file mode 100755 index 0000000000..d06d16fb0c --- /dev/null +++ b/CI/macos/ccache_save.sh @@ -0,0 +1,7 @@ +#!/bin/sh -ex + +if [[ "${MACOS_AMD64}" ]]; then + arch -x86_64 ccache -s +else + ccache -s +fi From 493827285b7292bf9446b38fff1b29e095776a8e Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sun, 22 Jun 2025 13:35:23 -0500 Subject: [PATCH 8/8] [CI] Fix path and big env goof --- .gitlab-ci.yml | 2 +- CI/before_script.macos.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f275702d2c..52fa51d299 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -530,7 +530,7 @@ Ubuntu_GCC_integration_tests_asan: s3cmd put "${dmg}" s3://openmw-artifacts/${artifactDirectory} done fi - - CI/macos/ccache_save.sh + - ../CI/macos/ccache_save.sh artifacts: paths: - build/OpenMW-*.dmg diff --git a/CI/before_script.macos.sh b/CI/before_script.macos.sh index 1d4b02e380..50adab234d 100755 --- a/CI/before_script.macos.sh +++ b/CI/before_script.macos.sh @@ -9,7 +9,7 @@ cd build DEPENDENCIES_ROOT="/tmp/openmw-deps" -if [[ "${MACOS_X86_64}" ]]; then +if [[ "${MACOS_AMD64}" ]]; then QT_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix qt@6) ICU_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix icu4c) OPENAL_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix openal-soft)