Skip to content

packing/nup: take the app version from the build row, else the label - #2822

Closed
UserDerezzed wants to merge 1 commit into
seedds:mainfrom
UserDerezzed:app-version-nup
Closed

UserDerezzed wants to merge 1 commit into
seedds:mainfrom
UserDerezzed:app-version-nup

Conversation

@UserDerezzed

@UserDerezzed UserDerezzed commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The Mac app of The Legend of Zelda: Ocarina of Time 1.1.1, packed from a NUP, says Version 1.0 in Finder (CFBundleShortVersionString 1.0).

The app version came from control.nacp alone: the packed version's, else the base game's. This NUP has no NACP in either package, so the script passed no version and pack_app.py wrote its default. A dump has no control data either.

app_version_of now takes, in this order:

  1. the control data, as before;
  2. the display version the profile's build row registers for the packed version;
  3. the NUP's display version record (pack_nup.display_label: the package's, else its base game's, or the metadata record's when the NUP has no base game).

Each is cut to a bundle version with the cut nacp.version already made (now nacp.bundle_version), so a row or a label that is no version (v131072, ?) gives none and the app says 1.0 as before. The label comes last because the packer typed it: pack_nup.py's header already treats these records as labels, not the console's values. The IPA takes the same version (DM_APP_VERSION).

For Ocarina of Time the build row has v131072 where its display version goes, so the label supplies 1.1.1. I left the row alone: the host answers nn::oe::GetDisplayVersion from it, and I have not checked what the game shows with either value.

Reference entry: An app packed from a NUP without control data says version 1.0.

Checked

  • test_nsp_nup.py test_app_version_without_nacp_is_the_profiles_then_the_label: the order, the cuts, and the label of an update and of its base game.
  • For the Ocarina of Time NUP and its build folder the function gives 1.1.1 where it gave none.
  • Every Python test file of dm/tools/tests, dm/ios/tests and dm/gfx/tests, one by one as CI runs them: 217 files, 2,455 tests, no failure.
  • lint_python.py with the pinned ruff and pyright: 0 new findings.
  • The Mac app packed again after this pull request was opened, from a local branch that carries this commit on an older main (cherry-picked, with other open pull requests, so not this branch's tree): the build's game line names version: 1.1.1, and the app's Info.plist has CFBundleShortVersionString and CFBundleVersion 1.1.1 where it had 1.0. No red line, and the signature verifies. The commit message and the reference entry were written before that build and still say the app was not packed again.

Not checked

  • An IPA was not built.
  • No regress.py check was run. regress.py impact names every game, as it does for any change to build_ipa_from_nsp.py, but the change reaches only the version string of an app whose game has no control data, and no step of the shader chain, the rewriter or the host reads it. impact also notes that no rule of impact_map.tsv maps dm/tools/nacp.py; I did not add one here.

#2823, for the same NUP's missing app icon, touches the neighbouring lines of packing.md's Launcher metadata section and of the game note; whichever lands second needs docs_symptoms.py run again.

The Mac app of The Legend of Zelda: Ocarina of Time 1.1.1, packed from a
NUP, said Version 1.0 in Finder (CFBundleShortVersionString 1.0).

The app version came from control.nacp alone: the packed version's, else
the base game's. This NUP has no NACP in either package, so the script
passed no version and pack_app.py wrote its default. A dump has no
control data either.

app_version_of now takes the control data first, then the display
version the profile's build row registers for the packed version, then
the NUP's display version record (pack_nup.display_label: the package's,
else its base game's, or the metadata record's when the NUP has no base
game). Each is cut to a bundle version (nacp.bundle_version, the cut
nacp.version already made), so a row or a label that is no version
(v131072, ?) gives none and the app says 1.0 as before. The label comes
last because the packer typed it. The IPA takes the same version
(DM_APP_VERSION).

Checked: test_nsp_nup's new test (the order, the cuts, the label of an
update and of its base game); for the Ocarina of Time NUP and its build
folder the function gives 1.1.1 where it gave none. Every Python test
file as CI runs them, and lint_python.py with the pinned tools. Not
checked: the app was not packed again, and no IPA was built.
@github-actions github-actions Bot added packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0400486024DEC000 A game labels Nov 16, 2026
@gnavarro24

Copy link
Copy Markdown
Contributor

Hi! This branch is based on a main from before commit c70c242 ("ci: repair host and tool test failures on main"). Most of the failing checks here (Host unit tests, Tool tests, clang-tidy, Build check) come from that older base, not from this change.

To pick up the fix, merge the current main into this branch and push:

git fetch origin
git merge origin/main
git push

If the merge has conflicts, ask here if you want help with them.

seedds added a commit that referenced this pull request Nov 20, 2026
A NUP can carry a display version without carrying control data. Use
its selected package's numeric label in the survey, the derived profile,
and the app after the applicable control data and registered version.
Read the base NACP for the app even when only the update is extracted.
Keep Ocarina of Time's registered runtime row as it is.

Checked the real Mario Kart World 1.8.0 NUP and both version fields in
signed Mac app fixtures. Focused packing, unsigned IPA, and docs tests
passed. Python lint matches the findings on main.

Combines PR #2822 and PR #3070 and addresses issue #2902.

Co-authored-by: UserDerezzed <25561419+UserDerezzed@users.noreply.github.com>
Co-authored-by: Eliran Zach <4012041+thehobbit85@users.noreply.github.com>
Co-authored-by: Saqib Razaq <232577050+saqibrazaq-dt@users.noreply.github.com>
@seedds

seedds commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thanks for tracking down the Finder version and checking the rebuilt Mac app. The fix landed in f3f73320. The app now falls back to the registered build version and then the selected NUP package’s numeric label. I verified both version fields in a signed Mac bundle using a synthetic NUP with the reported 1.1.1 label. Ocarina of Time’s in-game version row stays as it was. No full game app or IPA was rebuilt.

@seedds seedds closed this Nov 20, 2026
seedds added a commit that referenced this pull request Nov 20, 2026
If the packed update has no NACP, prefer its registered version before
falling back to the base game's NACP. The base control data can describe
an older release. The selected NUP's numeric label is the final fallback.

Register Ocarina of Time v131072 as 1.1.1 for its verified main build ID.
The local NUP has no control data or numeric label, so the app version
and the host's version service both use this registered value.

Checked 186 targeted tests, the generated symptom index, and both Mac
bundle version fields with the local NUP. OoT reached its title menu on
an M6 running macOS 27.2.1 and called GetDisplayVersion. The Pyright
findings match clean main.

Follow-up to PR #2822.

Co-authored-by: UserDerezzed <25561419+UserDerezzed@users.noreply.github.com>
@seedds

seedds commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thanks again, @UserDerezzed, for finding the Finder version issue and checking the rebuilt Mac app.

The follow-up is on main in 742e959. When the selected update has no version in its control data, packing now prefers that build's registered version before looking at the base game's control data. Ocarina of Time v131072 is registered as 1.1.1, so the local NUP also gets the right version even though it has no version label.

All 186 targeted tests passed. Both Mac bundle version fields resolved to 1.1.1 from the local NUP, and the rebuilt host reached the Ocarina of Time title menu on an M6. The checks covered bundle metadata and the title boot. Fresh full game app and IPA builds were outside those checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0400486024DEC000 A game packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants