Skip to content

Ask before the build when the shared app holds frameworks of an old shader chain - #450

Merged
v0lumehi merged 1 commit into
mainfrom
v0lumehi/stale-frameworks-prompt
Nov 1, 2026
Merged

v0lumehi merged 1 commit into
mainfrom
v0lumehi/stale-frameworks-prompt

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Fix or feature

  • Fix
  • Feature

What and why

Closes #449.

After the engine moved to a new shader chain, adding a game to the shared iPhone and iPad app failed at the last step. build_shell.sh --prepare-xcode refused the frameworks of the old chain in NX2Apple-shell/frameworks, after the long steps, with a message that did not say what to do.

Now a build for the iPhone or iPad checks before the long steps. It reads the chain of the engine from dm/gfx/nvn/dmsh_chain.h (the DMSH_CHAIN, written b-<chain>) and the chain of each framework from its game.manifest.json. These are the two values the script compares. The frameworks come from the shell's mirror folder and from the games in shell.json. No engine change is needed, so there is no patch and no seedds/nxnative PR.

  • With no stale framework nothing is asked.
  • With stale ones a prompt names the games and offers two choices. Stop the build touches nothing. Continue deletes only the frameworks of another chain and their entries in shell.json, then the build goes on. Frameworks of the current chain stay.
  • The game that is being built is left out, because its build replaces its framework.
  • A framework whose manifest cannot be read is not decided here. The failure at the last step stays for that case.
  • The texts are in English, Chinese, German, Swedish and French. They live in LocalizationStaleFrameworks.swift, because Localization.swift is above the size limit and may only shrink. L10n.string asks them for a key the main table does not hold, on the line that returned the key before.
  • ContentView.swift does not grow: three lines are added and three blank lines are removed.

The Windows launcher does not need this. It builds the IPA directly and has no shared app or framework folder. Its driver refuses --prepare-xcode.

Checked

  • Tests: cd frontend && swift test passes (691 tests, 17 skipped, 0 failures). New StaleFrameworksTests: testStopLeavesEveryFileAsItWas and testContinueRemovesTheStaleFrameworkAndKeepsTheCurrentOne use a shell folder with one current and one stale framework. testContinueStartsTheBuildAndTheModelEndsWithoutAPrompt covers the model's Continue. testNothingIsAskedWhenEveryFrameworkIsCurrent covers the case with no prompt. Also a test for the chain header, the game being built, an unreadable manifest and the five languages.
  • Visual QA: the two images below come from NX_LAUNCHER_CAPTURE_DIR=<dir> swift test --filter testRenderStalePromptForVisualQA, with NX_CAPTURE_LANG=zh for the second.
  • Run on a device or Mac: not run. I did not build a game on a device. The prompt is not shown in a real window here, see Screenshots.

Screenshots

Before: there was no prompt. The build failed at the last step with "Cannot prepare the shared app" and the line built for shader chain b-e65a4ebd3322, this checkout is b-b7cd656abd7c: build the game again.

After. A SwiftUI alert is a sheet that cacheDisplay does not draw, so these two images render the alert's title, message and buttons with the same strings in a plain view. The real alert looks like the system one.

English

Chinese

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#..., or pending until that PR is open (no engine change here)
  • A change to a launcher view has before and after screenshots above
  • No keys, game files or data extracted from a game in the change or the attachments

…hader chain (#449)

A build for the iPhone or iPad compares the chain of each framework in the shell folder with the chain of the engine. With stale ones it asks first, naming the games. Stop touches nothing. Continue removes only the stale frameworks and their library entries, then the build goes on.
@v0lumehi v0lumehi added this to the v1.0.1 milestone Nov 1, 2026
@v0lumehi v0lumehi added bug Something isn't working launcher The NX2Apple launcher app ios iPhone or iPad mac Mac labels Nov 1, 2026
@v0lumehi
v0lumehi merged commit 1c55c69 into main Nov 1, 2026
14 checks passed
@v0lumehi
v0lumehi deleted the v0lumehi/stale-frameworks-prompt branch November 2, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ios iPhone or iPad launcher The NX2Apple launcher app mac Mac

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding a game after an engine update fails at the last step: ask first, then remove the stale frameworks

1 participant