Skip to content

frontend: an "Also build the Mac app" switch passes --platform ios,mac-app - #16

Closed
JMRBDev wants to merge 1 commit into
LNPANDY:mainfrom
JMRBDev:frontend-platforms
Closed

JMRBDev wants to merge 1 commit into
LNPANDY:mainfrom
JMRBDev:frontend-platforms

Conversation

@JMRBDev

@JMRBDev JMRBDev commented Oct 26, 2026

Copy link
Copy Markdown

What this does: a checkbox in the footer, "Also build the Mac app", passes --platform ios,mac-app to the build script. One run then produces the IPA the app already loads onto the phone and a double-clickable Mac app of the same game, from one extraction, one rewrite and one shader split.

  • The switch is checked against the checkout the way --work-dir already is (repoSupportsPlatformList looks for the list handling in the script text): an older checkout that takes one value only logs a message instead of stopping with an argparse error.
  • Labels in both languages (btn.macApp, btn.macAppHelp, msg.noPlatformList).
  • Disabled while a build runs.

Depends on seedds/nxnative #278 (or the next upstream sync after it), where --platform takes a list; without that script the switch is refused at run time and the build goes on as before.

Checked: swift build in frontend/ (Build complete, 8.35 s; only pre-existing warnings).

…c-app

The script can now build one, several or all of ios / mac / mac-app in one run
(seedds/nxnative LNPANDY#278). The app exposes the useful pair: the IPA it already builds,
and a double-clickable Mac app of the same game, from one extraction, rewrite and
shader split.

The switch is checked against the checkout the way --work-dir already is
(repoSupportsPlatformList looks for the list handling in the script); an older
checkout that takes one value only says so instead of stopping with an argparse
error. Labels in both languages.
@LNPANDY

LNPANDY commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Good idea, and the front-end side looks right — the feature detection (repoSupportsPlatformList) is exactly the pattern --work-dir uses, so an older checkout degrades instead of erroring.

But it cannot work yet, and I do not want to merge something that silently does nothing. --platform takes a single value today:

ap.add_argument('--platform', choices=('ios', 'mac', 'mac-app'), ...)

--platform ios,mac-app is rejected by argparse before any of your code runs. Making it a list means:

  • choices becomes a parser that splits on commas,
  • every PLATFORM == 'mac-app' / PLATFORM == 'mac' branch in build_ipa_from_nsp.py has to become a membership test,
  • the stage plan is built from a count (PROG.plan(1 + len(versions) + ...)) that assumes one output,
  • out_ipa is one path; two outputs need two.

That is a real change to the build script, not a wrapper around it, and it is upstream's file — a fork-local version of it would collide with every daily sync.

What I would accept: the front end half as it is, gated on the script advertising the list (your repoSupportsPlatformList check already does that), so it works the day upstream lands the list. If you would rather send the script change upstream first (seedds/nxnative), I will pick up the list support in the same sync and this PR starts working immediately.

Leaving it open for now — tell me which way you want to go.

@JMRBDev

JMRBDev commented Oct 26, 2026

Copy link
Copy Markdown
Author

Keep the gate — the script change is already upstream, in seedds/nxnative:

So the fork will pick up the list on the first sync after #278 merges, and this PR starts working then with no further change. Until then the switch logs the message and builds the IPA alone, which is the degradation you asked for.

One thing the end-to-end test caught in my own #278: with ios,mac-app the GL/Vulkan path packed the macOS gl_shaders.metallib into the IPA. Fixed there (mac_only = mac and not want_ios) and verified by hash against shader/ios/gl.

@LNPANDY

LNPANDY commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Thank you for the detail — especially the mac_only = mac and not want_ios catch in your own #278. That is exactly the class of bug this feature would ship with, and finding it before the fork picks it up is worth more than the front-end half.

I have read #275 and #278. Both are still open upstream, so I cannot merge this as it stands: the switch would be visible, clickable, and log "update your checkout" on every current checkout. That is worse than not having it.

There is a second problem, and it is mine, not yours. Since you opened this I shipped v0.4.5 with a different shape for the same idea: a segmented Picker in the footer — "Output: iPhone IPA" / "Output: Mac App" — that sets --platform to one value. It is mutually exclusive by design: the Mac app output was asked for by people who do not have an iPhone, and the two outputs want different -o handling (an .ipa path vs a .app path). Your checkbox is additive, so the two would sit next to each other and contradict each other. The diff also conflicts now (your base is 8e39b4d, the picker landed in 9aff688).

What I would like to do, when #278 merges:

Keep your feature-detection idea — it is the right pattern, and 'all' in plats is a stable enough marker — but express it as a third option in the existing picker rather than a second control:

[ iPhone IPA ] [ Mac App ] [ Both ]

"Both" passes --platform ios,mac-app, and is hidden unless repoSupportsPlatformList(repoPath) is true, so an older checkout never shows a control that cannot work. That keeps one control for one decision and reuses your gate unchanged.

So: I am closing this PR rather than merging it, and I will implement the "Both" option myself once #278 lands — with your detection function and your msg.noPlatformList string, credited here. If you would rather push that version yourself, say so and I will leave the picker to you and merge it instead; you have already done the harder half of the thinking.

One thing to confirm on your side, since it affects what I write: with ios,mac-app, -o names only the IPA and the Mac app keeps its default name beside the NSPs. That is what I read in #278 (out_app is only set when the app is the sole output). If a user picks "Both" and an output folder, they get the IPA in that folder and the app somewhere else — so the front end has to say where. Do you agree that is the intended behaviour, or should the app get a name derived from -o?

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