Skip to content

Commit 56ec30e

Browse files
committed
fix: remove DYLD_LIBRARY_PATH from launcher to fix SIGBUS on macOS
DYLD_LIBRARY_PATH overrides the system OpenGL framework globally, poisoning NSOpenGLContext used by SDL2's Cocoa backend. This caused a SIGBUS in +[NSOpenGLContext currentContext] during window creation. Libraries now resolve via @executable_path entries in Mach-O load commands and @rpath from the engine binary's LC_RPATH, which are scoped to the engine's own load chain and don't affect the system frameworks.
1 parent cd8c0bb commit 56ec30e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/macos-build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,11 @@ jobs:
388388
if [ ! -e "\$GAMES_LINK" ]; then
389389
ln -s "\$GAME_DIR/games" "\$GAMES_LINK"
390390
fi
391-
# The engine needs to find its bundled Mesa + Vulkan libs.
392-
export DYLD_LIBRARY_PATH="\$RES/lib:\${DYLD_LIBRARY_PATH:-}"
393-
export DYLD_FRAMEWORK_PATH="\$RES/lib:\${DYLD_FRAMEWORK_PATH:-}"
391+
# Do NOT set DYLD_LIBRARY_PATH — it overrides the system OpenGL
392+
# framework globally, breaking NSOpenGLContext inside SDL2's
393+
# Cocoa backend (SIGBUS in +[NSOpenGLContext currentContext]).
394+
# Libraries resolve via @executable_path entries in load commands
395+
# and @rpath from the engine binary's LC_RPATH instead.
394396
# Mesa EGL on macOS must use the surfaceless platform because
395397
# there is no X11 display server. Without this, eglInitialize
396398
# tries to connect to xcb and fails with EGL_NOT_INITIALIZED.

0 commit comments

Comments
 (0)