[PR #5382] [MERGED] horizon-server-files: compare stored properties with the platform line separator #6250

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

📋 Pull Request Information

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

Base: main ← Head: fix/server-props-eol


📝 Commits (1)

  • 5187bab horizon-server-files: compare stored properties with the platform line separator

📊 Changes

2 files changed (+5 additions, -1 deletions)

View changed files

📝 crates/horizon-server-files/src/java_properties.rs (+2 -0)
📝 crates/horizon-server-files/src/properties.rs (+3 -1)

📄 Description

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

What and why

stores_sorted_and_escaped and defaults_match_vanilla_init_settings fail on Windows: they expect the stored
server.properties to end its lines in "\n", but Properties::store writes line_separator(), "\r\n" on Windows.
The code follows vanilla here (see below), so this changes only the tests:

  • stores_sorted_and_escaped expects the platform separator exactly (.replace('\n', line_separator())).
  • defaults_match_vanilla_init_settings reads the stored text with the separator turned back into "\n", so its
    starts_with / contains / ends_with checks stay as they are.

On Linux and macOS line_separator() is "\n", so both tests check the same as before there.
Before: 10 passed, 2 failed on Windows. After: 12 passed.

Fixes #5381

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

net.minecraft.server.dedicated.Settings.store calls java.util.Properties.store(Writer, String). Its store0
ends each line with BufferedWriter.newLine(), which writes System.lineSeparator(). I checked with JDK 25 on Windows:
it writes \r\n. java_properties::line_separator already mirrors this; no player-facing change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on PCDKBLENDER, against upstream/main at 64b84a780, 1 min 50 s)

Check Result
Scope ✅ 2 files, +5 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 500 run, FAILED (errors=1, skipped=2) (1 min 4 s)
rustfmt ✅ (10 s)
clippy ❌ failed (32 s)
tests: horizon-server-files ✅ 12 passed
doc tests ✅ 0 passed
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, (1 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Run on Windows. The red rows also fail on main without this change:

  • clippy: horizon-threads doesn't compile on its own on Windows (boot_paint.rs needs windows-sys features it doesn't turn on). That's #5299.
  • Python tests: test_perf_bench.test_table_distinguishes_missing_scene_load_from_zero (perf_bench.table raises "cannot compare RD 8").
  • Parity: the harness runner imports fcntl, which Windows doesn't have.

Label: tests 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/5382 **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/server-props-eol` --- ### 📝 Commits (1) - [`5187bab`](https://github.com/horizon-rust/horizon/commit/5187bab995763e4d57dedd688c13235d515b6a0e) horizon-server-files: compare stored properties with the platform line separator ### 📊 Changes **2 files changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-server-files/src/java_properties.rs` (+2 -0) 📝 `crates/horizon-server-files/src/properties.rs` (+3 -1) </details> ### 📄 Description > 🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Opus 5.5), not by mariuslozo-boop personally. ## What and why `stores_sorted_and_escaped` and `defaults_match_vanilla_init_settings` fail on Windows: they expect the stored `server.properties` to end its lines in `"\n"`, but `Properties::store` writes `line_separator()`, `"\r\n"` on Windows. The code follows vanilla here (see below), so this changes only the tests: - `stores_sorted_and_escaped` expects the platform separator exactly (`.replace('\n', line_separator())`). - `defaults_match_vanilla_init_settings` reads the stored text with the separator turned back into `"\n"`, so its `starts_with` / `contains` / `ends_with` checks stay as they are. On Linux and macOS `line_separator()` is `"\n"`, so both tests check the same as before there. Before: 10 passed, 2 failed on Windows. After: 12 passed. Fixes #5381 ## 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 ## Vanilla reference `net.minecraft.server.dedicated.Settings.store` calls `java.util.Properties.store(Writer, String)`. Its `store0` ends each line with `BufferedWriter.newLine()`, which writes `System.lineSeparator()`. I checked with JDK 25 on Windows: it writes `\r\n`. `java_properties::line_separator` already mirrors this; no player-facing change. ## Other projects' code none ## Self-check <!-- pr_ready block from D:\Horizon-wt\server-props-eol\.local-drafts\pr_ready.txt --> **pr_ready** (`tools/pr_ready.py --base upstream/main` on PCDKBLENDER, against upstream/main at 64b84a780, 1 min 50 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +5 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 500 run, FAILED (errors=1, skipped=2) (1 min 4 s) | | rustfmt | ✅ (10 s) | | clippy | ❌ failed (32 s) | | tests: horizon-server-files | ✅ 12 passed | | doc tests | ✅ 0 passed | | 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, (1 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Run on Windows. The red rows also fail on main without this change: - clippy: `horizon-threads` doesn't compile on its own on Windows (`boot_paint.rs` needs windows-sys features it doesn't turn on). That's #5299. - Python tests: `test_perf_bench.test_table_distinguishes_missing_scene_load_from_zero` (`perf_bench.table` raises "cannot compare RD 8"). - Parity: the harness runner imports `fcntl`, which Windows doesn't have. Label: tests 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:16:20 +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#6250
No description provided.