[PR #5202] [MERGED] Native mods: build under a path MinGW-w64 can read (#5189) #6137

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5202
Author: @socksprox
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/native-build-nonascii-path


📝 Commits (1)

  • 873ca4f Native mods: build under a path MinGW-w64 can read (#5189)

📊 Changes

4 files changed (+163 additions, -37 deletions)

View changed files

📝 docs/native-mods.md (+8 -0)
📝 launcher/src/backend.rs (+118 -0)
📝 launcher/src/native_mods.rs (+4 -31)
📝 launcher/src/rust_toolchain.rs (+33 -6)

📄 Description

🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox personally.

What and why

Fixes #5189. A Windows user name like "Кириченко Павло" puts the launcher's data under a non-ASCII path (C:\Users\Кириченко Павло\AppData\Roaming\horizon-launcher\...), and the native-mods build's MinGW-w64 tools — gcc, as, ld, dlltool — open files through ANSI APIs, so the build failed at the link step with exit code 101. Redirecting %APPDATA% changed nothing because dirs::data_dir() reads the known folder, not the variable.

Every path the build's tools see now comes from backend::build_dir(), which returns:

  1. the data folder, resolved (a junction to a drive with an ASCII path now just works, and no link is handed to horizon-mixins), or — when that still isn't ASCII —
  2. the folder's short (8.3) name (GetShortPathNameW), the same files spelled in ASCII, or —
  3. where the volume keeps no short names, a folder under ProgramData named for the data path (horizon-launcher-<sha>), so each user's is its own.

rust_toolchain::root(), cargo_home(), outside_configs() and native_mods::root() all derive from it, and the toolchain's commands get their own TMPDIR/TMP/TEMP under the build dir: gcc/as/ld and cargo install's scratch dir had the same non-ASCII root as everything else. native_mods::build no longer re-canonicalizes the root — on Windows that would undo both spellings.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

None — the launcher's own native-mods build.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on MacBookPro, against origin/main at caf83890c, 57 s)

Check Result
Scope ✅ 4 files, +163 −37
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 495 passed (44 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (6 s)
launcher tests ✅ 318 passed (4 s)
Parity ➖ 254 affected, to run in CI (--quick)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Devin


🔄 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/5202 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/native-build-nonascii-path` --- ### 📝 Commits (1) - [`873ca4f`](https://github.com/horizon-rust/horizon/commit/873ca4fdafe1b9b7ecd0b8225bb399dd5bb7169d) Native mods: build under a path MinGW-w64 can read (#5189) ### 📊 Changes **4 files changed** (+163 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `docs/native-mods.md` (+8 -0) 📝 `launcher/src/backend.rs` (+118 -0) 📝 `launcher/src/native_mods.rs` (+4 -31) 📝 `launcher/src/rust_toolchain.rs` (+33 -6) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox personally. ## What and why Fixes #5189. A Windows user name like "Кириченко Павло" puts the launcher's data under a non-ASCII path (`C:\Users\Кириченко Павло\AppData\Roaming\horizon-launcher\...`), and the native-mods build's MinGW-w64 tools — `gcc`, `as`, `ld`, `dlltool` — open files through ANSI APIs, so the build failed at the link step with exit code 101. Redirecting `%APPDATA%` changed nothing because `dirs::data_dir()` reads the known folder, not the variable. Every path the build's tools see now comes from `backend::build_dir()`, which returns: 1. the data folder, resolved (a junction to a drive with an ASCII path now just works, and no link is handed to horizon-mixins), or — when that still isn't ASCII — 2. the folder's short (8.3) name (`GetShortPathNameW`), the same files spelled in ASCII, or — 3. where the volume keeps no short names, a folder under `ProgramData` named for the data path (`horizon-launcher-<sha>`), so each user's is its own. `rust_toolchain::root()`, `cargo_home()`, `outside_configs()` and `native_mods::root()` all derive from it, and the toolchain's commands get their own `TMPDIR`/`TMP`/`TEMP` under the build dir: `gcc`/`as`/`ld` and `cargo install`'s scratch dir had the same non-ASCII root as everything else. `native_mods::build` no longer re-canonicalizes the root — on Windows that would undo both spellings. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference None — the launcher's own native-mods build. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on MacBookPro, against origin/main at caf83890c, 57 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +163 −37 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 495 passed (44 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (6 s) | | launcher tests | ✅ 318 passed (4 s) | | Parity | ➖ 254 affected, to run in CI (--quick) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:14:10 +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#6137
No description provided.