[PR #698] [MERGED] Launcher: Windows tests pass again (releases blocked since launcher-v0.4.0) #2739

Closed
opened 2026-11-02 15:58:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: launcher-win-fix


📝 Commits (2)

  • 05821d4 Launcher: Windows tests check behaviour, not symlink paths
  • bff5891 Launcher: Cargo.lock has horizon-port-pack's horizon-mods dependency

📊 Changes

5 files changed (+59 additions, -13 deletions)

View changed files

📝 .github/workflows/launcher.yml (+2 -1)
📝 launcher/Cargo.lock (+12 -0)
📝 launcher/src/modpacks.rs (+2 -1)
📝 launcher/src/sources.rs (+13 -3)
📝 launcher/src/sources_tests.rs (+30 -8)

📄 Description

Every launcher run since 2026-10-16 failed in build windows, so nothing after launcher-v0.4.0 went out: no preparing from Prism, MultiMC, Modrinth App, ATLauncher or GDLauncher folders (#434), and no Import modpack (#663). A Windows player on Discord couldn't prepare from Prism today because of it.

Root cause: the tests, not the code. On Windows, sources::make_link already avoids symlinks, which need developer mode. It hard-links the client jar (and copies it if the folders are on different volumes), and it makes a junction (mklink /J) for libraries and assets. horizon-prepare reads that layout and checks each file's sha1, so it works for players. The tests compared fs::canonicalize() of the linked jar with the launcher's jar. That only holds for a symlink: a hard link's canonical path is its own path.

  • sources_tests.rs: same_file checks that the linked jar is the launcher's file: a byte written through one shows in the other, and then it is restored. This holds for a symlink and a hard link alike. The relink test also checks that the jar no longer points at Prism's file.
  • modpacks.rs: the profile test compares --dev-mod arguments as Paths, not strings ending in a/carry.
  • make_link (Windows): mklink /J's paths are always quoted (raw_arg). Rust only quotes arguments that contain spaces, and cmd reads an unquoted & or ^ (allowed in a Windows user name) as its own syntax. New test: folders_with_ampersands_are_linked.
  • launcher/Cargo.lock: adds horizon-port-pack's new horizon-mods dependency (1f1d5a5a). Without it, every --locked launcher build on main fails, on all three systems.
  • launcher.yml: cargo test runs every test target (the library, the binary's unit tests, tests/), not just --lib. The other targets all pass on Windows.

CI proof (push to launcher-win-fix: it builds, the release job is a dry run): https://github.com/ludovic111/horizon/actions/runs/39033853347. Linux, macOS and Windows are green. Windows: 52 library tests and 5 more in the other targets, all passing.

On the Mac mini, in launcher/, both of these pass: cargo test --features gpui/runtime_shaders and cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings.

🤖 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/698 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `launcher-win-fix` --- ### 📝 Commits (2) - [`05821d4`](https://github.com/horizon-rust/horizon/commit/05821d4e621c438e7a1ed933adb9f451ee323185) Launcher: Windows tests check behaviour, not symlink paths - [`bff5891`](https://github.com/horizon-rust/horizon/commit/bff5891073489bd2bcd850869c071e5942498cbe) Launcher: Cargo.lock has horizon-port-pack's horizon-mods dependency ### 📊 Changes **5 files changed** (+59 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/launcher.yml` (+2 -1) 📝 `launcher/Cargo.lock` (+12 -0) 📝 `launcher/src/modpacks.rs` (+2 -1) 📝 `launcher/src/sources.rs` (+13 -3) 📝 `launcher/src/sources_tests.rs` (+30 -8) </details> ### 📄 Description Every launcher run since 2026-10-16 failed in **build windows**, so nothing after launcher-v0.4.0 went out: no preparing from Prism, MultiMC, Modrinth App, ATLauncher or GDLauncher folders (#434), and no Import modpack (#663). A Windows player on Discord couldn't prepare from Prism today because of it. **Root cause: the tests, not the code.** On Windows, `sources::make_link` already avoids symlinks, which need developer mode. It hard-links the client jar (and copies it if the folders are on different volumes), and it makes a junction (`mklink /J`) for `libraries` and `assets`. horizon-prepare reads that layout and checks each file's sha1, so it works for players. The tests compared `fs::canonicalize()` of the linked jar with the launcher's jar. That only holds for a symlink: a hard link's canonical path is its own path. - `sources_tests.rs`: `same_file` checks that the linked jar *is* the launcher's file: a byte written through one shows in the other, and then it is restored. This holds for a symlink and a hard link alike. The relink test also checks that the jar no longer points at Prism's file. - `modpacks.rs`: the profile test compares `--dev-mod` arguments as `Path`s, not strings ending in `a/carry`. - `make_link` (Windows): `mklink /J`'s paths are always quoted (`raw_arg`). Rust only quotes arguments that contain spaces, and cmd reads an unquoted `&` or `^` (allowed in a Windows user name) as its own syntax. New test: `folders_with_ampersands_are_linked`. - `launcher/Cargo.lock`: adds horizon-port-pack's new `horizon-mods` dependency (1f1d5a5a). Without it, every `--locked` launcher build on main fails, on all three systems. - `launcher.yml`: `cargo test` runs every test target (the library, the binary's unit tests, `tests/`), not just `--lib`. The other targets all pass on Windows. CI proof (push to `launcher-win-fix`: it builds, the release job is a dry run): https://github.com/ludovic111/horizon/actions/runs/39033853347. Linux, macOS and Windows are green. Windows: 52 library tests and 5 more in the other targets, all passing. On the Mac mini, in `launcher/`, both of these pass: `cargo test --features gpui/runtime_shaders` and `cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings`. 🤖 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-02 15:58:41 +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#2739
No description provided.