WIP: Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs#12562
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restructures macOS CI to build arm64 and x86_64 in parallel and then create a universal app bundle by combining the two outputs, reducing end-to-end macOS build time.
Changes:
- Add a dedicated “universal combine” mode to
build_release_macos.sh(new-utarget) and implement bundle-wide universalization via alipo_dirhelper. - Update the reusable
build_orca.ymlworkflow to (a) build per-arch macOS bundles and upload them as artifacts and (b) optionally run in a “combine-only” mode that downloads both bundles and builds the universal bundle. - Make macOS deps caching/build outputs architecture-specific and adjust
build_all.ymlto run separate macOS arch jobs plus a final universal combine job.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| build_release_macos.sh | Adds -u universal-only target and a directory-wide lipo routine to build universal app bundles from prebuilt arch bundles. |
| .github/workflows/build_orca.yml | Introduces macos-combine-only flow, adds bundle artifact upload/download, and gates signing/DMG creation to the combine-only job. |
| .github/workflows/build_deps.yml | Switches macOS deps build/cleanup to be per-arch rather than universal-in-one-job. |
| .github/workflows/build_check_cache.yml | Makes macOS cache keys/paths arch-specific to match per-arch deps builds. |
| .github/workflows/build_all.yml | Splits macOS into parallel arch jobs and adds a universal-combine job; separates Windows into its own job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function lipo_dir() { | ||
| local universal_dir="$1" | ||
| local arm64_dir="$2" | ||
| local x86_64_dir="$3" | ||
|
|
There was a problem hiding this comment.
lipo_dir() takes an arm64_dir parameter but never uses it. This makes the call sites harder to understand and can confuse future changes. Either remove the unused parameter or use it (e.g., lipo from $arm64_dir/$rel instead of the already-modified universal copy).
| cache-key: | ||
| required: true | ||
| required: false | ||
| type: string | ||
| cache-path: | ||
| required: true | ||
| required: false | ||
| type: string |
There was a problem hiding this comment.
cache-key/cache-path were made optional, but the workflow still unconditionally uses them in the cache restore step for non-macos-combine-only runs. If a caller omits these inputs, actions/cache will likely fail with an empty key/path. Consider keeping them required and passing dummy values for combine-only, or gating the cache step on both inputs being non-empty (and failing fast with a clear message if they are missing).
| run: | | ||
| mkdir -p build/arm64 build/x86_64 | ||
| arm_bundle=$(find "${{ github.workspace }}/mac_bundles/arm64" -name '*.tar.gz' -print -quit) | ||
| x86_bundle=$(find "${{ github.workspace }}/mac_bundles/x86_64" -name '*.tar.gz' -print -quit) |
There was a problem hiding this comment.
In the combine-only path, arm_bundle/x86_bundle are discovered via find ... -print -quit and then used directly in tar -xzvf. If download-artifact doesn’t produce a *.tar.gz (name mismatch, empty artifact, etc.), this fails with a less actionable tar error. Consider explicitly checking that both variables are non-empty and exiting with a clear error message before extracting.
| x86_bundle=$(find "${{ github.workspace }}/mac_bundles/x86_64" -name '*.tar.gz' -print -quit) | |
| x86_bundle=$(find "${{ github.workspace }}/mac_bundles/x86_64" -name '*.tar.gz' -print -quit) | |
| if [ -z "$arm_bundle" ] || [ -z "$x86_bundle" ]; then | |
| echo "Error: Missing macOS app bundle archive(s) for combine-only build." | |
| if [ -z "$arm_bundle" ]; then | |
| echo " No .tar.gz bundle found in '${{ github.workspace }}/mac_bundles/arm64'." | |
| fi | |
| if [ -z "$x86_bundle" ]; then | |
| echo " No .tar.gz bundle found in '${{ github.workspace }}/mac_bundles/x86_64'." | |
| fi | |
| echo "Ensure that the arm64 and x86_64 artifacts were successfully uploaded and downloaded before combining." | |
| exit 1 | |
| fi |
| - name: Build on Mac ${{ inputs.arch }} | ||
| if: contains(inputs.os, 'macos') | ||
| working-directory: ${{ github.workspace }} | ||
| run: | | ||
| if [ -z "${{ vars.SELF_HOSTED }}" ]; then | ||
| brew install automake texinfo libtool | ||
| fi | ||
| ./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-1' || '' }} -a universal -t 10.15 | ||
| for arch in arm64 x86_64; do | ||
| (cd "${{ github.workspace }}/deps/build/${arch}" && \ | ||
| find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +) | ||
| done | ||
| ./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15 | ||
| (cd "${{ github.workspace }}/deps/build/${{ inputs.arch }}" && \ | ||
| find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +) |
There was a problem hiding this comment.
The macOS deps build now assumes inputs.arch is always set (-a ${{ inputs.arch }} and deps/build/${{ inputs.arch }}), but arch is still an optional workflow input. If os is macOS and arch is omitted, this will build into an incorrect path (or pass an empty -a argument). Consider enforcing arch for macOS runs (via documentation + a validation step that exits early when missing).
| # Keep macOS cache keys and paths architecture-specific. | ||
| cache-os: ${{ contains(inputs.os, 'macos') && format('macos-{0}', inputs.arch) || inputs.os }} | ||
| dep-folder-name: ${{ contains(inputs.os, 'macos') && format('/{0}', inputs.arch) || '/OrcaSlicer_dep' }} | ||
| output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}} | ||
| run: | | ||
| echo cache-key=${{ env.cache-os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }} | ||
| echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }} |
There was a problem hiding this comment.
For macOS, the cache key/path are now derived from inputs.arch (macos-${arch} and deps/build/${arch}), but arch is an optional input. If a macOS caller forgets to pass arch, this will produce macos- cache keys and deps/build/ paths that can collide across builds. Consider validating inputs.arch when inputs.os is macOS and failing early with a clear error.
| T ) | ||
| export BUILD_TESTS="1" | ||
| ;; | ||
| u ) |
There was a problem hiding this comment.
-u sets BUILD_TARGET=universal but does not enforce ARCH=universal. If someone runs ./build_release_macos.sh -u without -a universal, the universal bundle will be created under build/$ARCH (and may overwrite an arch build). Consider making -u imply ARCH=universal or validate/exit unless ARCH is universal.
| u ) | |
| u ) | |
| # Ensure ARCH is compatible with a universal build | |
| if [ -n "${ARCH:-}" ] && [ "${ARCH}" != "universal" ]; then | |
| echo "Error: -u (universal build) requires ARCH=universal, but ARCH='${ARCH}' was specified." >&2 | |
| exit 1 | |
| fi | |
| export ARCH="universal" |
* upstream/main: (34 commits) Fix Bambu LAN printing with legacy network plugin (OrcaSlicer#12582) WIP: Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs (OrcaSlicer#12562) VOLUMIC profils updates (OrcaSlicer#12565) Fix wiki redirection (OrcaSlicer#12569) Fix Celsius symbol not showing on G-code viewer (OrcaSlicer#12567) Revert "Revert "Set NSWindow color space to sRGB on macOS"" (OrcaSlicer#12546) Improve and complement the pt-BR translation (OrcaSlicer#12550) fix build errors on Linux with Clang 20 and GTK warnings (OrcaSlicer#12507) Fix "Glidlines" "gridlines locale (OrcaSlicer#12529) fix: typo "Glidlines" → "Gridlines" in View menu tooltip (OrcaSlicer#12527) Fix missing infill layers (fill_surface_by_multilines & fill_surface_trapezoidal bug fix) (OrcaSlicer#12516) fix missing translations for Canvas Toolbar Menu update profile version update locale Add option for hiding / showing gridlines (OrcaSlicer#10545) update locale and Simplified/Tranditional Chinese translation Enhancement: Enabling base patterns (infill) for Organic supports (OrcaSlicer#12141) I18n: Preview translations minor fix (Ukrainian) (OrcaSlicer#12504) update locale Fix: Init Serialized options (OrcaSlicer#12489) ...
…eparate jobs (#12562) * Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs * fix shell errors * Delete intermediate per-arch artifacts
…eparate jobs (OrcaSlicer#12562) * Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs * fix shell errors * Delete intermediate per-arch artifacts
…eparate jobs (OrcaSlicer#12562) * Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs * fix shell errors * Delete intermediate per-arch artifacts
…eparate jobs (OrcaSlicer#12562) * Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs * fix shell errors * Delete intermediate per-arch artifacts
Description
Screenshots/Recordings/Graphs
Tests