Skip to content

Add native macOS (Apple Silicon) support#102

Open
nelkonandparker wants to merge 1 commit into
PathOfBuildingCommunity:masterfrom
nelkonandparker:macos-support
Open

Add native macOS (Apple Silicon) support#102
nelkonandparker wants to merge 1 commit into
PathOfBuildingCommunity:masterfrom
nelkonandparker:macos-support

Conversation

@nelkonandparker

@nelkonandparker nelkonandparker commented May 24, 2026

Copy link
Copy Markdown

Support mac-os (apple silicon) as a target. No workflow addition (would be a follow up PR). This doesn't actually result in any mac specific libs being built, as I didn't want to pollute the workflow in this PR

I've got a 'launcher'/'application' repo (with fork specific workflows) which uses the resulting dylibs to build into a final application:
https://github.com/nelkonandparker/PathOfBuilding-PoE2-macOS

Full disclosure - this was built in conjunction with Claude - but not pure vibe coded. I've reviewed and adjusted much of it once I broke the back of the problem.

Notable Changes (non-exhaustive)

LuaJIT:
Bumped to include arm64 mcode_alloc fixes. See: LuaJIT/LuaJIT#285
Without this, the resulting mac build had significant performance issues

Retina:
Changed the relevant cursor coordinates to support retina displays. Otherwise mouseclicks, and tooltip rendering windows were being cut off.

Clang:
Support for clang compilation, whilst maintaining MSVC

Verification

Built on OS X 26.5, and on Win. Both result in success and a working application

@nelkonandparker nelkonandparker marked this pull request as ready for review May 24, 2026 18:40
@nelkonandparker nelkonandparker marked this pull request as draft May 24, 2026 18:43
Support mac-os (apple silicon) target. Step 1 of 2 that results in a native Apple application

Full disclosure - this was built with conjunction with Claude - but not pure vibe coded. I've reviewed and adjusted much of it once I broke the back of the problem. Locally I have a full working app, which will be delivered by a subsequent PR for PathOfBuilding-PoE2.

## Notable Changes (non-exhaustive)

**LuaJIT:**
Bumped to include arm64 mcode_alloc fixes. See: LuaJIT/LuaJIT#285
Without this, the resulting mac build had significant performance issues

**Retina:**
Changed the relevant cursor coordinates to support retina displays. Otherwise mouseclicks, and tooltip rendering windows were being cut off.

**Clang:**
Support for clang compilation, whilst maintaining MSVC

## Verification
Built on OS X 26.5, and on Win. Both result in success and a working application
@nelkonandparker nelkonandparker marked this pull request as ready for review May 24, 2026 18:50
braggpd pushed a commit to braggpd/PathOfBuilding-SimpleGraphic that referenced this pull request Jun 17, 2026
…JIT-fix approach

Replace the custom-allocator + module-bisecting workaround stack with the
upstream macOS approach from PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic
PR PathOfBuildingCommunity#102, which fixes the arm64/GC64 allocation problem at the source by
pinning a patched LuaJIT (port 2026-03-30_1, ref 18b087cd) rather than
working around it in the engine.

Removed (no longer needed once LuaJIT is fixed correctly):
- mac_gc64_alloc custom allocator + magic sentinel (ui_main.cpp)
- mac_pload_* / bisect / coroutine module-loading machinery (~1050 lines
  across ui_api.cpp and ui_main.cpp) that worked around Data.lua load
  failures, themselves a symptom of the same GC64 bug
- sys_IMain::launchCwd and the host argv handling in sys_main.cpp
- mac/entry.cpp (win/entry.cpp already compiles on macOS via its
  visibility macros and _WIN32 guards, matching upstream)

Adopted from PR PathOfBuildingCommunity#102:
- Patched LuaJIT vcpkg port (2026-03-30_1) + arm64-osx triplet + version
  files; baseline bumped to 2026-05-22
- AppendLocalLuaSubdir() replacing inline package.path logic
- Retina/HiDPI cursor scaling + GLFW_ANGLE_PLATFORM_TYPE_METAL (sys_video.cpp)
- .app bundle base-path detection (sys_main.cpp)
- Portable std::this_thread::sleep_for and size_t casts (r_main/r_texture)
- VirtualScreenHeight() in r_font; base64/common include + guard fixes
- Lua-cURLv3 luaL_setfuncs patch + CMake patch-application; WIN32-guarded
  lua-utf8/luasocket; ZSTD target selection

Retained (our only divergence, additive and APPLE-guarded):
- pob-host launcher executable (mac/host.cpp -> "Path of Building-PoE2")
  that links the dylib for a runnable dev binary; upstream defers this to
  a separate launcher repo. The host shifts argv itself so the engine
  stays identical to upstream.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E69xvgJuYgUaR1eHY3Qf3o
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.

1 participant