[PR #126] [MERGED] xtask package: the release folder in Rust, replacing packaging/package.sh #2340

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

📋 Pull Request Information

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

Base: main ← Head: feat/package-rust


📝 Commits (1)

  • 842d11e xtask package: the release folder in Rust, replacing packaging/package.sh

📊 Changes

7 files changed (+334 additions, -32 deletions)

View changed files

📝 .github/workflows/release.yml (+2 -3)
📝 Cargo.lock (+4 -0)
📝 Cargo.toml (+1 -1)
📝 launcher/src/backend.rs (+1 -1)
➖ packaging/package.sh (+0 -27)
➕ xtask/Cargo.toml (+10 -0)
➕ xtask/src/main.rs (+316 -0)

📄 Description

What changed

packaging/package.sh BINARY OUTDIR (bash, used by release.yml for the Windows and Linux folders) is now Rust:

  • cargo run -p xtask -- package BINARY OUTDIR, a new dependency-free xtask workspace crate. Same behaviour: OUTDIR wiped and recreated; git archive HEAD tools mods/horizon/src/test/java crates/horizon-prepare research-lock.json LICENSE extracted (still git archive, so the content, export attributes and Windows line endings are git's; the tar is read in Rust, no tar needed, with ustar prefixes and pax long paths handled and paths kept inside OUTDIR); files and directories are created with the archive's modes within the process umask, as tar -x does for an ordinary user, so executables stay executable; the client binary, then horizon-ctl and horizon-prepare from beside it (.exe beside an .exe), copied with their modes within the umask, as cp does; the same error when a tool is missing (… is missing; build it too: cargo build --release -p horizon-client --bins -p horizon-prepare, exit 1); PLAY.txt copied.
  • release.yml calls it in both jobs (cargo +stable run --locked -p xtask -- package …); the Windows step no longer needs bash. Not run: release.yml/launcher.yml run only when Ludovic asks.
  • packaging/package.sh deleted (nothing else used it); the launcher comment that named it updated.

Why

Ludovic's rule: everything player-facing is Rust, and the release folder is what players get.

Identical-output proof (ThinkPad, Linux)

Fresh clone of this branch at 2588e2c; packaging/package.sh restored from origin/main beside it; same commit for both. Fake 200 kB binaries (horizon-client, horizon-ctl, horizon-prepare, mode 755) and .exe ones (one at 644, to check modes carry over the same way). For each case:

(umask $mask; cd repo && packaging/package.sh $bin out/old-$kind-$mask)
(umask $mask; cd repo && target/debug/xtask package $bin out/new-$kind-$mask)
diff -r out/old-… out/new-…
cmp <(cd out/old-… && find . -printf '%m %y %p\n' | sort) <(cd out/new-… && find . -printf '%m %y %p\n' | sort)
umask 022 bin:    IDENTICAL contents and modes (704 entries, 12 executables)
umask 022 binexe: IDENTICAL contents and modes (704 entries, 11 executables)
umask 002 bin:    IDENTICAL contents and modes (704 entries, 12 executables)
umask 002 binexe: IDENTICAL contents and modes (704 entries, 11 executables)
missing horizon-prepare: both exit 1 with the same message (package.sh: / xtask: prefix), same partial folder
rerun into a folder with a stray file: identical to package.sh's, stray file gone

The executables are the three programs and the 9 100755 scripts in tools/ (755 under umask 022, 775 under 002, as tar gives them).

Tests

  • cargo test -p xtask (Mac mini and ThinkPad): an archive with a pax global header, a directory, a plain and an executable file and a pax long path extracts with its paths and modes; .., absolute paths and unsupported entries (symlinks) are refused.
  • cargo clippy --locked -p xtask --all-targets -D warnings, cargo fmt --check (Mac mini). Cargo.lock gains only the xtask entry.

🤖 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/126 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/package-rust` --- ### 📝 Commits (1) - [`842d11e`](https://github.com/horizon-rust/horizon/commit/842d11efc4cd87d0c80472b467fe8555779f9054) xtask package: the release folder in Rust, replacing packaging/package.sh ### 📊 Changes **7 files changed** (+334 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yml` (+2 -3) 📝 `Cargo.lock` (+4 -0) 📝 `Cargo.toml` (+1 -1) 📝 `launcher/src/backend.rs` (+1 -1) ➖ `packaging/package.sh` (+0 -27) ➕ `xtask/Cargo.toml` (+10 -0) ➕ `xtask/src/main.rs` (+316 -0) </details> ### 📄 Description ## What changed `packaging/package.sh BINARY OUTDIR` (bash, used by release.yml for the Windows and Linux folders) is now Rust: - **`cargo run -p xtask -- package BINARY OUTDIR`**, a new dependency-free `xtask` workspace crate. Same behaviour: OUTDIR wiped and recreated; `git archive HEAD tools mods/horizon/src/test/java crates/horizon-prepare research-lock.json LICENSE` extracted (still `git archive`, so the content, export attributes and Windows line endings are git's; the tar is read in Rust, no `tar` needed, with ustar prefixes and pax long paths handled and paths kept inside OUTDIR); files and directories are created with the archive's modes within the process umask, as `tar -x` does for an ordinary user, so executables stay executable; the client binary, then horizon-ctl and horizon-prepare from beside it (`.exe` beside an `.exe`), copied with their modes within the umask, as `cp` does; the same error when a tool is missing (`… is missing; build it too: cargo build --release -p horizon-client --bins -p horizon-prepare`, exit 1); PLAY.txt copied. - **release.yml** calls it in both jobs (`cargo +stable run --locked -p xtask -- package …`); the Windows step no longer needs bash. **Not run**: release.yml/launcher.yml run only when Ludovic asks. - `packaging/package.sh` deleted (nothing else used it); the launcher comment that named it updated. ## Why Ludovic's rule: everything player-facing is Rust, and the release folder is what players get. ## Identical-output proof (ThinkPad, Linux) Fresh clone of this branch at 2588e2c; `packaging/package.sh` restored from origin/main beside it; same commit for both. Fake 200 kB binaries (`horizon-client`, `horizon-ctl`, `horizon-prepare`, mode 755) and `.exe` ones (one at 644, to check modes carry over the same way). For each case: ```sh (umask $mask; cd repo && packaging/package.sh $bin out/old-$kind-$mask) (umask $mask; cd repo && target/debug/xtask package $bin out/new-$kind-$mask) diff -r out/old-… out/new-… cmp <(cd out/old-… && find . -printf '%m %y %p\n' | sort) <(cd out/new-… && find . -printf '%m %y %p\n' | sort) ``` ``` umask 022 bin: IDENTICAL contents and modes (704 entries, 12 executables) umask 022 binexe: IDENTICAL contents and modes (704 entries, 11 executables) umask 002 bin: IDENTICAL contents and modes (704 entries, 12 executables) umask 002 binexe: IDENTICAL contents and modes (704 entries, 11 executables) missing horizon-prepare: both exit 1 with the same message (package.sh: / xtask: prefix), same partial folder rerun into a folder with a stray file: identical to package.sh's, stray file gone ``` The executables are the three programs and the 9 `100755` scripts in tools/ (755 under umask 022, 775 under 002, as tar gives them). ## Tests - `cargo test -p xtask` (Mac mini and ThinkPad): an archive with a pax global header, a directory, a plain and an executable file and a pax long path extracts with its paths and modes; `..`, absolute paths and unsupported entries (symlinks) are refused. - `cargo clippy --locked -p xtask --all-targets -D warnings`, `cargo fmt --check` (Mac mini). Cargo.lock gains only the `xtask` entry. 🤖 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:55:06 +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#2340
No description provided.