Repository navigation
Conversation
The default output path is `work.parent / <ipa>`, but `work` was assigned three
lines later, so every build without `-o`/OUT_IPA stopped right after the profile
was resolved (a provisional-profile game: right after the survey):
UnboundLocalError: cannot access local variable 'work'
Mario Tennis Aces (0100BDE00862A000, no profile) hit it at line 1796. Moving the
assignment above the path computation fixes every game, including the ones the
front end builds, since the app passes no `-o`.
The daily sync takes scripts/build_ipa_from_nsp.py fresh from upstream and re-applies the fork patches, so the ordering fix in the file alone would be reverted (or fail the `work-dir out_ipa` anchor) on the next run. The two patches now carry it: `work-dir work` drops the assignment from its upstream position and `work-dir out_ipa` writes it above the path that reads it. Checked by applying patch_nsp() to upstream's file: the work/out_ipa lines come out in the order the fork ships, with no hunk in that region.
|
Amended: the ordering fix is now also in |
… the old one seedds/nxnative LNPANDY#278 moves out_ipa under `if want_ios:` and indents it by four spaces, which would leave the work-dir out_ipa patch without its anchor on the next sync (the issue LNPANDY#13 pattern). The patch now detects the shape: with the `out_ipa = None` + `if want_ios:` pair it inserts `work` above that pair and rewrites the 8-space line; otherwise it rewrites the single 4-space line as before. The 8-space anchor is used only in that shape, because the 4-space string also occurs inside it. Checked by applying patch_nsp() to upstream/main and to the LNPANDY#278 branch: both outputs compile, and `work` comes before `out_ipa` in both.
…#15) My --work-dir patch moved `work = ...` up but left the default-IPA line reading `work.parent` above it, so any build without -o died with 'cannot access local variable work'. The NS Port Builder never passes -o, so every app build was broken; the Mac command line only escaped because it sets OUT_IPA. The two statements are now in the right order with a comment saying why, and the sync patcher replaces them as ONE block: patching them separately is what allowed the wrong order in the first place (each anchor applied on its own). Verified: work is assigned at line 1796, out_ipa reads it at 1799, and the patcher's output still equals the tree code line for code line.
|
Fixed in baf9647 — and thank you for catching it, this was my bug and it broke every app build. I moved Your diagnosis and the fix (swap the two statements) were both exactly right. I also merged the two sync-patcher entries that produced this into one block replacement: patching Verified: |
|
Closing this one: |
What happens: every build without
-o/OUT_IPAstops right after the profile is resolved:Why: the default output path is
work.parent / <ipa>, butworkwas assigned three lines later (line 1799). The two statements just need to swap. No-ois passed by the front end (NS Port Builder), so every app build hits this — Mario Tennis Aces (0100BDE00862A000, no profile) hit it immediately after the survey, and any registered game would hit it too.Fix: move the
work = ...line above theout_ipa = ...line. One line moved, no behaviour change for builds that pass-o.Checked:
python3 -m py_compile scripts/build_ipa_from_nsp.py; the Maria Tennis Aces run continues past the profile stage with the same command line.