[PR #5324] [MERGED] Let a source-reading test pass on a Windows CRLF checkout #6208

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

📋 Pull Request Information

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

Base: main ← Head: fix/windows-crlf-source-tests


📝 Commits (2)

  • 7846337 Let a source-reading test pass on a Windows CRLF checkout
  • 416b263 Merge main into #5324 (main's perf_bench, triage-list and launcher-string failures, fixed by #5369 and #5397)

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+2 -1)

📄 Description

🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Opus 5.5), not by mariuslozo-boop personally.

What and why

native_hooks::tests::property_setters_refuse_no_change reads native_hooks.rs with include_str! and
searches it for function heads written with "\n". Git for Windows' default core.autocrlf checks .rs
files out with CRLF, so the heads are never found and the test fails on Windows. It now reads the source with
its line ends normalized. That is the same one-line fix the launcher's mojang_downloads_only_for_an_owner
got in 9cdfc5bd4. Only the test changes, and on an LF checkout it still finds the same code.

I ran every crate's tests (game workspace, launcher, telemetry server, mod registry) and the Python tests on a
CRLF checkout of main. This was the only failure caused by line endings, so the fix is a test fix and not a
repo-wide *.rs eol=lf rule in .gitattributes. That file pins LF for generated files that tests compare
byte for byte. A blanket rule would also flag third_party/wgpu-hal/src/vulkan/descriptor.rs, which is stored
with CRLF, as modified in every clone.

Checked: on a CRLF checkout, cargo test -p horizon-client --bin horizon-client native_hooks::tests gave
8 passed, 1 failed before and 9 passed after. On an LF checkout it passes (pr_ready below).

Fixes #5323

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

Label: skip-release (a test only; players see no change).

Vanilla reference

none

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on PCDKBLENDER, against upstream/main at 571ec1b76, 8 min 42 s)

Check Result
Scope ✅ 1 files, +2 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 499 passed (1 min 16 s)
rustfmt ✅ (10 s)
clippy ✅ (1 min 43 s)
tests: horizon-client ❌ 1391 passed, 7 failed (5 min 24 s)
doc tests ✅ 0 passed (4 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 371 affected, (2 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The red rows don't come from this change. The 7 failures are all in tests/lan_bot.rs, and they fail the same
way on untouched main on this Windows machine. They run only where .local holds the vanilla data, so CI skips
them. Parity cannot run on Windows here (its runner imports fcntl). The Label row reads the path; this
changes a test only, so skip-release.

🤖 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/5324 **Author:** [@mariuslozo-boop](https://github.com/mariuslozo-boop) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/windows-crlf-source-tests` --- ### 📝 Commits (2) - [`7846337`](https://github.com/horizon-rust/horizon/commit/784633788dd559337521bfe078459fb99729c56f) Let a source-reading test pass on a Windows CRLF checkout - [`416b263`](https://github.com/horizon-rust/horizon/commit/416b263a304cc1597a66a19abc66ec3761627dd5) Merge main into #5324 (main's perf_bench, triage-list and launcher-string failures, fixed by #5369 and #5397) ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+2 -1) </details> ### 📄 Description > 🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Opus 5.5), not by mariuslozo-boop personally. ## What and why `native_hooks::tests::property_setters_refuse_no_change` reads `native_hooks.rs` with `include_str!` and searches it for function heads written with `"\n"`. Git for Windows' default `core.autocrlf` checks `.rs` files out with CRLF, so the heads are never found and the test fails on Windows. It now reads the source with its line ends normalized. That is the same one-line fix the launcher's `mojang_downloads_only_for_an_owner` got in 9cdfc5bd4. Only the test changes, and on an LF checkout it still finds the same code. I ran every crate's tests (game workspace, launcher, telemetry server, mod registry) and the Python tests on a CRLF checkout of main. This was the only failure caused by line endings, so the fix is a test fix and not a repo-wide `*.rs eol=lf` rule in `.gitattributes`. That file pins LF for generated files that tests compare byte for byte. A blanket rule would also flag `third_party/wgpu-hal/src/vulkan/descriptor.rs`, which is stored with CRLF, as modified in every clone. Checked: on a CRLF checkout, `cargo test -p horizon-client --bin horizon-client native_hooks::tests` gave 8 passed, 1 failed before and 9 passed after. On an LF checkout it passes (pr_ready below). Fixes #5323 ## 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 - [x] tooling: tools, CI, tests, harnesses - [ ] docs Label: `skip-release` (a test only; players see no change). ## Vanilla reference none ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on PCDKBLENDER, against upstream/main at 571ec1b76, 8 min 42 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +2 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 499 passed (1 min 16 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (1 min 43 s) | | tests: horizon-client | ❌ 1391 passed, 7 failed (5 min 24 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 371 affected, (2 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The red rows don't come from this change. The 7 failures are all in `tests/lan_bot.rs`, and they fail the same way on untouched main on this Windows machine. They run only where `.local` holds the vanilla data, so CI skips them. Parity cannot run on Windows here (its runner imports `fcntl`). The Label row reads the path; this changes a test only, so `skip-release`. 🤖 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:15:54 +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#6208
No description provided.