Repository navigation
Conversation
A setting row in the iPhone / iPad build options, off by default. When on, the build runs with DM_FULL_ROMFS=1 (build_ipa_from_nsp.py has no flag for it, the environment switch is what build_ipa.sh reads), and the slim-only steps after it are skipped: no romfs.img export, no copy to Documents, no send-the-game-data steps in the result. Installing on a device signs the app with its game files and a re-sign keeps them. Fixes #184
652b931 to
ef7fb40
Compare
|
@LNPANDY rebased onto current main, CI green. It is a feature, so it can merge after the 48 hours, from 2026-10-31 17:25 UTC, unless you have objections. It changes iOS builds for players only when the new option is switched on (game files packed into the IPA instead of the slim package). |
|
Reviewed against current main. The option is a good idea, but as written it can silently do nothing, and it cannot be verified from the current tests. The precedence that matters is in
Two smaller things: For the size question: the switch is global rather than per game, and a full IPA for a large title is several GB on the device and again in LiveContainer. At least show the RomFS size before the build. No device test was run here either, so 1-5 are from reading the code paths. |
|
Closing this one. The launcher path it targets already handles the game data, so the option would only add a way to get the two copies out of step. What decided it:
The review above stands as a record of what a full-package option would have to get right (the Thanks for putting it together; the code was clean and the analysis of the existing switches was accurate. |
|
@LNPANDY thanks, all five points are in the new commit e2977e1 (rebased onto current main). The PR text is updated too.
Smaller things:
Still open, needs a device: a full build installed through the launcher on an iPhone, a slim install followed by a full one (the stop message), and the IPA in LiveContainer. None of that was run. |
What and why
Fixes #184. Thanks to @ceedveed for the request.
The launcher could only build the slim IPA (game files in Documents). LiveContainer and other installers that take one large IPA had no way to get the game files inside it short of the command line.
The iPhone / iPad build options now have a row "Game files inside the IPA", off by default, with a note that iOS refuses packages over a few GB (
PackageExtractionFailed), so it suits small games. The choice is kept in UserDefaults like the older-devices switch next to it.One difference from the issue text:
build_ipa_from_nsp.pyhas no--full-romfsflag. What exists is--romfs bundleand the environment switchesDM_FULL_ROMFS=1andDM_COPY_ROMFS=YES, whichbuild_ipa.shreads (patches/0004). The launcher passes all three, so no vendored file changes.build_ipa.shgivesDM_COPY_ROMFSprecedence overDM_FULL_ROMFS, soDM_FULL_ROMFS=1alone could be downgraded to a slim app.When the option is on:
--romfs bundle, and the build environmentDM_FULL_ROMFS=1andDM_COPY_ROMFS=YES. Interaction with Install on the iPhone: game data once per game and version, then the slim app #213: that PR passes--romfs separateand abundled:parameter for its install-once flow. A full build here never passesseparate, so the two do not collide. Once Install on the iPhone: game data once per game and version, then the slim app #213 is merged, itsbundled:parameter should be driven by this option (bundled: trueis this path), and the explicit--romfs bundlekeeps the request intact in the meantime.games/<id>/romfs.img, the DLC images copy) is skipped.DM_COPY_ROMFS=YES(explicit, because aGen/dm.xcconfigthat saysNOwould win over an absent setting), and nothing is copied to Documents afterwards.DM_COPY_ROMFS=YESwhen the app bundle holdsromfs.imgor a non-emptyromfs, elseNO.Payload/<app>/romfs.imgorromfs/..., a signed app must hold a non-emptyromfs.imgorromfs. Otherwise the build ends with a message instead of success.main.mreadsDocuments/games/<id>/romfs.imgbefore the bundled copy, and a full build carries noromfs.id.devicectlhas no way to delete one file (onlycopy to --remove-existing-content, which empties a whole folder), so clearing is not possible without touching saves and other data. The install is therefore limited to fresh installs: before installing, the app's Documents are listed (read only), and when a slim install's game files are there the install stops with a message (delete the app first, its saves go with it, or turn the option off). An app that is not on the device yet counts as fresh. Nothing is ever deleted.The Qt front end has no build options at all (no older-devices switch either, only the target button), so a toggle there would be a new options page and not a small change. Its back end (
win/build_app.py) already readsDM_FULL_ROMFSfrom the environment, which stays without a UI here. The Qt language table is regenerated for the new strings.Checked
cd frontend && swift build -c release && swift test487 tests, 0 failures (16 skipped).FullRomfsTests: off by default, environment and--romfs bundlefor an iOS build only, remembered, re-sign passesDM_COPY_ROMFS=YES, artifact checks, listing parser, size, all new strings in zh, en, sv without semicolons.LibraryTests(testFull...): full install flow with stand-inxcodebuildanddevicectl(nopackArchive, nodevicectl device copy, install stops on older game files, fails without game files), full IPA with and without game files. No real device was used.python3 -m unittest discover -s frontend-qt/testsOK, the language table regenerates without a diff.python3 scripts/patches.py checkOK.NX_LAUNCHER_CAPTURE_DIR=<dir> swift test --filter FullRomfsTestscaptures the Builds page in en, zh and sv, switch on and off. The row sits under the older-devices row in the same card style. The PNGs are not attached because the CLI cannot upload images.Screenshots
Not attached (the CLI cannot upload images). The Builds page was captured in English, Chinese and Swedish, and the new row reads "Game files inside the IPA" / 游戏文件放进 IPA / Spelfiler i IPA-filen, with its switch right under the older-devices row.
Scope
dm/,scripts/,docs/,ref/,AGENTS.md) is edited directlyThis is a feature, so it waits the usual 48 hours before merging.