Repository navigation
patch_nso.py: every rewrite stops with a NameError on main (TEXT_LO); the NRO header skip as seedds/nxnative#397 - #59
Conversation
…skip as seedds/nxnative#397 9f7d421 restored the NRO header skip (issue LNPANDY#14) as a carrier, and its patcher put TEXT_LO into the site bound (starts = sorted(... TEXT_LO + TEXT_END)) 13 lines above TEXT_LO = segs[0][1]. Every rewrite of every game stopped there: "NameError: name 'TEXT_LO' is not defined", found building Hades from the launcher after it pulled main. The bound itself was also not the fix: an NRO's text segment starts at offset 0 with the header inside it (Hades' EOSSDK-Switch-Shipping.nro: text {0x0, 0xa41000}), so segs[0][1] is 0 and the header was still scanned. patch_patch_nso now applies seedds/nxnative#397 instead: code_start() is 0x80 for an NRO and 0 for an NSO, code_ranges() starts no code range before it, and TEXT_END keeps its meaning. When LNPANDY#397 is merged upstream, every hunk is found applied and the patcher can go. front_mac.m, patch_nso.py and Hades II's game.tsv had patchers but were not in PATCHED, so pr-scope refused a PR that touches them; they are in. Checked: Hades' main and sdk rewrite (exit 0, the step that failed); the patcher reproduces this tree from upstream's patch_nso.py and is idempotent; a sync run with --old = --new ends SYNC OK. test_nro_header now tests the behaviour (the header outside every code range, an NSO unchanged, each bound assigned before the scan uses it); test_jump_copies, test_nso_match, test_patches, test_spin_waits, test_tail_call, test_size_prefixed_frames, test_docs and test_env_switches pass.
|
Merged as The NameError was mine. And you were right that the bound itself was wrong. I assumed an NRO's Verified on top of today's main (
On the One process note: send the next one like this, with the failing traceback in the first paragraph. "Every rewrite stops" is what made me look immediately instead of reading the description first. |
PATCHED, MARKERS and PATCHERS describe one set: a vendored file that carries a fork patch, the string that proves the patch is in place, and the function that re-applies it. A file in PATCHERS and MARKERS but missing from PATCHED still gets patched on sync — and pr-scope still refuses any PR that touches it, because pr-scope reads PATCHED to decide what is fork-owned. v0lumehi hit this with three entries in PR #59 (front_mac.m, patch_nso.py, Hades II's game.tsv): all three had patchers and markers, none was in PATCHED, so the PR that carried them was refused for editing vendored files. The tables agree today after his fix; this assertion keeps them that way instead of relying on someone noticing.
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.
Urgent: every rewrite of every game stops on main.
I found this by building Hades from the launcher right after it pulled main.
9f7d421'spatch_patch_nsoaddsTEXT_LOto the site bound on line 466, but assignsTEXT_LO = segs[0][1]only on line 479.The bound itself was also not the fix. An NRO's text segment starts at offset 0, and the header lies inside it. Hades'
EOSSDK-Switch-Shipping.nrohas text{0x0, 0xa41000}, sosegs[0][1]is 0 and the header was still scanned (see #51).Change
patch_patch_nsoapplies seedds/nxnative#397 instead:code_start()is 0x80 for an NRO and 0 for an NSO;code_ranges()starts no code range before it;TEXT_ENDkeeps its meaning.Once Persona 5 Royal: Unstable frame pacing during shader compilation, dropping to ~20 FPS until window focus changes #397 is upstream, the patcher finds every hunk already applied and can be removed.
test_nro_header.pytests behaviour now:PATCHEDadditions:front_mac.m,patch_nso.pyand Hades II'sgame.tsvhad patchers but were missing fromPATCHED, sopr-scopewould have refused this PR.Checked
mainandsdkrewrite with exit code 0. That is the step that failed.patch_nso.pyand is idempotent.--old = --newends withSYNC OK.test_nro_header,test_jump_copies,test_nso_match,test_patches,test_spin_waits,test_tail_call,test_size_prefixed_frames,test_docs,test_env_switches.