[PR #8] [MERGED] fix(native): refuse post-build bins that share a target file #17

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mixins/pull/8
Author: @reservedbytes
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/post-build-bin-clash


📝 Commits (1)

  • 5c6d82b fix(native): refuse post-build bins that share a target file

📊 Changes

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

View changed files

📝 crates/horizon-mixins-cli/tests/cases/native.rs (+53 -0)
📝 crates/horizon-mixins-core/src/index.rs (+6 -0)
📝 crates/horizon-mixins-core/src/native.rs (+32 -0)
📝 crates/horizon-mixins-core/src/plan.rs (+1 -1)
📝 docs/crates-data-and-named-hooks.md (+3 -1)

📄 Description

What and why

The launcher (#3964) builds every [[post_build]] bin into one shared target folder, and runs the steps afterwards.
A bin's file name doesn't include its package, so two mods with a bin named bake both run the last one built, and the build still says success.
A step bin named horizon-client even replaces the game binary.

Reproduced with horizon-launcher native-build on #3964:
bake of beta ran for HORIZON_NATIVE_MOD=alpha
bake of beta ran for HORIZON_NATIVE_MOD=beta

plan now refuses a step bin whose file name (ignoring case) is a workspace bin or another crate's step bin, with E_POST_BUILD.

One crate's bin can still be run by several steps.

Alternative (or as well): the launcher could build each mod's bins in its own folder, and take the game binary first.
Then any bin name works, and older mixins revs are covered too.
This PR just catches it at plan time, before minutes of compiling.

Checks

cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked (90 passed, new test post_build_bins_never_share_a_file_in_the_target_folder)


🔄 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-mixins/pull/8 **Author:** [@reservedbytes](https://github.com/reservedbytes) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/post-build-bin-clash` --- ### 📝 Commits (1) - [`5c6d82b`](https://github.com/horizon-rust/horizon-mixins/commit/5c6d82b30e21d54d64f164a5ec04a2b0cb7fec1c) fix(native): refuse post-build bins that share a target file ### 📊 Changes **5 files changed** (+95 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-mixins-cli/tests/cases/native.rs` (+53 -0) 📝 `crates/horizon-mixins-core/src/index.rs` (+6 -0) 📝 `crates/horizon-mixins-core/src/native.rs` (+32 -0) 📝 `crates/horizon-mixins-core/src/plan.rs` (+1 -1) 📝 `docs/crates-data-and-named-hooks.md` (+3 -1) </details> ### 📄 Description ## What and why The launcher (#3964) builds every `[[post_build]]` bin into one shared target folder, and runs the steps afterwards. A bin's file name doesn't include its package, so two mods with a bin named `bake` both run the last one built, and the build still says success. A step bin named `horizon-client` even replaces the game binary. Reproduced with `horizon-launcher native-build` on #3964: bake of beta ran for HORIZON_NATIVE_MOD=alpha bake of beta ran for HORIZON_NATIVE_MOD=beta `plan` now refuses a step bin whose file name (ignoring case) is a workspace bin or another crate's step bin, with `E_POST_BUILD`. One crate's bin can still be run by several steps. Alternative (or as well): the launcher could build each mod's bins in its own folder, and take the game binary first. Then any bin name works, and older `mixins` revs are covered too. This PR just catches it at plan time, before minutes of compiling. ## Checks `cargo fmt --all --check` `cargo clippy --workspace --all-targets --locked -- -D warnings` `cargo test --workspace --locked` (90 passed, new test `post_build_bins_never_share_a_file_in_the_target_folder`) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:32:32 +07:00
Sign in to join this conversation.
No labels
pull-request
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-mixins#17
No description provided.