From 063fa5bb7c04e80dc98de5c4860b3f7dc01385ca Mon Sep 17 00:00:00 2001 From: Bitcoin3us <115934595+bitcoin3us@users.noreply.github.com> Date: Sat, 29 Aug 2026 15:43:14 +0100 Subject: [PATCH] builder/unix: check out SDL release-2.32.8 instead of 2.30.2 SDL 2.30.2 no longer compiles on macOS with current Xcode Command Line Tools (macOS 26 SDK): with SDL_OPENGL=OFF, SDL_cocoawindow.m messages the forward-declared SDLOpenGLContext in windowDidChangeScreen:, and newer clang promotes 'receiver type for instance message is a forward declaration' to a hard error: src/video/cocoa/SDL_cocoawindow.m:938:14: error: receiver type 'SDLOpenGLContext' for instance message is a forward declaration Upstream SDL fixed this on the SDL2 maintenance line in libsdl-org/SDL commit 0b6eff41 ('Fixed building on macOS with OpenGL disabled'), first released in 2.32.0; the frozen 2.30.x branch never received it. Check out release-2.32.8 (bugfix-only continuation of the SDL2 line), fetching tags first for clones that predate the tag. Verified: 'build_mpos.sh macOS' fails at the above error with 2.30.2 and builds cleanly with 2.32.8 on macOS 26 CLT; the resulting binary boots MicroPythonOS and runs apps normally. Co-Authored-By: Claude Fable 5 (cherry picked from commit 2e19d680ff39247fddbb84c4a013cf3c7cdb829a) --- builder/unix.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/builder/unix.py b/builder/unix.py index 1316298c..0fae0005 100644 --- a/builder/unix.py +++ b/builder/unix.py @@ -209,7 +209,15 @@ def submodules(): ] _run(cmd_) - cmd_ = ['cd lib/SDL && git checkout release-2.30.2'] + # 2.32.8 is the SDL2 maintenance line with "Fixed building on macOS with + # OpenGL disabled" (libsdl-org/SDL 0b6eff41): 2.30.2 fails to compile + # against recent Xcode SDKs because SDL_cocoawindow.m messages the + # forward-declared SDLOpenGLContext when SDL_OPENGL is off, which newer + # clang treats as an error. Fetch first for clones that predate the tag. + cmd_ = [ + 'cd lib/SDL && git checkout release-2.32.8 2>/dev/null ' + '|| (git fetch --tags && git checkout release-2.32.8)' + ] _run(cmd_) return_code, _ = spawn(submodules_cmd)