Skip to content

Set up: read the build's error when the path has an accent - #640

Merged
featureJosh merged 1 commit into
mainfrom
fix/setup-error-utf8
Nov 13, 2026
Merged

featureJosh merged 1 commit into
mainfrom
fix/setup-error-utf8

Conversation

@featureJosh

Copy link
Copy Markdown
Collaborator

What it changes

The setup.log in #630 shows every Set up since the first 0.12 attempt ending with FAILED: game build (exit code: 1). Last error output: and nothing after it, even with 0.11.1, which had built at the same path the day before. The game folder is C:\Users\<user>\OneDrive\Área de Trabalho\....

The error was lost on the way to the launcher:

  • pkp_build.py runs with python -I, which writes a pipe in the ANSI code page (cp1252 on a Portuguese Windows). The @error line names the game folder, so the Á went out as byte 0xC1, which is not UTF-8.
  • The launcher read child output with BufReader::lines().map_while(Result::ok). That ends the whole stream at the first line that is not UTF-8, so the @error line and everything after it were dropped.

Now:

  • pkp_build.py writes stdout and stderr as UTF-8 (reconfigure). That covers its --lift-one children too, since they run the same file and lift() already decodes them as UTF-8.
  • New launcher/src-tauri/src/child_lines.rs has one line reader for a child's output. It reads bytes that are not UTF-8 lossily (U+FFFD) and keeps going, and strips \n / \r\n the way lines() did. It replaces all eight readers with the same flaw, in gamebuild.rs, harness.rs, shaders.rs and dlss.rs, and has one unit test (cp1252 bytes in the middle of a stream). The two examples/ include it by path, like the other modules.

The underlying build failure is still unknown; this PR makes the log name it. The failures land within a second, where the script replaces files or deletes folders under build\, which points at OneDrive holding the files while it syncs the Desktop folder. Moving the game folder out of OneDrive (for example C:\Games) is the workaround to suggest until the player's log, on a launcher with this fix, names the error.

Fixes #630 (the missing reason; the player's own build failure needs the new log)

For players

  • CHANGELOG.md ## Unreleased has an entry (Before / Now / Still not)
  • Needs Set up again / Finish update: no. pkp_build.py is in no build stamp, so this is Update only
  • Rebuilds shaders: no

Pros

  • Any tool's error that names an accented path (Portuguese, Spanish, French... Windows user folders) now reaches the screen and setup.log
  • One shared reader instead of eight copies of the same pattern

Cons

  • A line from a tool that still writes in the ANSI code page (not pkp_build.py) shows � in place of the accented letter instead of the letter

🤖 Generated with Claude Code

The game build runs Python with -I, which writes a pipe in the ANSI code page
(cp1252 on a Portuguese Windows). Its @error line named the game folder
("OneDrive\Área de Trabalho"), and the launcher's line readers
(BufRead::lines + map_while(Result::ok)) stopped at the first line that is not
UTF-8, so the reason was dropped and setup.log said only "exit code: 1" (#630).

- pkp_build.py writes stdout and stderr as UTF-8 (its --lift-one children too).
- child_lines.rs: one line reader for a child's output that reads bytes that
  are not UTF-8 lossily instead of ending the stream; used by the game build,
  the shader translator, the shader tools and the DLSS download.

pkp_build.py is in no build stamp: nothing is lifted, compiled or translated
again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@featureJosh
featureJosh merged commit 82f38dd into main Nov 13, 2026
2 checks passed
@featureJosh
featureJosh deleted the fix/setup-error-utf8 branch November 13, 2026 17:20
@featureJosh featureJosh mentioned this pull request Nov 13, 2026
3 tasks done
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.

Setup error after update

1 participant