Skip to content

fix: classify pack_app disk-space error and prevent false keys fallback on keyless sources - #13

Closed
eduardomozart wants to merge 1 commit into
Bium23:mainfrom
eduardomozart:bium/pack-app-disk-classification
Closed

eduardomozart wants to merge 1 commit into
Bium23:mainfrom
eduardomozart:bium/pack-app-disk-classification

Conversation

@eduardomozart

Copy link
Copy Markdown
Contributor

Summary

  • Classifies pack_app.py disk-space failure: Adds a "disk.app" row to PortingFailureClassifier.table matching the app needs [0-9.]+ GB on the volume of and extracts the rounded-up required space (including pack_app.py's need + 1 GiB threshold check, e.g. 12.4 GB → 14 GB). The UI now correctly presents "Not enough disk space" with the Open Storage action.
  • Prevents false keys fallback for keyless sources: In AppViewModel.finishBuild, passes keysPath only when SourceSelection.requiresKeys(game.sources) is true. Unrecognized failures on Switch 2 .nup containers or extracted dumps no longer fall back to blaming unimported prod.keys.
  • Expands engine fragment checking: Adds "dm/mac" to PortingFailureEngineTests.gitGrep so pinned-engine message fragment verification covers dm/mac/pack_app.py.

Problem & Background

During a porting of The Legend of Zelda: Ocarina of Time (0400486024DEC000) from a Switch 2 .nup container (-p v131072), the build completed shader compilation (42,848 shaders), host compilation, and the 4.2 GB pipeline archive, but stopped at Stage 8 (Mac app):

the app needs 12.4 GB on the volume of ~/Library/Application Support/NXLibrary/Temp/... (no APFS clones from the build there) and 13.1 GB are free
[RED] pack_app.py exit code 1

Because PortingFailureClassifier only matched build_ipa_from_nsp.py's upfront check (less than [0-9]+ GB free on the volume of) and POSIX No space left on device, pack_app.py's message was not recognized in table. Because AppViewModel.finishBuild unconditionally passed keysPath: keyStore.keyURL.path, !isReadable(keysPath) triggered and misclassified the stop as failed (keys) ("Your keys could not be read").

Verification

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter PortingFailureReasonTests passed (24/24 tests).
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter PortingFailureEngineTests passed (1/1 test).
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test passed (1,129/1,129 tests).
  • bash scripts/build_app.sh built ~/Applications/NXLibrary Dev.app.
  • codesign --verify --deep --strict "$HOME/Applications/NXLibrary Dev.app" passed.
  • python3 scripts/check_publication.py passed.

@Bium23

Bium23 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

I verified the pack_app.py failure text and have retained this fix and its regression coverage in the local 0.1.4.2 preparation, with credit to @eduardomozart.

The classifier recognizes the app-packing disk-space check, includes its 1 GiB reserve when reporting required free space, and offers Open Storage. NUP/extracted sources pass no keys path to the fallback, so an unrelated failure is not presented as missing keys. The engine-message contract test also searches dm/mac.

The full local suite passes 1,166 tests. This is still unreleased local work; I am keeping the PR open until the hotfix integration is available. The original contribution should retain author credit, and the final integration commit will be linked here before this is considered resolved.

@Bium23 Bium23 mentioned this pull request Nov 9, 2026
Bium99 pushed a commit that referenced this pull request Nov 9, 2026
Release NX Library 0.1.4.2 with the reviewed upstream 79741184 pin.

Includes session recap and Xcode requirements fixes, disk/keyless error
classification, live elapsed/hour/percentage build feedback, confirmed
pipeline log progress, independent icon source/location, original icon
restoration and missing-art reporting, cancellable Play while signing,
Title DB caching and 120 FPS persistence coverage. Update documentation,
version and release notes; preserve the documented manual-check limits.

PR #13 is retained and PR #11 adapted with co-author attribution to
Eduardo Mozart de Oliveira; their original branches are reconciled after
release rather than reported as merged unchanged.

Co-Authored-By: Eduardo Mozart de Oliveira <2974895+eduardomozart@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Bium23

Bium23 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Included in NX Library 0.1.4.2 through the release integration PR #14.

The disk-space classification, 1 GiB reserve, keyless-source fallback correction and regression tests are retained. @eduardomozart is credited in the release notes/changelog and as a co-author of the integration commit.

Closing this contribution PR as incorporated through that integration; the original branch was not merged separately. The full release checks and updater-archive validation passed.

@Bium23 Bium23 closed this Nov 9, 2026
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