feat(dist): support packaging pre-built binaries via --bin-dir#117
Conversation
Downstream packagers and superprojects sometimes build the four release binaries themselves (different workspace, different toolchain, or a cross-build farm) and only need dist.sh for staging, completions, and tarball assembly. A new --bin-dir <dir> option installs hypercolor-daemon, hypercolor, hypercolor-app, and hypercolor-tray from that directory and skips the cargo release build entirely. The directory is validated up front, before any expensive work: it must be an absolute path (the script cds to the repo root, so relative paths would silently resolve against the wrong tree), it must exist, and all four binaries must be present and executable, with the missing ones named in the failure message. Everything downstream is unchanged: RELEASE_DIR simply points at the supplied directory, completions are still generated by running the installed CLI, and web assets, --ci, and manifest.json behave exactly as before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe dist.sh script is extended with a new --bin-dir option that lets packaging use pre-built release binaries instead of building them via Cargo. It adds argument parsing, help text, validation of the binary directory and required executables, and conditional logic to skip the build step. Changes--bin-dir Option for Pre-built Binaries
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Adds a
--bin-dir <dir>option toscripts/dist.shthat packages pre-built release binaries instead of building them in-script. When set, dist.sh skips its cargo build block entirely and installshypercolor-daemon,hypercolor,hypercolor-app, andhypercolor-trayfrom the supplied directory. Everything else — web assets, completions generation, manifest, tarball layout — behaves exactly as before.Why
Downstream packagers (superproject builds, distro packaging, CI pipelines that build binaries in separate cached jobs) need to assemble a distribution from binaries they built themselves. Today dist.sh always rebuilds, which forces a second full compile of the daemon just to get the staging/tarball logic. This seam separates "build the binaries" from "assemble the bundle" without changing the default path at all.
How it works
--bin-diris validated immediately after argument parsing: it must be an absolute path (dist.sh cds to the repo root at startup, so relative paths would silently resolve against the wrong directory), the directory must exist, and all four binaries must be present and executable. Missing binaries are listed by name in the error.RELEASE_DIRpoints at the supplied directory and the cargo build step is skipped — including thecargo-cache-build.shwrapper, so no toolchain state is touched.bin/, so a supplied CLI needs to answercompletions bash|zsh|fish(both real binaries do).--helpdocument the flag.Validation
bash -nand shellcheck clean (no new findings vs main)../scripts/dist.sh --ci --skip-docs --web-assets <dir> --bin-dir <dir> --version 9.9.9 --target linux-amd64produces a tarball that passesverify-release-artifact.shend to end, including the livebin/hypercolor --versionprobe.Heads-up found while testing
dist.shon current main is broken independently of this change:packaging/icons/hypercolor.svgwas removed in e1bd5c1 (new trinity logo TBD) but dist.sh stillcps it andverify-release-artifact.shhard-requires it in the bundle. Any dist run dies at icon staging until an SVG lands there. The stub run above had to supply a placeholder SVG to complete.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes