Repository navigation
The launcher ships its build tools and Python, so a player needs no Homebrew (floor stays macOS 13) - #154
Merged
Conversation
…omebrew The release app carries zstd, glslangValidator, spirv-cross and xcodegen (Contents/Resources/tools/bin, built from pinned sources for macOS 13 with static libraries) and a relocatable CPython 3.13 with the packages the build scripts import. The dependency check prefers them to Homebrew's and to a system Python and shows 'bundled'; the build's PATH starts with them. Without a bundle (swift run, older builds) nothing changes.
The row says zstd, spirv-cross, xcodegen or glslangValidator with the detail bundled; the brew: label stays on rows that refer to a Homebrew copy (installed there, or missing with the install button).
After unpacking, the new bundle's LSMinimumSystemVersion is compared with the running macOS. Above it, nothing is installed: the update sheet and the status line say that NX2Apple <version> needs macOS <min> and this Mac has <current>, and the running version stays.
There was a problem hiding this comment.
🟡 Changes recommended
Builds can still invoke a rejected bundled Python through PATH, and user-installed packages can shadow bundled dependencies, causing failures despite a working fallback or pinned packages.
2 open issues
What changed in this PR
This PR bundles build tools and Python with the macOS launcher, removing Homebrew and Python installation from player setup while retaining the macOS 13 minimum.
Changes:
- Adds pinned tools and Python packages, with bundle assembly and validation in CI.
- Prefers bundled dependencies in detection and build environments, preserving external fallbacks.
- Blocks incompatible self-updates and adds tests, localized messages, and setup documentation.
| File | Description |
|---|---|
README.zh-CN.md |
Updates Chinese setup requirements. |
README.md |
Clarifies bundled dependencies and macOS requirements. |
frontend/tools/check_bundle.sh |
Checks tool execution, linkage, compatibility, and optional signing. |
frontend/tools/bundled-python-requirements.txt |
Pins bundled Python packages. |
frontend/tools/bundle_tools.sh |
Assembles and signs bundled tools and Python. |
frontend/Tests/NSPortBuilderTests/BundledToolsTests.swift |
Tests bundle discovery, dependency rows, PATH, and Python selection. |
frontend/Tests/NSPortBuilderTests/AppUpdateTests.swift |
Tests OS-version comparison and incompatible-update rejection. |
frontend/Sources/NSPortBuilder/UpdateSheet.swift |
Displays update failures without closing the sheet. |
frontend/Sources/NSPortBuilder/Localization.swift |
Adds bundled-tool labels and compatibility messages. |
frontend/Sources/NSPortBuilder/ContentView.swift |
Integrates bundled dependencies and update compatibility checks. |
frontend/Sources/NSPortBuilder/BundledTools.swift |
Centralizes bundle discovery and PATH construction. |
frontend/Sources/NSPortBuilder/AppUpdate.swift |
Reads and compares an update’s minimum macOS version. |
frontend/README.md |
Documents bundled tools and manual bundle checks. |
.github/workflows/build-mac-app.yml |
Assembles and validates bundles for releases and relevant pull requests. |
Review effort: Balanced
…ter, and runs without the user site
This was referenced Oct 28, 2026
Closed
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Re-proposes the bundled build tools from #121 without the macOS 26.6 floor, as promised in our comment there.
Why
The release app carries the build tools and a Python, so a player installs neither Homebrew nor Python. I have talked to a number of people on Instagram and Reddit who gave up during setup, almost always on this part and not on keys or games: installing Homebrew (Terminal, admin password, Command Line Tools),
/opt/homebrewnot writable, an Intel Homebrew on Apple silicon, a system or Homebrew Python that is too old or refusespip install(PEP 668), andbackports.zstdwith no build for Python 3.14. Each is a separate support conversation.The guided first-run setup (#119/#120) also needs it: Xcode can go through the App Store with one password prompt, but Homebrew's installer needs an interactive sudo session and refuses to run as root, so the onboarding's "preparing in the background" step cannot install it. With the tools inside the app that step is instant and needs no admin rights.
Compatibility
The floor stays at macOS 13.
Package.swift(.macOS(.v13)),LSMinimumSystemVersion(13.0) and the tools'MACOSX_DEPLOYMENT_TARGET/CMAKE_OSX_DEPLOYMENT_TARGET(13.0) are unchanged. No current user is left behind.In
NX2Apple.app/Contents/Resources:tools/bin/zstdtools/bin/glslangValidatortools/bin/spirv-crossdm/gfx/tools/spirv_cross_bin/build.shbuilds)tools/bin/xcodegen(+tools/share/xcodegen)python/install_onlyarm64)frontend/tools/bundled-python-requirements.txt)--only-binary, at build timeLicense files go to
tools/licenses. The tools are built from source with static libraries and link only/usr/lib(and, for xcodegen, the system's Swift libraries); no Homebrew bottle, noinstall_name_tool. python-build-standalone'sinstall_onlybuild isminos11.0 (checked withotool -lon every Mach-O file in it), so it fits the floor; the tools are 13.0.Size: the app zip grows from 2.6 MB to 52.2 MB (+~50 MB; tools 21 MB and Python 121 MB unpacked, 152 MB app). The release uploads the zip under three names, so the release assets grow three times.
Other changes:
BundledTools.swift: the bundledtools/binand Python fromBundle.main.resourceURL, nil outside a.app(swift run). The dependency rows say "bundled" and are named by the tool; Homebrew's copy is used when the bundle lacks one; the Homebrew row appears only when some tool is neither bundled nor installed.BuildModel.toolPath, replaces the four build-related PATH strings.PYTHONDONTWRITEBYTECODE=1, so nothing is written into the signed app.LSMinimumSystemVersionof the downloaded app and refuses to install a release the running macOS cannot open. Harmless at any floor, and it makes a later floor change safe.bundle_tools.shad-hoc signs every Mach-O file undertoolsandpythonitself (codesign --deepdoes not reach code inResources);check_bundle.shruns each tool withenv -i PATH=/usr/bin:/bin, checks the Python imports (lz4, capstone, fontTools, nsz, zstd), that nothing links outside the system or the bundle, that every Mach-O file hasminosof 13.0 or lower, andcodesign -v --deep --strict.frontend/or itself (artifact only, no release).--allow-other-metal. The[Xcode](...) 27.1link thattest_ci_toolchain.pyreads is kept..NET stays as it is (dotnet-install.sh into
~/.dotnet); Xcode, the iOS platform and the Metal toolchain are still the player's.scripts/,dm/anddocs/are untouched, andpython3 scripts/patches.py checkpasses.Relation to #150
They complement each other. #150 (merged) gives every dependency that can fail an install a named reason and the command that fixes it; this PR removes the failures that cannot be explained away from a GUI app (Homebrew, Python) by bundling them, and leaves #150's messages for what cannot be bundled: Xcode and its license, the iOS platform, the Metal toolchain, .NET and the network. They meet in
ContentView.swift, wheredetectDepsSynckeeps #150'sneedsIOSandlastError/fixHintrows and gainstoolDeps; the merge is resolved here and the two features are independent (a bundled row never fails an install, so it never shows a hint).Screenshot, left: all bundled tools and Python (rows named by the tool, "bundled", no Homebrew row). Right: the same with .NET failing, which still shows #150's reason and fix under the row.
Tests
swift build -c releaseandswift testinfrontend/: 242 tests, 7 skipped, 0 failures (includesBundledToolsTestsand the update-guard tests).bundle_tools.shandcheck_bundle.shrun locally on an Apple-silicon Mac: every check passes,minosof every Mach-O file is 11.0 (59 files) or 13.0 (3),codesign -v --deep --strictpasses on an assembled app.python3 scripts/patches.py checkpasses;test_ci_toolchainpasses.Not tested: a Mac on macOS 13 itself (checked with
otool), an Intel Mac (the app is arm64 only), a game build from the launcher with the bundled tools (no game files here).Feature, 48h
This is a feature PR: I leave it open for 48 hours for objections before it is treated as ready to merge. It changes the launcher and its release workflow only.