fix(check): a .nx that can't be read is the file's, said in plain words #159

Merged
HumanBean merged 1 commit from madebyjordan/LongshotLauncher:fix/nx-check-errors into main 2026-11-17 15:56:17 +00:00
Member

When the check of a .nx fails, the launcher calls it "an error nobody expected" ("The check stopped before it could tell anything about this file: nxar.py stopped ...") instead of saying what is wrong with the file and what to do. The builder reads a .nx with its own reader, nx2/nxar.py (MagicBeanDev/Longshot#685), and its failures start "nxar.py stopped", which GameCheck didn't know. This follows #77, which made the launcher find, browse and drop .nx files.

What changed

  • Core/MakeGameRun.cs, GameCheck.FileFailures: "nxar.py stopped", "not a .nx archive" and ".nx file" are the file's, as nup.py's are. An incomplete or damaged .nx now gets the same words as a .nup ("This file is incomplete ...", "This file is damaged ...").
  • "This file is not a .nup package ..." now says ".nup or .nx". make_game.py tells the two apart by the first bytes, not the name, so a .nx that doesn't start with NXAR goes to nup.py and gets "not a NUP package".
  • A .nx holding the game as NCA files (nxconvert pack from a DNSP or DXCI) is refused by the builder. It now says so, and what to do: make the .nx from the .nup with nxconvert pack-nup, or pick the .nup.
  • Catalogs: the renamed text keeps each translation, with .nup/.nx where it had .nup (as #77 did). The new text is translated into every full catalog, right after the renamed one rather than at the end.
  • tools/screenshots: files-nx-not-usable, a .nx holding NCA files and a damaged one, each classed by GameCheck.Of as a real check would be.

Screenshots

In the comment below: files-nx-not-usable with this change, and the same scene drawn with main's Core/.

Testing

Windows 11, .NET SDK 10.0.404, on main @ 676e300.

  • tests/launcher_core/ScreenChecks.cs, GameCheckChecks: four rows with nxar.py's words (incomplete, damaged, NCA files, not a .nx). The incomplete one is copied from a real run of MagicBeanDev/Longshot#685's make_game.py --check on a cut-short copy of a .nx made with nxconvert 1.0.4 pack-nup; the others are nxar.py's messages as its source writes them. With main's Core/ the checks fail at the renamed row.
  • python -I tests/test_launcher_core.py: on Windows the run stops before ScreenChecks on main too (the CRLF fixtures and ShellLinkChecks, see #121). So GameCheckChecks was also run first in a local copy and passed. The full run is CI's, on Linux.
  • python -I scripts/translations.py: no text of this PR is missing or left over. It still exits 1 for the 30 texts each catalog already lacks on main.
  • dotnet build App -c Release: 0 warnings, 0 errors. tools/screenshots draws the new scene.
  • Not tested: the launcher window by hand with a broken .nx, and Linux.

Merge order: any time. Until MagicBeanDev/Longshot#685 is in a release, no builder says "nxar.py", and nothing changes for a .nup.

🤖 Generated with Claude Code

When the check of a `.nx` fails, the launcher calls it "an error nobody expected" ("The check stopped before it could tell anything about this file: nxar.py stopped ...") instead of saying what is wrong with the file and what to do. The builder reads a `.nx` with its own reader, `nx2/nxar.py` (MagicBeanDev/Longshot#685), and its failures start "nxar.py stopped", which `GameCheck` didn't know. This follows #77, which made the launcher find, browse and drop `.nx` files. ## What changed - **`Core/MakeGameRun.cs`, `GameCheck.FileFailures`:** "nxar.py stopped", "not a .nx archive" and ".nx file" are the file's, as nup.py's are. An incomplete or damaged `.nx` now gets the same words as a `.nup` ("This file is incomplete ...", "This file is damaged ..."). - **"This file is not a .nup package ..."** now says ".nup or .nx". make_game.py tells the two apart by the first bytes, not the name, so a `.nx` that doesn't start with `NXAR` goes to nup.py and gets "not a NUP package". - **A `.nx` holding the game as NCA files** (`nxconvert pack` from a DNSP or DXCI) is refused by the builder. It now says so, and what to do: make the `.nx` from the `.nup` with `nxconvert pack-nup`, or pick the `.nup`. - **Catalogs:** the renamed text keeps each translation, with `.nup/.nx` where it had `.nup` (as #77 did). The new text is translated into every full catalog, right after the renamed one rather than at the end. - **tools/screenshots:** `files-nx-not-usable`, a `.nx` holding NCA files and a damaged one, each classed by `GameCheck.Of` as a real check would be. ## Screenshots In the comment below: `files-nx-not-usable` with this change, and the same scene drawn with main's `Core/`. ## Testing Windows 11, .NET SDK 10.0.404, on main @ 676e300. - `tests/launcher_core/ScreenChecks.cs`, `GameCheckChecks`: four rows with nxar.py's words (incomplete, damaged, NCA files, not a `.nx`). The incomplete one is copied from a real run of MagicBeanDev/Longshot#685's `make_game.py --check` on a cut-short copy of a `.nx` made with nxconvert 1.0.4 `pack-nup`; the others are nxar.py's messages as its source writes them. With main's `Core/` the checks fail at the renamed row. - `python -I tests/test_launcher_core.py`: on Windows the run stops before `ScreenChecks` on main too (the CRLF fixtures and `ShellLinkChecks`, see #121). So `GameCheckChecks` was also run first in a local copy and passed. The full run is CI's, on Linux. - `python -I scripts/translations.py`: no text of this PR is missing or left over. It still exits 1 for the 30 texts each catalog already lacks on main. - `dotnet build App -c Release`: 0 warnings, 0 errors. `tools/screenshots` draws the new scene. - **Not tested:** the launcher window by hand with a broken `.nx`, and Linux. **Merge order:** any time. Until MagicBeanDev/Longshot#685 is in a release, no builder says "nxar.py", and nothing changes for a `.nup`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(check): a .nx that can't be read is the file's, said in plain words
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
51adb99da7
The launcher finds and builds from .nx archives (#77), and the builder reads them with nx2/nxar.py
(MagicBeanDev/Longshot#685). When the check of a .nx fails, make_game.py says "nxar.py stopped: ...", which
GameCheck did not know: a damaged or incomplete .nx showed as an error nobody expected ("The check stopped before
it could tell anything about this file") instead of what is wrong with the file and what to do.

- FileFailures: "nxar.py stopped", "not a .nx archive" and ".nx file" are the file's, as nup.py's are; incomplete
  and damaged archives then get the same words as a .nup.
- "This file is not a .nup package ..." says .nup or .nx (a .nx whose first bytes are not NXAR goes to nup.py).
- A .nx holding the game as NCA files (nxconvert pack from a DNSP or DXCI), which the builder refuses, says so and
  what to do: make the .nx from the .nup with nxconvert pack-nup, or pick the .nup.
- Catalogs: the renamed text keeps each translation with .nup/.nx, as #77 did; the new one is translated.
- tools/screenshots: files-nx-not-usable, a .nx holding NCA files and a damaged one, as GameCheck.Of classes them.
- tests: GameCheckChecks reads nxar.py's real messages (incomplete, damaged, NCA files, not a .nx).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

From tools/screenshots (drawn on Windows, so the scene's Linux paths show with backslashes):

With this PR:
files-nx-not-usable with this PR

The same scene drawn with main's Core/: the file is "Not checked" and the reason is nxar.py's own text.
files-nx-not-usable on main

From `tools/screenshots` (drawn on Windows, so the scene's Linux paths show with backslashes): With this PR: ![files-nx-not-usable with this PR](https://git.magicbean.dev/attachments/64e268f9-77cf-491a-8b6f-2f98cedd8817) The same scene drawn with main's `Core/`: the file is "Not checked" and the reason is nxar.py's own text. ![files-nx-not-usable on main](https://git.magicbean.dev/attachments/be83d12a-2fb6-40c3-913e-6079c720de6e)
Author
Member

Description: Testing now says which nxar.py message came from a real run (the incomplete one) and which are from its source.

Description: Testing now says which nxar.py message came from a real run (the incomplete one) and which are from its source.
HumanBean deleted branch fix/nx-check-errors 2026-11-17 15:56:17 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!159
No description provided.