[PR #858] [MERGED] Prepare: find native jars where Prism Launcher keeps them #2862

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

📋 Pull Request Information

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

Base: main ← Head: fix/prism-prepare-libraries


📝 Commits (1)

  • 3e825ea Prepare: find native jars where Prism Launcher keeps them (#849)

📊 Changes

3 files changed (+112 additions, -11 deletions)

View changed files

📝 crates/horizon-prepare/src/artifacts.rs (+78 -9)
📝 crates/horizon-prepare/src/sounds.rs (+1 -1)
📝 launcher/src/sources_tests.rs (+33 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #849. Reported by famescare on Discord (Windows, launcher 0.6.0, a fresh Prism Launcher 26.3 instance): thanks for the clear report and screenshot.

What was wrong

Prism Launcher's metadata (meta.prismlauncher.org net.minecraft/26.3.json and org.lwjgl3/3.4.3.json) renames every native jar: Mojang's com.mojang:jtracy:1.14.38:natives-windows is Prism's com.mojang:jtracy-natives-windows:1.14.38, and Prism stores a library at its name's path. So Prism keeps the jar at
libraries/com/mojang/jtracy-natives-windows/1.14.38/jtracy-natives-windows-1.14.38.jar, not at the version JSON's
libraries/com/mojang/jtracy/1.14.38/jtracy-1.14.38-natives-windows.jar. Same download URL, same bytes, same sha1. The game runs in Prism because Prism has the file. Horizon's prepare looked only at Mojang's path and stopped on the first native jar, jtracy.

I compared all 114 libraries of Mojang's 26.3 version JSON with Prism's metadata. The 56 differences are exactly the native jars (jtracy and every LWJGL natives jar, all OSes and architectures), each one under this rename with an identical sha1. Every other library is at Mojang's path. MultiMC's metadata keeps Mojang's names, so its paths already matched.

The fix

horizon_prepare::artifacts::launcher_library: when the version JSON's path is missing, prepare looks under the Prism name (group/artifact-classifier/version/artifact-classifier-version.jar). The copy is still checked against the version JSON's sha1, so nothing unverified gets in. I chose finding the jar where Prism keeps it over downloading it or dropping natives from the import:

  • Nothing is downloaded: the file is already on the player's disk.
  • The set of imported libraries, prepared.json and the Python harnesses that read libraries/client all stay as they are.

The missing-file hints no longer say "install Minecraft Java Edition with the official launcher". They now say to play the version once in the launcher you play with (the official launcher, Prism Launcher, MultiMC...). The missing-asset hint changed the same way.

Tests

  • launcher/src/sources_tests.rs prism_native_jars_are_found_through_the_linked_folder: famescare's layout (Prism root, meta/net.minecraft/26.3.json, the jtracy natives jar only under Prism's name) is resolved into linked-minecraft. Mojang's path is absent there, and prepare's lookup finds Prism's file through the link.
  • horizon-prepare libraries_are_found_where_prism_launcher_keeps_them: Mojang's path wins when both exist, Prism's path is used otherwise, and a plain library or an unsafe name falls back to the version JSON's path.

Self-check (commit 3e825eaa, this branch)

cargo fmt --all --check                                        ok
cargo clippy --workspace --all-targets -- -D warnings           ok
launcher: cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings   ok
launcher: cargo test --features gpui/runtime_shaders            ok (sources: 18 passed)
cargo test -p horizon-prepare                                   ok (22 passed)
tools/parity.py --changed origin/main                           0 of 320 harnesses depend on these files

cd launcher && cargo fmt --check still reports launcher/src/modpacks.rs, which is already unformatted on main. I left that file alone.

Needs Ludovic

Nothing. Not tested on a real Windows Prism install. The Prism layout comes from Prism's published metadata and is rebuilt in the tests.

🤖 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/858 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/prism-prepare-libraries` --- ### 📝 Commits (1) - [`3e825ea`](https://github.com/horizon-rust/horizon/commit/3e825eaa408fd6c8a7f4319913140bf43b0ec387) Prepare: find native jars where Prism Launcher keeps them (#849) ### 📊 Changes **3 files changed** (+112 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-prepare/src/artifacts.rs` (+78 -9) 📝 `crates/horizon-prepare/src/sounds.rs` (+1 -1) 📝 `launcher/src/sources_tests.rs` (+33 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #849. Reported by **famescare** on Discord (Windows, launcher 0.6.0, a fresh Prism Launcher 26.3 instance): thanks for the clear report and screenshot. ## What was wrong Prism Launcher's metadata (`meta.prismlauncher.org` `net.minecraft/26.3.json` and `org.lwjgl3/3.4.3.json`) renames every native jar: Mojang's `com.mojang:jtracy:1.14.38:natives-windows` is Prism's `com.mojang:jtracy-natives-windows:1.14.38`, and Prism stores a library at its name's path. So Prism keeps the jar at `libraries/com/mojang/jtracy-natives-windows/1.14.38/jtracy-natives-windows-1.14.38.jar`, not at the version JSON's `libraries/com/mojang/jtracy/1.14.38/jtracy-1.14.38-natives-windows.jar`. Same download URL, same bytes, same sha1. The game runs in Prism because Prism has the file. Horizon's prepare looked only at Mojang's path and stopped on the first native jar, jtracy. I compared all 114 libraries of Mojang's 26.3 version JSON with Prism's metadata. The 56 differences are exactly the native jars (jtracy and every LWJGL natives jar, all OSes and architectures), each one under this rename with an identical sha1. Every other library is at Mojang's path. MultiMC's metadata keeps Mojang's names, so its paths already matched. ## The fix `horizon_prepare::artifacts::launcher_library`: when the version JSON's path is missing, prepare looks under the Prism name (`group/artifact-classifier/version/artifact-classifier-version.jar`). The copy is still checked against the version JSON's sha1, so nothing unverified gets in. I chose finding the jar where Prism keeps it over downloading it or dropping natives from the import: - Nothing is downloaded: the file is already on the player's disk. - The set of imported libraries, prepared.json and the Python harnesses that read `libraries/client` all stay as they are. The missing-file hints no longer say "install Minecraft Java Edition with the official launcher". They now say to play the version once in the launcher you play with (the official launcher, Prism Launcher, MultiMC...). The missing-asset hint changed the same way. ## Tests - `launcher/src/sources_tests.rs` `prism_native_jars_are_found_through_the_linked_folder`: famescare's layout (Prism root, `meta/net.minecraft/26.3.json`, the jtracy natives jar only under Prism's name) is resolved into `linked-minecraft`. Mojang's path is absent there, and prepare's lookup finds Prism's file through the link. - `horizon-prepare` `libraries_are_found_where_prism_launcher_keeps_them`: Mojang's path wins when both exist, Prism's path is used otherwise, and a plain library or an unsafe name falls back to the version JSON's path. ## Self-check (commit 3e825eaa, this branch) ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok launcher: cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings ok launcher: cargo test --features gpui/runtime_shaders ok (sources: 18 passed) cargo test -p horizon-prepare ok (22 passed) tools/parity.py --changed origin/main 0 of 320 harnesses depend on these files ``` `cd launcher && cargo fmt --check` still reports `launcher/src/modpacks.rs`, which is already unformatted on main. I left that file alone. ## Needs Ludovic Nothing. Not tested on a real Windows Prism install. The Prism layout comes from Prism's published metadata and is rebuilt in the tests. 🤖 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:59:40 +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#2862
No description provided.