Repository navigation
PM-227 Fixed MacOS builds for intel using Rosetta2 - #8
Merged
MostafaNanticock merged 21 commits intoApr 18, 2026
Merged
Conversation
Prefix CMake, build and test commands with an ARCH_PREFIX env var and set that var on macOS to force x86_64 execution. The macOS workflow now installs Rosetta (ignoring the non-zero exit when already installed) and writes "ARCH_PREFIX=arch -x86_64" to GITHUB_ENV so Qt6's CMake config sees the expected host architecture and avoids ARM64/x86_64 mismatches. Build steps remain no-op when ARCH_PREFIX is unset.
Clarify Rosetta install and adjust how x86_64 Qt is used on ARM runners. Remove the previous ARCH_PREFIX approach and instead set CMAKE_ARCH_FLAGS in the environment to force CMAKE_OSX_ARCHITECTURES=x86_64 and disable Qt's architecture check (QT_NO_FORCE_ARCHITECTURE_CHECK=TRUE). This lets cmake run natively on ARM64 while producing x86_64 outputs and allowing Qt tools/tests to run under Rosetta.
Introduce a new workflow input cmake_extra_flags (string, default empty) in .github/workflows/_build-shared.yml and pass it through to the cmake configure command. Update .github/workflows/macos.yml to set cmake_extra_flags to add -weak_framework AGL for executable and shared linker flags so builds using Qt6 prebuilt binaries won't fail when AGL.framework is missing on newer macOS versions.
Replace the previous weak-link workaround with a scripted Qt install using aqtinstall in the macOS CI workflow. The job now creates a venv, installs aqtinstall, resolves the best matching Qt release for the requested version, installs Qt into $HOME/Qt, and exports QT paths to the environment. For Qt 6, it also patches installed CMake files to remove embedded "-framework AGL" references (AGL was removed from macOS 10.15 and is absent on newer runners) so builds do not link against a missing framework. This keeps Qt5 behavior unchanged and avoids linker-time weak-linking hacks.
Replace the broken qt_install_script conditional approach with the proven qt_arch:clang_64 approach using jurplel/install-qt-action@v4. The qt_install_script == '' condition in GitHub Actions reusable workflows incorrectly evaluates to false for unset optional inputs, causing Install Qt (custom) to run instead of Install Qt for all build-macos-intel jobs. The working approach: - Use macos-latest (ARM64) for all Intel builds - Pass qt_arch: clang_64 to install x86_64 Qt via jurplel - Install Rosetta 2 on ARM64 runners to execute x86_64 test binaries - Set CMAKE_OSX_ARCHITECTURES=x86_64 via osx_arch_flag step output - Remove build-macos-intel-qt6-rosetta (no longer needed) - Remove macos-26-intel runner dependency
Expose a qt_arch input and add a new optional setup_env_script input to the reusable workflow so callers can run an environment setup script after Qt install and before CMake configure. Remove the previous osx_arch_flag logic and the built-in Rosetta install; instead the workflow runs setup_env_script only when provided. Update the macOS workflow to set qt_arch to clang_64 and supply a setup_env_script that installs Rosetta and sets CMAKE_OSX_ARCHITECTURES via GITHUB_ENV for Intel cross-compilation on ARM runners.
MostafaNanticock
deleted the
PM-227-Fix-Failing-CI-CD-intel-MacOS-pipeline
branch
April 18, 2026 15:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.