Skip to content

WIP: Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs#12562

Merged
SoftFever merged 3 commits into
mainfrom
feature/mac_parallel
Mar 3, 2026
Merged

WIP: Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs#12562
SoftFever merged 3 commits into
mainfrom
feature/mac_parallel

Conversation

@SoftFever

Copy link
Copy Markdown
Collaborator

Description

Screenshots/Recordings/Graphs

Tests

Copilot AI review requested due to automatic review settings March 2, 2026 11:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -u target) and implement bundle-wide universalization via a lipo_dir helper.
  • Update the reusable build_orca.yml workflow 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.yml to 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.

Comment thread build_release_macos.sh
Comment on lines +256 to +260
function lipo_dir() {
local universal_dir="$1"
local arm64_dir="$2"
local x86_64_dir="$3"

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines 4 to 9
cache-key:
required: true
required: false
type: string
cache-path:
required: true
required: false
type: string

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
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)

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines 76 to +85
- 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 {} +)

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +42
# 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 }}

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread build_release_macos.sh
T )
export BUILD_TESTS="1"
;;
u )

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 8ee7e33. ± Comparison against base commit b908bab.

♻️ This comment has been updated with latest results.

@SoftFever SoftFever merged commit b7033a4 into main Mar 3, 2026
19 checks passed
@SoftFever SoftFever deleted the feature/mac_parallel branch March 3, 2026 11:30
dbaarda pushed a commit to dbaarda/OrcaSlicer that referenced this pull request Mar 3, 2026
* 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)
  ...
SoftFever added a commit that referenced this pull request Mar 3, 2026
…eparate jobs (#12562)

* Parallelize macOS CI builds by splitting arm64 and x86_64 into separate jobs

* fix shell errors

* Delete intermediate per-arch artifacts
Xipit pushed a commit to Xipit/OrcaSlicer that referenced this pull request Mar 16, 2026
…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
davidjdixon pushed a commit to davidjdixon/OrcaSlicer that referenced this pull request Mar 21, 2026
…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
davidjdixon pushed a commit to davidjdixon/OrcaSlicer that referenced this pull request Apr 6, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants