Repository navigation
Launcher: never save the shell root at the root of a volume (#492) - #493
Conversation
resolveRoot() saves <parent>/NX2Apple-shell the first time it runs. The
Settings page reads that path before a game or output folder is chosen, so
the parent was "" and the saved root became /NX2Apple-shell on the read-only
system volume. Every later build failed at the last step ("Macintosh HD" is
read-only) after the whole build.
The Settings row now previews the root and saves nothing, an empty, "/" or
relative parent falls back to the home folder, a saved root at a volume root
is repaired, and a build checks that the shell folder can be written before
it starts, naming the folder to change.
The assertion split the English template on ": " to cut off the tool's error. A Chinese macOS formats the sentence with a full-width colon, so the split kept the whole sentence and the test ran red on main there (CI is English), which stopped every push from that Mac at the pre-push hook. Mark the error slot instead: the cut then works in every language.
frontend-qt/gen_localization.py keeps nspb_qt/localization.py in step with Localization.swift; the new key makes the Qt front end's check fail until the generated table carries it.
|
I read the diff. The fix is right. The empty parent was the cause, the preview no longer saves anything, a saved Two small points. Neither blocks the merge:
This lands on @LNPANDY I think this belongs in v1.0.1. The bug is in 1.0.0 and the build fails only at the last step, after the whole build. The change is small and tested. It would mean a third release candidate. I set the milestone to v1.0.1 and you can move it. Is that OK for you? |
Port of #493 (ShellRoot.swift, a BuildModel extension) into the stores: shellCachePath, shellRootParent, shellRoot and shellRootProblem() now live in BuildStore+ShellRoot.swift, the preflight is called in BuildStore+Run.swift before the long steps. ShellLibrary and ShellInstall changes of #493 applied to NXCore/ShellInstall.swift (package access). ContentView.swift keeps this branch's version (BuildModel is gone).
Fix or feature
What and why
A user's iPhone build failed at 准备共用应用 with "You can't save the file 'NX2Apple-shell' because 'Macintosh HD' is a read-only volume" (#492).
ShellLibrary.resolveRootcomputes<parent>/NX2Apple-shelland saves it on its first call. The Settings page shows the shell cache path before a game or output folder is chosen, so the first call could haveparent == "";("" as NSString).deletingLastPathComponentis"", and the saved root became/NX2Apple-shell, at the root of the read-only system volume. Every later build used it and only failed at the last step, after the whole build.ShellLibrary.previewRoot(ShellRoot.swift): the Settings row previews the root and saves nothing.ShellLibrary.resolveRoot: an empty,/or relative parent falls back to the home folder; a saved root at a volume root (/NX2Apple-shell) is repaired and replaced.ShellInstall.canWriteRoot: a build checks its shell folder before its long steps and stops withshell.rootUnwritable(five languages) naming the folder, instead of failing at the end.defaults delete org.nxnative.NSPortBuilder shellRootworkaround is in the issue for anyone who wants it now.frontend-qt/nspb_qt/localization.py: the Qt front end's check requires its table to carry every key.ShellInstallTestslanguage-independent: it split the English template on": ", so it ran red on a Chinese macOS (full-width colon) and stopped every push at the pre-push hook. Unrelated to Shared-app build fails at the last step on a read-only volume: a saved shell root of /NX2Apple-shell #492, but needed to run the suite on this machine; CI never saw it (English).SourceSizeTests:ContentView.swiftandLocalization.swiftstay within their line budget — the BuildModel members moved toShellRoot.swift, and four wrapped localization entries were joined (formatting only).Fixes #492
Checked
cd frontend && swift test→ 701 tests, 17 skipped, 0 failures (macOS 26.6.2, Chinese UI)/NX2Apple-shell)testRootNeedsAWritableParentand the empty-parent/repair tests.Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Status