[PR #6155] [MERGED] Native mods: build in a real ASCII folder, not a short name (#6009) #6684

Closed
opened 2026-11-03 06:24:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6155
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/native-build-ascii-root


📝 Commits (1)

  • 9364531 Native mods: build in a real ASCII folder, not a short name (#6009)

📊 Changes

2 files changed (+53 additions, -11 deletions)

View changed files

📝 docs/native-mods.md (+5 -3)
📝 launcher/src/backend.rs (+48 -8)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #6009 (native mods still fail to link on launcher 0.2.33 with a Cyrillic Windows user name).

#5189's fix gave the build tools the data folder's short (8.3) name (C:\Users\03E9~1\…). That is only another spelling of the same folder: rustc canonicalizes its own path to find its sysroot, which spells the long, Cyrillic name again, and hands the sysroot's libraries to x86_64-w64-mingw32-gcc → "No such file or directory" on C:/Users/\xca\xe8… (the reporter's log).

Now backend::build_dir uses a real ASCII folder whenever the data folder's resolved path isn't ASCII: %ProgramData%\horizon-launcher-<id> (C:\ProgramData when unset, relative or itself non-ASCII), one per data folder (hash of its path), which every user may create. A folder whose real name is ASCII stays ASCII however a tool resolves it. The short name stays only as the fallback when that folder can't be created. This is the root of the toolchain, the Cargo home, native/ (stage + target) and TMP/TEMP, so no path the toolchain sees comes from the profile. Paths already go to the tools as OsStr (Command::arg/env), never through lossy UTF-8.

Players hit by #6009 download the toolchain once more (it moves to the new folder). The old copy (rust/, cargo/, native/ in the data folder, which never linked for them) is not removed by this PR; "Remove Rust" only removes the current root.

  • a_cyrillic_data_folder_builds_in_an_ascii_folder_of_its_own: C:\Users\Кириченко Павло\AppData\Roaming\horizon-launcher → an ASCII folder in ProgramData, stable, distinct per user, and the defaults for a missing/relative/non-ASCII %ProgramData%.
  • docs/native-mods.md updated.

Tested / not tested

  • macOS: cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (launcher).
  • Windows: cargo clippy --target x86_64-pc-windows-gnu --all-targets -- -D warnings passes (cross MinGW on the Mac), so the #[cfg(windows)] code compiles and lints.
  • Not run: a real native build on Windows with a Cyrillic profile (no Windows machine or Wine here). Worth asking ErKasto to retry on the next launcher.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 58eaf93f1, 5 min 2 s)

Check Result
Scope ✅ 2 files, +53 −11
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 584 passed
launcher rustfmt ✅
launcher clippy ✅
launcher tests ✅ 395 passed
Parity ➖ 10 affected, to run in CI (--quick)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6155 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/native-build-ascii-root` --- ### 📝 Commits (1) - [`9364531`](https://github.com/horizon-rust/horizon/commit/936453136fe385d9a76a81161671d346877d1b38) Native mods: build in a real ASCII folder, not a short name (#6009) ### 📊 Changes **2 files changed** (+53 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docs/native-mods.md` (+5 -3) 📝 `launcher/src/backend.rs` (+48 -8) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #6009 (native mods still fail to link on launcher 0.2.33 with a Cyrillic Windows user name). #5189's fix gave the build tools the data folder's **short (8.3) name** (`C:\Users\03E9~1\…`). That is only another spelling of the same folder: rustc canonicalizes its own path to find its sysroot, which spells the long, Cyrillic name again, and hands the sysroot's libraries to `x86_64-w64-mingw32-gcc` → "No such file or directory" on `C:/Users/\xca\xe8…` (the reporter's log). Now `backend::build_dir` uses a **real ASCII folder** whenever the data folder's resolved path isn't ASCII: `%ProgramData%\horizon-launcher-<id>` (`C:\ProgramData` when unset, relative or itself non-ASCII), one per data folder (hash of its path), which every user may create. A folder whose real name is ASCII stays ASCII however a tool resolves it. The short name stays only as the fallback when that folder can't be created. This is the root of the toolchain, the Cargo home, `native/` (stage + target) and TMP/TEMP, so no path the toolchain sees comes from the profile. Paths already go to the tools as `OsStr` (`Command::arg`/`env`), never through lossy UTF-8. Players hit by #6009 download the toolchain once more (it moves to the new folder). The old copy (`rust/`, `cargo/`, `native/` in the data folder, which never linked for them) is not removed by this PR; "Remove Rust" only removes the current root. - `a_cyrillic_data_folder_builds_in_an_ascii_folder_of_its_own`: `C:\Users\Кириченко Павло\AppData\Roaming\horizon-launcher` → an ASCII folder in ProgramData, stable, distinct per user, and the defaults for a missing/relative/non-ASCII `%ProgramData%`. - docs/native-mods.md updated. ### Tested / not tested - macOS: `cargo fmt --check`, `cargo clippy --all-targets -D warnings`, `cargo test` (launcher). - Windows: `cargo clippy --target x86_64-pc-windows-gnu --all-targets -- -D warnings` passes (cross MinGW on the Mac), so the `#[cfg(windows)]` code compiles and lints. - **Not run:** a real native build on Windows with a Cyrillic profile (no Windows machine or Wine here). Worth asking ErKasto to retry on the next launcher. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 58eaf93f1, 5 min 2 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +53 −11 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 584 passed | | launcher rustfmt | ✅ | | launcher clippy | ✅ | | launcher tests | ✅ 395 passed | | Parity | ➖ 10 affected, to run in CI (--quick) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:24:53 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon#6684
No description provided.