[GH-ISSUE #5323] native_hooks property_setters_refuse_no_change fails on a Windows CRLF checkout #1639

Closed
opened 2026-11-02 15:48:34 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @mariuslozo-boop on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5323

Originally assigned to: @mariuslozo-boop on GitHub.

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

On Windows with Git for Windows' default core.autocrlf=true, .rs files are checked out with CRLF.
property_setters_refuse_no_change (crates/horizon-client/src/game/native_hooks.rs) reads its own
source with include_str! and looks for function heads written with "\n", e.g.
" pub(super) fn native_set_block_property(\n &mut self,\n ticks:". With CRLF that
text is never found and the test panics at its expect(head):

cargo test -p horizon-client --bin horizon-client native_hooks::tests
---- game::native_hooks::tests::property_setters_refuse_no_change stdout ----
panicked at crates\horizon-client\src\game\native_hooks.rs:2630:48:
    pub(super) fn native_set_block_property(
        &mut self,
        ticks:

It passes on an LF checkout (Linux, macOS, CI). I ran the tests of every crate in the game workspace,
the launcher, horizon-telemetry-server and horizon-mod-registry, plus the Python tests, on a CRLF
checkout of main (571ec1b76). This is the only failure that comes from line endings. The other source
readers already cope: they split on lines, strip \r, or search for text that a CRLF file still contains.

Fix: read the source with its line ends normalized, as the launcher's
mojang_downloads_only_for_an_owner does since 9cdfc5bd4.

Originally created by @mariuslozo-boop on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5323 Originally assigned to: @mariuslozo-boop on GitHub. > 🤖 Filed by mariuslozo-boop's AI agent (Claude Code, Claude Opus 5.5), not by mariuslozo-boop personally. On Windows with Git for Windows' default `core.autocrlf=true`, `.rs` files are checked out with CRLF. `property_setters_refuse_no_change` (`crates/horizon-client/src/game/native_hooks.rs`) reads its own source with `include_str!` and looks for function heads written with `"\n"`, e.g. `" pub(super) fn native_set_block_property(\n &mut self,\n ticks:"`. With CRLF that text is never found and the test panics at its `expect(head)`: ``` cargo test -p horizon-client --bin horizon-client native_hooks::tests ---- game::native_hooks::tests::property_setters_refuse_no_change stdout ---- panicked at crates\horizon-client\src\game\native_hooks.rs:2630:48: pub(super) fn native_set_block_property( &mut self, ticks: ``` It passes on an LF checkout (Linux, macOS, CI). I ran the tests of every crate in the game workspace, the launcher, `horizon-telemetry-server` and `horizon-mod-registry`, plus the Python tests, on a CRLF checkout of main (571ec1b76). This is the only failure that comes from line endings. The other source readers already cope: they split on lines, strip `\r`, or search for text that a CRLF file still contains. Fix: read the source with its line ends normalized, as the launcher's `mojang_downloads_only_for_an_owner` does since 9cdfc5bd4.
Author
Owner

@mariuslozo-boop commented on GitHub (Oct 31, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6547102886 --> @mariuslozo-boop commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim
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#1639
No description provided.