Repository navigation
Launcher: update the build tools when the app opens - #60
Merged
Merged
Conversation
The repository checkout the launcher builds with stays where it was until someone presses Pull, so a checkout days behind builds with tools main had already fixed: it was 208 commits behind and its spirv-cross had no x bit (fixed by LNPANDY#41), so an iPhone build stopped at once. When the app opens, the check it already ran (fetch, count the commits behind origin/main) now fast-forwards the checkout when it is behind: only on main, with no changes to tracked files and no build running, so a checkout someone works in is never touched (a pull that would overwrite an untracked file fails as a fast-forward and says so). Settings has a switch for it (on by default) and says what happened or why not; the library's activity line names the new commits for the session ("Build tools updated: 208 new commits"). RepoAutoUpdateTests uses a local bare repository as origin: a clean checkout on main is fast-forwarded, one with a local change is left as it is, and only main without tracked changes may be moved.
v0lumehi
force-pushed
the
repo-auto-pull
branch
from
October 27, 2026 11:51
fb33179 to
66a2610
Compare
LNPANDY
added a commit
that referenced
this pull request
Oct 27, 2026
The update machinery was already here — checkAppUpdate finds the newest release, performAppUpdate downloads it, swaps the bundle and relaunches — but the only signal was a status line naming a tag. A user whose app worked had no way to judge whether the new version mattered, so "Update to v0.4.8" was a leap of faith, and most people took the leap only when something broke. Now a found update opens a sheet: the version they have, the one on offer, the release notes for their interface language, Open the release page, Later, and Update now. It opens from the launch check and from Check for updates, so an old install learns what changed without visiting GitHub. The notes are the release body, which this project writes in both languages (docs/RELEASE-NOTES-GUIDE.md). UpdateSheet.lines splits them by the `**中文**` / `**English**` markers rather than by looking for Han characters — the first version did the latter and handed an English reader the Chinese paragraph, because that line contains both. A body with no markers is shown whole instead of being split in half. Six tests cover the split, including the two cases that failed on the first attempt (a monolingual body, and inline **bold** inside a marked paragraph). Checked against the real v0.4.7 body: 19 lines each way, aligned. appVersion 0.4.7 → 0.4.8: today's merges (#28, #48, #54–#57, #59, #60 and the #52/#53 fixes) were shipping under a version number that also names the 0.4.7 release, so a bug report could not say which one it came from.
v0lumehi
added a commit
to v0lumehi/NX2Apple
that referenced
this pull request
Oct 27, 2026
…build (LNPANDY#65) A game built last month keeps running on the host, rewriter and shaders of last month, whatever the checkout has fixed since: the automatic pull (LNPANDY#60) brings the fixes into the repository, not into the games already built. Nothing in the library said which games a pull had left behind (idea from seedds/nxnative#209). A finished build now records the checkout's commit in its library entry (toolsCommit, taken when the build starts; only for a git checkout, and decoded with decodeIfPresent, so older library files load). When the checkout has moved on, ToolsAge runs `git diff --name-only <commit> HEAD` off the main thread and marks a game when a file a build reads changed: dm/host, dm/gfx, dm/tools, dm/ios, dm/mac, dm/third_party, the build script, game.py, profile_guess.py, the launch settings, and the game's own profile (dm/games/<title ID>/), without notes (*.md) and tests. One diff per recorded commit; it runs when the app opens, after a clone, pull or update check finished (the automatic pull among them), when the checkout changes and after a build was recorded, not on a render. A game with no recorded commit, or a commit the checkout does not have, shows nothing. A marked game's card says "Older tools" beside its status, the hero "Built with older tools" with a Rebuild button, and Manage's Build again reads "Rebuild with current tools…"; both open the game's build as Build again does. Checked: swift build -c release; swift test, 54 tests (OlderToolsTests uses a local git repository: a change under dm/host marks the game, a docs-only change does not, a game without a recorded commit is not marked, another game's profile does not count, an unknown commit marks nothing, the check publishes off the main thread, and an old library file loads); the visual QA renders library-older-tools at 1440 and 900 points wide.
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.
The launcher builds from its own repository checkout, and that checkout stays where it was until someone presses Pull. Builds from an old checkout use tools that main has already fixed. Mine was 208 commits behind: its
spirv-crossstill had no x bit (#41), so an iPhone build stopped right away withspirv-cross is missing or not executable.Change
On launch. The launcher already runs a silent check when the app opens (
git fetch, then count the commits behindorigin/main). When the checkout is behind, it now fast-forwards it (git pull --ff-only origin main), but only when all of these hold:main;So a checkout someone is working in is never touched. A pull that would overwrite an untracked file fails as a fast-forward and reports it.
Settings. A switch, Update automatically when the app opens, on by default. The status line under the build tools says what happened, or why nothing did ("the checkout has local changes or is not on main").
Library. For the rest of the session, the activity line names the new commits: "Build tools updated: 208 new commits".
Checked
swift test: 26 tests pass.RepoAutoUpdateTests, with a local bare repository asorigin:mainwithout tracked changes may be moved.Note: with #59 open, this would also have pulled main's current
patch_nso.pyNameError. That is a reason to merge #59 first, not a reason against updating.