Skip to content

builder/unix: check out SDL release-2.32.8 to fix macOS builds on current Xcode CLT - #605

Open
bitcoin3us wants to merge 1 commit into
lvgl-micropython:mainfrom
bitcoin3us:fix/sdl-2-32-8-upstream
Open

builder/unix: check out SDL release-2.32.8 to fix macOS builds on current Xcode CLT#605
bitcoin3us wants to merge 1 commit into
lvgl-micropython:mainfrom
bitcoin3us:fix/sdl-2-32-8-upstream

Conversation

@bitcoin3us

Copy link
Copy Markdown

Fixes #601.

builder/unix.py force-checks-out SDL release-2.30.2 on every unix/macOS build. SDL 2.30.2 no longer compiles on macOS with current Xcode Command Line Tools:

src/video/cocoa/SDL_cocoawindow.m:938:14: error: receiver type 'SDLOpenGLContext'
for instance message is a forward declaration

The SDL build runs with SDL_OPENGL=OFF, so SDLOpenGLContext's @interface (guarded by SDL_VIDEO_OPENGL_CGL) is never seen — only the @class forward declaration — and windowDidChangeScreen: messages it unguarded. Older clang warned; the current CLT makes it a hard error, so any Mac with up-to-date tools can no longer build the desktop binary.

Upstream SDL fixed exactly this on the SDL2 maintenance line (libsdl-org/SDL@0b6eff41, "Fixed building on macOS with OpenGL disabled", first in 2.32.0). This moves the checkout to release-2.32.8, with a git fetch --tags fallback for clones that predate the tag. Verified: macOS desktop build succeeds with 2.32.8 where 2.30.2 fails; Linux unaffected beyond the tag change.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
(cherry picked from commit 2e19d68)
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.

macOS build broken with current Xcode CLT: SDL 2.30.2 fails to compile (SDL_cocoawindow.m forward-declaration error)

1 participant