address comments

This commit is contained in:
ebbit1q 2025-12-23 18:48:07 +01:00
parent 4414219f72
commit c0103e0378
3 changed files with 41 additions and 18 deletions

View file

@ -156,6 +156,18 @@ function ccachestatsverbose() {
# Compile
if [[ $RUNNER_OS == macOS ]]; then
# QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action,
# which sets a few environment variables
if QTDIR=$(find "$GITHUB_WORKSPACE/Qt" -depth -maxdepth 2 -name macos -type d -print -quit); then
echo "found QTDIR at $QTDIR"
else
echo "could not find QTDIR!"
exit 2
fi
# the qtdir is located at Qt/[qtversion]/macos
# we use find to get the first subfolder with the name "macos"
# this works independent of the qt version as there should be only one version installed on the runner at a time
export QTDIR
if [[ $TARGET_MACOS_VERSION ]]; then
# CMAKE_OSX_DEPLOYMENT_TARGET is a vanilla cmake flag needed to compile to target macOS version

23
.ci/thin_macos_qtlib.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
# The macos binaries from aqt are fat (universal), so we thin them to the target architecture to reduce the size of
# the packages and caches using lipo.
# This script is meant to be used by the ci enironment on macos runners only.
# It uses the runner's GITHUB_WORKSPACE env variable.
arch=$(uname -m)
nproc=$(sysctl -n hw.ncpu)
function thin() {
local libfile=$0
if file -b --mime-type "$libfile" | grep -q "application/x-mach-binary"; then
echo "Processing $libfile"
lipo "$libfile" -thin "$arch" -output "$libfile"
fi
return 0
}
export -f thin # export to allow use in xargs
echo "::group::Thinning Qt libraries to $arch using $nproc cores"
find "$GITHUB_WORKSPACE/Qt" -type f -print0 | xargs -0 -n1 -P"$nproc" -I{} bash -c "thin '{}'"
echo "::endgroup::"

View file

@ -260,7 +260,7 @@ jobs:
make_package: 1
package_suffix: "-macOS13_Intel"
artifact_name: macOS13_Intel-package
qt_version: 6.6.3
qt_version: 6.6.*
qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets
cmake_generator: Ninja
@ -275,7 +275,7 @@ jobs:
make_package: 1
package_suffix: "-macOS14"
artifact_name: macOS14-package
qt_version: 6.6.3
qt_version: 6.6.*
qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets
cmake_generator: Ninja
@ -290,7 +290,7 @@ jobs:
make_package: 1
package_suffix: "-macOS15"
artifact_name: macOS15-package
qt_version: 6.6.3
qt_version: 6.6.*
qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets
cmake_generator: Ninja
@ -302,7 +302,7 @@ jobs:
soc: Apple
xcode: "16.4"
type: Debug
qt_version: 6.6.3
qt_version: 6.6.*
qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets
cmake_generator: Ninja
@ -327,7 +327,7 @@ jobs:
make_package: 1
package_suffix: "-Win10"
artifact_name: Windows10-installer
qt_version: 6.6.3
qt_version: 6.6.*
qt_arch: win64_msvc2019_64
qt_modules: qtimageformats qtmultimedia qtwebsockets
cmake_generator: "Visual Studio 17 2022"
@ -381,19 +381,9 @@ jobs:
modules: ${{matrix.qt_modules}}
dir: ${{github.workspace}}
# the binaries from aqt are fat (universal), so we thin them to the target architecture to reduce the size of the packages and caches
- name: Thin Qt ${{matrix.qt_version}} libraries
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true'
run: |
export ARCH=$(uname -m)
export NPROC=$(sysctl -n hw.ncpu)
echo "::group::Thinning Qt libraries to $ARCH using $NPROC cores"
find ${{ github.workspace }}/Qt -type f -print0 | \
xargs -0 -n1 -P "$NPROC" sh -c \
'file -b --mime-type "$0" | grep -q "application/x-mach-binary" && \
echo "Processing $0" && \
lipo "$0" -thin "$ARCH" -output "$0" || true'
echo "::endgroup::"
run: .ci/thin_macos_qtlib.sh
- name: Cache thin Qt ${{matrix.qt_version}} libraries
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true'
@ -437,8 +427,6 @@ jobs:
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
DEVELOPER_DIR: '/Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer'
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
# QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action, which sets a few environment variables
QTDIR: ${{ matrix.os == 'macOS' && format('{0}/Qt/{1}/macos', github.workspace, matrix.qt_version) || '' }}
run: .ci/compile.sh --server --test --vcpkg
- name: Sign app bundle