Skip to content

fix: a game folder whose deepest file passes 260 characters builds and plays (#1468) - #1497

Merged
hckrman101 merged 3 commits into
mainfrom
fix/long-paths
Nov 10, 2026
Merged

hckrman101 merged 3 commits into
mainfrom
fix/long-paths

Conversation

@NotRexed

Copy link
Copy Markdown
Owner

Fixes #1468: in a deeply nested folder, the unpack stopped with FileNotFoundError on a 262-character path in romfs\Event\EventSetting. Windows' 260-character limit (MAX_PATH) applies unless the program uses extended-length paths or the system's long-paths setting is on, and that setting is off by default.

Builder (Python): the unpack, the damaged-file scan and stand-ins, the romfs links into the game folder and the shader list step use extended-length paths (\?\...) on Windows. nup.long_path() and make_game.long_path() do nothing elsewhere. The scan still returns paths in the form it was given, so callers and tests see no change.

Game (host/nn_fs.c): path buffers go from 260 to 1024 bytes. Each file call (CreateFile, GetFileAttributes, Find*, CreateDirectory, Delete, Move, RemoveDirectory) goes through its wide function. The path is converted with the process code page (UTF-8 under the game's manifest), and a long absolute path gets the extended prefix. Short paths behave exactly as before.

Tested:

  • On this PC (long-paths setting off), the unpack wrote and re-read a 426-character path; the damaged-file scan walked it.
  • test_make_game_cache, test_nup_stand_in, test_nup_verify, test_finish_output and test_shader_census_cmd pass. The last now expects the long form on Windows.
  • nn_fs.c is clean with -Wall -Wextra.
  • Still to run: the game from a folder whose deepest romfs file passes 260 characters, after the next build.

🤖 Generated with Claude Code

NotRexed pushed a commit that referenced this pull request Nov 10, 2026
Keep the new nn::fs wide conversions explicit about UTF-8, matching the game's
char strings and the existing source check. Compare equivalent plain and
extended Windows paths in the extraction fixture without changing the paths
passed to real metadata calls or allowing sibling paths.

Add a native fixture for the actual conversion helpers, including Unicode
directory-entry names and long drive/UNC paths. This supplements PR #1497.

Assisted-by: OpenAI Codex

Co-authored-by: OpenAI Codex <noreply@openai.com>
NotRexed and others added 3 commits November 10, 2026 11:41
…d plays (#1468)

The builder's unpack, damaged-file scan, stand-ins, romfs links and shader list take extended-length paths (\?\) on
Windows; the game's file layer (host/nn_fs.c) keeps paths up to 1024 bytes and calls the wide file functions, a long absolute
path given the extended prefix. Neither needs Windows' long-paths setting. Short paths are as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the new nn::fs wide conversions explicit about UTF-8, matching the game's
char strings and the existing source check. Compare equivalent plain and
extended Windows paths in the extraction fixture without changing the paths
passed to real metadata calls or allowing sibling paths.

Add a native fixture for the actual conversion helpers, including Unicode
directory-entry names and long drive/UNC paths. This supplements PR #1497.

Assisted-by: OpenAI Codex

Co-authored-by: OpenAI Codex <noreply@openai.com>
…rs since this PR)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hckrman101
hckrman101 merged commit d231d17 into main Nov 10, 2026
7 of 9 checks passed
NotRexed added a commit that referenced this pull request Nov 10, 2026
…path (#1497 extracts through \?\ paths)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NotRexed added a commit that referenced this pull request Nov 10, 2026
…y renames; long-path out-of-space folder; DrawParameters Ctx) (#1793)

* tests: the lift cleanup fixture defines PREPARE; the RecompLauncher keys read ini_key's own renames

Main's Python source checks failed on both since today's merges:
- test_lift_cleanup_error runs make_game.py's say()/fail() in its own namespace,
  and say() now reads PREPARE (#1102's --prepare): NameError. The fixture gives
  it PREPARE=False, its value at the start.
- test_recomplauncher_json allowed only output_res as a row whose saved key is
  not its name; ini_key also saves resolution, upscaling and dlss, and the
  manifest uses the first two. The test now reads those renames from ini_key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* tests: the out-of-space check accepts the folder as its Windows long path (#1497 extracts through \?\ paths)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* tests: the DrawParameters fixture's Ctx has mesh_fallback (the block reads it since the mesh fallback skips a task's DrawIndex)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(wayland): the libdecor hint check is Linux's (POSIX setenv in its harness), skipped on Windows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(antilag): the present stage is checked in present_out, present_image's end since present ahead

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

Game won't build if folder names are too long

2 participants