mirror of
https://github.com/horizon-rust/horizon-mixins.git
synced 2026-12-03 19:34:02 +07:00
[PR #3] [MERGED] Accept verbatim Windows output paths (\\?\C:\...) #12
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
horizon-rust/horizon-mixins#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/horizon-rust/horizon-mixins/pull/3
Author: @d3grando
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @levzzz5154
Base:
main← Head:windows-verbatim-output-path📝 Commits (1)
392b38aAccept verbatim Windows output paths (\?\C:...)📊 Changes
2 files changed (+21 additions, -0 deletions)
View changed files
📝
crates/horizon-mixins-cli/src/staging.rs(+6 -0)📝
crates/horizon-mixins-cli/tests/integration.rs(+15 -0)📄 Description
What and why
applyfails on Windows for any canonicalized--out:output_pathchecks every component of the output path withfs::symlink_metadata, the drive prefix included. OnWindows,
canonicalizereturns a verbatim path (\\?\C:\Users\...), whose first component is\\?\C:: the volumedevice, not a directory, and Windows answers
ERROR_INVALID_FUNCTIONwhen it is stat'ed. A plainC:\...path works(its prefix
C:resolves to the drive's current directory), which is why this never showed on a typed path.The Horizon launcher passes exactly such a path: it canonicalizes its data folder before
apply(for macOS's/tmplink,
launcher/src/native_mods.rs), so native mods couldn't build on Windows at all. Found while building Veinminer0.3.0 on Windows 11, the first Windows build as far as I know (the launcher side is horizon-rust/horizon#3377).
The change
Component::Prefixis pushed and not checked: a drive prefix names a volume, which is never a link. Every componentafter it is checked as before, so a link anywhere in the path is still refused.
Test:
a_canonicalized_output_path_stagesrunsapplywith--outinside a canonicalized directory, as the launcherdoes. On Windows it fails before the change with the error above and passes after it; on Linux and macOS it passes
either way (no prefix).
Checked on Windows 11
On a checkout with LF line endings (
core.autocrlf=false), toolchain 1.95.0 fromrust-toolchain.toml:cargo fmt --all --check: cleancargo clippy --workspace --all-targets --locked -- -D warnings: cleancargo test --workspace --locked: 59 passed, 5 failed. The same 5 fail on0500ff2without this change (58 passed),so they come from Windows itself:
cfg_attributes_shared_module_sources_and_shadowing_fail_closed,indexes_inline_external_path_inherent_and_trait_methods:E_INVALID_PATH"--workspace must name the Cargo workspace root" (likely the same verbatim-path mismatch, withthe path Cargo reports);
compiled_mvp_is_deterministic_preserves_sources_and_unchanged_mtimes,scoped::scoped_features_compile_preserve_inputs_and_unchanged_mtimes:E_ATOMIC_STAGE, by design ("atomic replacement of an existing stage currently requires Linux");output_protection_ownership_trust_and_missing_lockfile:E_STAGE_OWNERSHIPwhere the test expectsE_INVALID_PATH.Also, with Git for Windows' default
core.autocrlf=true, 7 more snapshot tests fail because the fixtures andsnapshots are checked out with CRLF; a
.gitattributeswith* text=auto eol=lfwould make a Windows checkout match.Happy to send that, or to look at the first two failures, in separate pull requests.
End to end: with this tool in place of the pinned one, the released launcher 0.2.21 (MinGW-w64 put on its
PATHbyhand) built Horizon at 83f15fa with Veinminer on Windows, and the mod mined a whole coal vein with one break in game.
The launcher pull request also stops passing a verbatim path, so it doesn't depend on this one; this one fixes the
tool for anyone who passes one.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.