Skip to content

fix(macos): support macOS Tahoe (15+) SDK build#12

Open
claudiojara wants to merge 2 commits into
FULU-Foundation:mainfrom
claudiojara:main
Open

fix(macos): support macOS Tahoe (15+) SDK build#12
claudiojara wants to merge 2 commits into
FULU-Foundation:mainfrom
claudiojara:main

Conversation

@claudiojara

Copy link
Copy Markdown

Summary

Two minimal fixes so local macOS builds work on macOS 15+ (Sequoia/Tahoe) with current Xcode SDKs. Plus a small helper script for local DMG packaging.

What breaks today

On a clean macOS 15+ checkout, ./build_release_macos.sh -d -a arm64 fails twice:

1. Autotools deps cannot find libSystem

GMP / MPFR are built via cmake ExternalProject_Add which forks configure — autotools does not inherit CMAKE_OSX_DEPLOYMENT_TARGET, and the macOS 15+ SDK requires SDKROOT to be set explicitly:

ld: library 'System' not found
cc: error: linker command failed with exit code 1
configure: error: could not find a working compiler

Fix (build_release_macos.sh): auto-export SDKROOT="$(xcrun --show-sdk-path)" when unset. Harmless on older SDKs (xcrun returns the path regardless).

2. clang on SDK 26 rejects constexpr enum-cast in wxMediaCtrl2.h

// src/slic3r/GUI/wxMediaCtrl2.h:41
static constexpr wxMediaState MEDIASTATE_BUFFERING = (wxMediaState) 6;
//                                                  ^ value 6 is outside [0,3]

Older clang accepted the out-of-range cast in a constexpr context. Current clang (with the macOS 15+ SDK) rejects it: constexpr variable 'MEDIASTATE_BUFFERING' must be initialized by a constant expression.

Fix (wxMediaCtrl2.h): mirror the existing working pattern in src/slic3r/GUI/MediaPlayCtrl.h:74static inline const wxMediaState ... = static_cast<wxMediaState>(6). Identical runtime behavior, no constexpr requirement.

Extras

  • .gitignore: ignore .tools/ (project-local CMake), dist/ (downloaded releases), tools/pjarczak_bambu_linux_host/runtime/ (generated output)
  • package_macos_dmg.sh (new): wraps hdiutil to produce an unsigned DMG from a prebuilt .app, mirroring the CI flow. Auto-detects arch (arm64/x86_64/universal), reads version from version.inc, strips com.apple.provenance xattrs that confuse hdiutil on macOS 15+. Pure dev-side helper; safe to drop if not desired.

Verified

  • Built locally on macOS 15 Apple Silicon with Xcode 26.5 SDK (deps in 12m42s, slicer in 20s incremental)
  • Re-ran build_macos_bridge.yml on my fork (https://github.com/claudiojara/OrcaSlicer-bambulab/actions/runs/25776649189) — all four jobs passed, produced 237 MB universal DMG identical in size to the v1.0.0 release artifact
  • No behavior change on Linux/Windows paths (build_release_macos.sh is macOS-only; wxMediaCtrl2.h change is functionally equivalent)

Test plan

  • Maintainer reviews diff (16 insertions, 1 deletion across 3 tracked files + 1 new helper)
  • CI run on this branch passes
  • Local build attempt on macOS 15+ Apple Silicon succeeds without manual env wrangling

🤖 Related debugging session also surfaced an Apple Silicon runtime issue with pjarczak_bambu_linux_host that is unrelated to these build fixes; filing a separate issue with the stack trace.

- build_release_macos.sh: auto-export SDKROOT from xcrun so autotools deps
  (GMP, MPFR) find libSystem on macOS 15+ SDKs
- wxMediaCtrl2.h: replace constexpr+enum-cast with inline const (mirrors
  the pattern already in MediaPlayCtrl.h:74) - fixes clang error on SDK 26+
- .gitignore: add .tools/ (project-local CMake), dist/ (downloaded releases),
  tools/pjarczak_bambu_linux_host/runtime/ (generated)
package_macos_dmg.sh wraps hdiutil to produce an unsigned DMG from a
prebuilt .app bundle, mirroring the CI flow for developers iterating on
macOS. Auto-detects arch (arm64/x86_64/universal), reads version from
version.inc, includes OrcaSlicer_profile_validator.app when present, and
strips com.apple.provenance xattrs that confuse hdiutil on macOS 15+.
@claudiojara

Copy link
Copy Markdown
Author

Suggested label (couldn't add as external contributor): bug.

@seuros

seuros commented May 13, 2026

Copy link
Copy Markdown

The fact that you used Claude to ship this PR is funny. Now Bambulab can sue Anthropic.

This PR is correct. 🚢 it.

stephanGarland pushed a commit to stephanGarland/OrcaSlicer-bambulab that referenced this pull request May 13, 2026
Backport of PR FULU-Foundation#12 from upstream FULU-Foundation/OrcaSlicer-bambulab,
authored by Claudio Jara <claudiojaraf@gmail.com>.

Two build failures on macOS 15+ with current Xcode SDKs:

1. Autotools deps (GMP/MPFR) via ExternalProject_Add don't inherit
   CMAKE_OSX_DEPLOYMENT_TARGET. Fix: auto-export SDKROOT from
   `xcrun --show-sdk-path` when unset, so the configure step finds the
   active SDK.

2. Clang in SDK 26+ rejects the out-of-range enum cast in the constexpr
   initializer of MEDIASTATE_BUFFERING. Replace `static constexpr` with
   `static inline const`, mirroring the pattern already used elsewhere.

Original PR: FULU-Foundation#12
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