Skip to content

sync_upstream: the work-dir paths patch follows upstream #278's shape too - #17

Closed
JMRBDev wants to merge 1 commit into
LNPANDY:mainfrom
JMRBDev:sync-post278-shape
Closed

JMRBDev wants to merge 1 commit into
LNPANDY:mainfrom
JMRBDev:sync-post278-shape

Conversation

@JMRBDev

@JMRBDev JMRBDev commented Oct 26, 2026

Copy link
Copy Markdown

Follow-up to #15, which baf9647 superseded for the tree itself.

Your single work-dir paths replacement is right for the block upstream has today. seedds/nxnative #278 (open, stacked on #275) rewrites that block:

  • out_ipa moves under if want_ios: and is indented four more spaces,
  • the mac_pack check becomes an out_app block,
  • the work assignment stays last.

The anchor would not match on the first sync after #278 lands, so this makes the patch pick the shape:

  • with out_ipa = None + if want_ios: — delete the trailing work assignment, insert it above that pair, and rewrite the 8-space out_ipa line to work.parent;
  • otherwise — replace the four-line block exactly as it does now.

Checked by applying patch_nsp() to both files:

It is inert until #278 lands, and keeps the daily sync alive when it does. Merge it whenever; no order against #16.

…s shape too

The single `work-dir paths` replacement is right for the block upstream has
today. seedds/nxnative LNPANDY#278 (open, stacked on LNPANDY#275) rewrites that block: out_ipa
moves under `if want_ios:` with four more spaces of indentation, the mac_pack
check becomes an out_app block, and the `work` assignment stays last. The anchor
would not match on the first sync after that lands.

The patch now picks the shape: with `out_ipa = None` + `if want_ios:` it deletes
the trailing assignment, inserts `work` above that pair (the assignment reads
args.work_dir) and rewrites the 8-space out_ipa line; otherwise it replaces the
four-line block exactly as before.

Checked by applying patch_nsp() to both upstream/main and the LNPANDY#278 branch: the
pre-LNPANDY#278 output's block is byte-identical to this tree's, and the post-LNPANDY#278 output
compiles, keeps `work` above `out_ipa`, and keeps the out_app block.
@JMRBDev

JMRBDev commented Oct 26, 2026

Copy link
Copy Markdown
Author

Verified end to end before #278 lands, using the fork's own sync:

  1. A worktree on this branch, then git fetch of a tree that contains l10n: add French #275 + Launcher: dropdowns in the app's own style, and language names in their own language #278.
  2. python3 scripts/sync_upstream.py --old 6062518 --new <that branch> --skip-build → SYNC OK: every .py parses on the 3.9 floor, bash -n build_ipa.sh OK, archive reader test passed, and the NSP-script patches applied on the post-Launcher: dropdowns in the app's own style, and language names in their own language #278 shape (the work-dir paths patch took the 8-space branch, work above out_ipa, out_app block intact).
  3. A real build from the synced tree: build_ipa_from_nsp.py --platform ios on Balatro → exit 0, slim IPA 32.6 MB, GL shaders built for both targets, app build 14 s.

So the day #278 merges, the daily sync produces a tree that builds — not just one that parses.

LNPANDY added a commit that referenced this pull request Oct 26, 2026
…rom PR #17)

Upstream #278 (open, --platform takes a list) rewrites the out_ipa block: out_ipa moves under
'if want_ios:' indented 8 spaces, the mac_pack check becomes an out_app block, and `work`
stays last. Our single anchor was written for today's shape and would have stopped matching on
the first sync after #278 lands.

JMRBDev's PR #17 detected that and proposed the shape split; this is that idea with one
change — each shape is a single (old, new) pair instead of a delete plus an insert. His version
removed the `work` line first and re-inserted it, so a future anchor drift between the two
steps would have left the tree without the assignment.

Verified by applying patch_nsp() to both shapes (upstream/main and a hand-built #278 fixture):
work is assigned before out_ipa in both, and the pre-#278 output is byte-identical to the tree.
Credit: PR #17.
@LNPANDY

LNPANDY commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Adopted as 73a986a — thank you, this is exactly the right kind of forward-looking patch, and the reasoning about when it breaks is what makes it worth taking now.

I verified your analysis against the real thing: pulled #278's diff and confirmed out_ipa does move under if want_ios: (8 spaces) with work still last, so my single anchor would have stopped matching on the first sync after it lands.

One change I made: your #278 branch deletes the work line and re-inserts it in a second replacement:

("    work = nsp_dir / f'{g.id}_build'\n", ""),          # step 1: remove
(..., work_line + "\n    out_ipa = None\n    if want_ios:\n"),   # step 2: put back

If step 2 ever stops matching while step 1 still applies, the tree ends up with no work assignment at all — the same class of failure as #15, just triggered by a different upstream edit. Each shape is now one (old, new) pair, so either the whole block is replaced or nothing happens.

Verified on both: pre-#278 output is byte-identical to this tree, post-#278 gives work at 1796 and out_ipa at 1799.

Also worth noting: #278 is what PR #16 needs — the --platform ios,mac-app list. Once it lands, #16 starts working through the repoSupportsPlatformList check you wrote there.

@LNPANDY LNPANDY closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants