Repository navigation
Conversation
This was referenced Oct 28, 2026
… fit seedds main again (the nightly sync stops on test_nro_header.py) The fork's NRO header skip (patch_nso.py code_start/code_ranges, nso_code.py lo bound, its own test_nro_header.py) is dropped: upstream fixed the same bug itself in 3e77816 (FFX/X-2), 7e0f597 and 337186c (nso_code.data_blocks starts after the 0x80 header and reports it as a data block), so upstream's three files win (DROPPED, not OURS). The patchers behind it that stopped on seedds main now fit it, and still fit the last sync base: - hle_fs.c: handles reach the guest shifted by FH_OUT (LNPANDY#513); the archive handle's tag moves to bit 57 - main.m: upstream's romfs.id identity check (LNPANDY#493) is carried through the per-game romfs_locate - build_ipa.sh: upstream has the ad-hoc entitlements and DM_COPY_ROMFS itself (LNPANDY#478, LNPANDY#493), so only the fork's slim-by-default (DM_FULL_ROMFS) and add-on content rule remain - build_ipa_from_nsp.py: the pwd import follows upstream's errno; rmtree takes upstream's hook, with the Python 3.9 spelling (onerror) test_sync_patchers: a line the patcher only appended to keeps upstream's compiler spelling.
…ream added no longer read as fork edits (issue LNPANDY#105)
v0lumehi
force-pushed
the
sync-nro-fix
branch
from
October 28, 2026 12:30
7ae6bdf to
c91c9b3
Compare
LNPANDY
added a commit
that referenced
this pull request
Oct 28, 2026
Sync: the nightly sync works again, carrying v0lumehi's repair from #115
Owner
|
Merged as #127, the PR's tree unchanged — thank you. A textual merge against main conflicted inside the same GetFileSize hunks both of us had rewritten, so I took your three files as they are and verified: both patcher suites pass against seedds main 062cd06 and against the last sync base, and the dry sync reaches SYNC OK. Your call to drop the fork's NRO patcher is right: upstream's data_blocks() fix covers the same bug, and keeping an OURS test for code that no longer exists would only confuse the next reader. The FH_OUT/FH_IN bit-57 rework and the double-signing removal are the kind of thing only someone who reads upstream's diffs catches. Co-authored-by is in the commit. |
1 task done
v0lumehi
pushed a commit
to v0lumehi/NX2Apple
that referenced
this pull request
Oct 28, 2026
…ied as a merge that keeps its tree PR LNPANDY#115 is the complete version of the sync repair: it drops the fork's NRO patcher because upstream fixed the same bug itself (3e77816, 7e0f597, 337186c - their data_blocks() starts an NRO's code at 0x80 and their test covers both cases the fork's did), reworks the archive handle tag to bit 57 for seedds LNPANDY#513's FH_OUT/FH_IN shift, stops the double ad-hoc signing build_ipa.sh would get now that upstream carries the entitlements itself, follows the new pwd/errno anchor, and makes the daily health check use the real .upstream-ref base (issue LNPANDY#105). A textual merge against main conflicted inside the same GetFileSize hunks both sides had rewritten, so the three files are taken from the PR's branch as they are. Verified here: both patcher suites pass (against seedds main 062cd06 and against the last sync base), and --old 75065df --new seedds/main --skip-build reaches SYNC OK. Co-authored-by: v0lumehi
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.
Rebased onto main after #101 and Andy's 607b5da / 1c3acc7 ("keep OURS files when upstream adds its own, and read the daily-health shape right").
What Andy's commits already cover (not repeated here): the OURS skip for a file upstream also adds, the daily-health deletion-of-a-file-not-in-old fix in
unprotected_edits, theMAIN_M_ROMFSanchor and no-game-data hunk for the romfs.id identity check, and the line-start anchor of the slim mapping. What main still lacked: against current seedds main (6c4a81d, which moved after his commits) the sync andtest_sync_patchers.pystill failed onhle_fs.c(#513 handles),build_ipa_from_nsp.py(thepwdimport anchor) andpatch_nso.py(seedds' #451 reworked the text scan, so the fork's NRO patcher no longer applies). Because the fork's NRO patcher cannot apply any more, keepingtest_nro_header.pyas OURS would test code that no longer exists, so this PR keeps dropping the NRO fork files (upstream's fix covers the same bug, see Cause) instead of Andy's OURS skip. The main.m identity handling and theunprotected_editschange below overlap his work and rebased without conflict; verified on the rebased branch.Verified on the rebased branch against seedds/main 6c4a81d:
sync_upstream.py --old $(cat .upstream-ref) --new seedds/mainwith the host build and host unit tests:SYNC OK;python3 -m unittest scripts/tests/test_sync_patchers.py: 8 tests OK.Fixes #104 and #105. Unblocks #109 (points 2 and 3): upstream main already has the "Game language" launcher row and
launcher.jsonfor--platform mac-app, but the fork never received them because the nightly sync stops.Cause
The nightly sync stopped at
upstream writes over a fork file: dm/tools/tests/test_nro_header.py. The fork carried its own NRO header skip (patch_nso.pycode_start/code_ranges, alobound innso_code.py, andtest_nro_header.pyin OURS). It was sent upstream as seedds/nxnative#397 and closed as superseded: upstream fixed the same bug itself in 3e77816 (FFX/X-2, #14), 7e0f597 and 337186c.I checked that upstream's fix covers the fork's:
nso_code.data_blocks()starts at 0x80 for an NRO and returns the header past its first two words as a data block, soCODE_RANGESholds no code before 0x80 and the scans (func_ofincluded) cannot enter the header. Its test covers both the build ID decoding asldr x18and abr x18before the first FDE. Nothing of the fork's fix is missing, so no residual patcher is kept.What changed (scripts/sync_upstream.py, scripts/tests/test_sync_patchers.py)
patch_patch_nso, its marker and the OURS entry fortest_nro_header.pyare gone.patch_nso.py,nso_code.pyandtest_nro_header.pyare in DROPPED with the reason, so upstream's versions win.test_the_patchers_fit_the_last_sync_base):hle_fs.c: Tests: render in windows that are on no display #513 shifts file handles byFH_OUT/FH_IN. The fork's archive handle had its tag at bit 63, which the shift would lose, so the tag is now bit 57 (belowIMG_H's bit 58, fits after the shift).main.m: upstream's romfs.id identity check (Launcher: never save the shell root at the root of a volume (#492) #493) is carried through the per-gameromfs_locateand the no-game-data boot.build_ipa.sh: upstream has the ad-hoc entitlements andDM_COPY_ROMFSitself (One JSON file per language, read by the Mac and the Windows launcher (#388, step 1) #478, Launcher: never save the shell root at the root of a volume (#492) #493), so the fork's entitlements patch is not applied to it any more (it would sign twice). What stays the fork's: slim IPA by default (DM_FULL_ROMFS=1orDM_COPY_ROMFS=YESpacks the game files), and the add-on content rule. Decision for review: this keeps the fork's default (slim) on top of upstream's opt-in; the prepared Xcode project keeps upstream's default.build_ipa_from_nsp.py: thepwdimport anchor follows upstream's newerrno; the fork'srmtreeretry is replaced by upstream's own_gonehook, with a Python 3.9 spelling (onerror), since the fork's floor is 3.9 andonexcis 3.12+.test_the_patched_makefile_uses_one_compiler_spelling: a line the patcher only appended to keeps upstream's spelling (upstream's ownt_resolutionrule saysclang, not$(CLANG)).Local run
In a scratch worktree of this branch:
sync_upstream.py --old $(cat .upstream-ref) --new seedds/main(6c4a81d) with the host build:SYNC OK, all 30 patchers applied and agree with the tree, every.pyparses on 3.9,build_ipa.shpassesbash -n, host build OK (01006F8002326000). Upstream'stest_nro_header.pypasses on the synced tree.python -m unittest scripts/tests/test_sync_patchers.py: 8 tests OK.Health check (#105)
All files in its list are classified below; none holds a fork change, so nothing needs a patcher or OURS entry. The list is a false positive of
daily-health.yml, which runssync_upstream.py --old "$NEW" --new "$NEW": with the base set to upstream's tip, every file the fork does not have yet (new upstream files) reads as "deleted/edited in the fork and changed by upstream". With the real base (.upstream-ref) the sync reports no such file. The second commit fixes the workflow: the dry run now passes--oldthe real base (.upstream-ref, falling back to the tip when the file is missing, as the sync workflow does) and fetches upstream's full history so that base commit exists.dm/host/motion_{apple,fusion,pro,pro_mac}.h,dm/host/tests/t_motion*.{c,m}dm/mac/Launcher.swift,dm/ios/Sources/LauncherRow.swift,dm/ios/tests/launcher_layout_check.swift,docs/launcher.schema.jsondocs/frontends.md,dm/tools/docs_gallery.py,docs/images/gallery.tsv, 10docs/images/*.png/jpgdm/gfx/tests/{t_missing_src1,t_pso_stall,t_queue_origin}.m,test_{shader_split_progress,unity_2017,unity_pairs,vbf}.py,dm/gfx/tools/vbf.pydm/sanitizers/{ignorelist.txt,sanitizers.mk,tsan.supp},dm/tools/tests/test_ci_toolchain.py,dm/games/0100E95004038000/smoke.tsvAcross the whole
git diff seedds/main HEADthe same way: 202 files absent in the fork (new upstream), 225 equal to the last base (upstream is newer), 47 fork-only files, and 34 files that differ from the base, all of which are in PATCHED or DROPPED (the 34 includehle_time.c,t_time.c,nso_code.pyandpatch_nso.py, which are DROPPED with their reasons).test_no_fork_edit_is_unprotectedpasses.