fix(check): a folder too deep for Windows and a .nx archive are said as such, not as a damaged file (#205) #232

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/check-deep-folder-nx into main 2026-11-21 19:15:29 +00:00
Owner

Issue #205's two game-file checks both told the player their file was damaged when it wasn't: one failed because the launcher's folder is too deep for Windows to load Python's own parts, the other because the file is a .nx archive, which no released Longshot reads yet. This PR says what is actually wrong and what to do about it.

Summary

  • Folder too deep (#205, first report). ImportError: DLL load failed while importing backend_c: The filename or extension is too long comes from the build tools' Python. Windows won't load a .pyd from a path of 260 characters or more, and that happens when a portable launcher's data folder sits deep on a drive. Longshot's long_paths.py (Longshot#1132) covers file opens, but not extension loading. The launcher sent this error to "This file is damaged", because the message contains nup.py stopped.
    • GameCheck.Of: a DLL load failed is now this PC's failure (CheckFailed, ThisPc), never the file's.
    • MakeGameRun.TooDeep: after such a failure on Windows, the launcher measures the tools' Python folder. If a path there is 260 characters or more, the text names that path and its length and says to move Longshot's folder closer to the top of the drive (for example to C:\Longshot). It runs for the game-file check and for a build that stops this way.
    • Problems.LongFolder: the problem page and the check both say "Longshot's folder is too deep" (it also matches Python's English words when nothing could be measured).
  • .nx archive (#205, second report). not a NUP package (magic b'NXAR') means nup.py was given a real NXFormat .nx. Every Longshot release's build tools read .nup only, and reading .nx is still the WIP Longshot#685. The launcher used to say "This file is not a .nup or .nx package, or its beginning is damaged". It now says this is a .nx archive that this version's build tools can't read, and to pick the .nup of the dump instead. No new format is supported here.

The new texts aren't in the catalogs yet, so they show in English, like the 347 other recent texts.

Testing

  • python -I tests/test_launcher_core.py: 2609 checks pass, including new ones. The GameCheck cases cover the NXAR message, Python's English and German DLL load failed, and the launcher's own words. TooDeep is checked with a fake 300-character .pyd, a shallow folder, Linux, and another error. Problems.FromBuild gets LongFolder for these and Unknown for unmeasured non-English words.
  • dotnet build App: builds with no warnings.
  • LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py: 3 failures (test_the_bump, test_the_next_stable, test_check_tag_against_the_published_releases). They fail the same way on an unchanged checkout, so this PR doesn't cause them.
  • Not run on Windows: this was made on Linux, so the deep-folder message hasn't been seen on a real deep folder yet.

🤖 Generated with Claude Code

Issue #205's two game-file checks both told the player their file was damaged when it wasn't: one failed because the launcher's folder is too deep for Windows to load Python's own parts, the other because the file is a `.nx` archive, which no released Longshot reads yet. This PR says what is actually wrong and what to do about it. ## Summary - **Folder too deep (#205, first report).** `ImportError: DLL load failed while importing backend_c: The filename or extension is too long` comes from the build tools' Python. Windows won't load a `.pyd` from a path of 260 characters or more, and that happens when a portable launcher's data folder sits deep on a drive. Longshot's `long_paths.py` (Longshot#1132) covers file opens, but not extension loading. The launcher sent this error to "This file is damaged", because the message contains `nup.py stopped`. - `GameCheck.Of`: a `DLL load failed` is now this PC's failure (CheckFailed, ThisPc), never the file's. - `MakeGameRun.TooDeep`: after such a failure on Windows, the launcher measures the tools' Python folder. If a path there is 260 characters or more, the text names that path and its length and says to move Longshot's folder closer to the top of the drive (for example to `C:\Longshot`). It runs for the game-file check and for a build that stops this way. - `Problems.LongFolder`: the problem page and the check both say "Longshot's folder is too deep" (it also matches Python's English words when nothing could be measured). - **`.nx` archive (#205, second report).** `not a NUP package (magic b'NXAR')` means nup.py was given a real NXFormat `.nx`. Every Longshot release's build tools read `.nup` only, and reading `.nx` is still the WIP Longshot#685. The launcher used to say "This file is not a .nup or .nx package, or its beginning is damaged". It now says this is a `.nx` archive that this version's build tools can't read, and to pick the `.nup` of the dump instead. No new format is supported here. The new texts aren't in the catalogs yet, so they show in English, like the 347 other recent texts. ## Testing - `python -I tests/test_launcher_core.py`: 2609 checks pass, including new ones. The GameCheck cases cover the NXAR message, Python's English and German `DLL load failed`, and the launcher's own words. `TooDeep` is checked with a fake 300-character `.pyd`, a shallow folder, Linux, and another error. `Problems.FromBuild` gets LongFolder for these and Unknown for unmeasured non-English words. - `dotnet build App`: builds with no warnings. - `LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py`: 3 failures (`test_the_bump`, `test_the_next_stable`, `test_check_tag_against_the_published_releases`). They fail the same way on an unchanged checkout, so this PR doesn't cause them. - Not run on Windows: this was made on Linux, so the deep-folder message hasn't been seen on a real deep folder yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(check): a folder too deep for Windows and a .nx archive are said as such, not as a damaged file (#205)
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 15s
2d6d290e4b
Python's 'DLL load failed' (its own .pyd under a path of 260 characters or more) is this PC's failure, not the
file's: the check and the build measure the build tools' Python folder and say Longshot's folder is too deep, with
the path and its length (Problems.LongFolder). A .nx archive (NXAR) that nup.py refuses is said to be a .nx this
version's build tools can't read, rather than a damaged or unknown file.

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

Possibly related, for context:

  • PR MagicBeanDev/Longshot#685 WIP: feat(builder): accept .nx archives (NXFormat) as the game files — Open builder work adds actual .nx support; distinct from clearer error reporting
Possibly related, for context: - PR MagicBeanDev/Longshot#685 WIP: feat(builder): accept .nx archives (NXFormat) as the game files — Open builder work adds actual .nx support; distinct from clearer error reporting
HumanBean deleted branch fix/check-deep-folder-nx 2026-11-21 19:15:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!232
No description provided.