✨ feat(build): cargo-binstall support (#27)#173
Merged
Conversation
Add `[package.metadata.binstall]` so `cargo binstall gwm` pulls the
prebuilt archive from the GitHub Release instead of compiling git2 /
vendored-libgit2 from source. `pkg-url` mirrors the release workflows'
artefact naming (`gwm-v{version}-{target}.tar.gz`), `bin-dir` mirrors
the in-archive layout (`gwm-v{version}-{target}/{bin}`), and an
x86_64-pc-windows-msvc override points at the `.zip` artefact.
Tested: tests/binstall_metadata_tests.rs parses the manifest and pins
pkg-url / pkg-fmt / bin-dir / windows override against drift (adds
`toml` as a dev-dependency for structural assertions).
README install matrix gains a `cargo binstall gwm` row; the getting- started install doc gets a dedicated section explaining the no-compile path; CHANGELOG [Unreleased] notes the feature.
There was a problem hiding this comment.
Pull request overview
Adds cargo-binstall support so users can install prebuilt gwm binaries from GitHub Releases without compiling git2/libgit2 from source. The new [package.metadata.binstall] block in Cargo.toml is pinned to the existing release artefact naming (gwm-v{version}-{target}.tar.gz, .zip for Windows MSVC) and is guarded by a new structural test, with matching README/install-doc/changelog updates.
Changes:
- Add
[package.metadata.binstall](plus Windows.zipoverride) toCargo.tomland atomldev-dep. - Add
tests/binstall_metadata_tests.rspinningpkg-url,pkg-fmt,bin-dir, and the Windows override against artefact drift. - Document the new install channel in
README.md,docs/1.getting-started/1.install.md, andCHANGELOG.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Declares binstall metadata + Windows override; adds toml = "1.1" dev-dependency for the new test. |
| tests/binstall_metadata_tests.rs | Structurally asserts the binstall block matches the release workflow's artefact layout. |
| README.md | Adds a cargo binstall gwm row to the install matrix with a one-line explainer. |
| docs/1.getting-started/1.install.md | Dedicated section explaining cargo binstall gwm and the metadata contract. |
| CHANGELOG.md | New Added entry under [Unreleased] for #27, replacing the placeholder line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
[package.metadata.binstall]toCargo.tomlsocargo binstall gwmpulls the prebuilt binary from the GitHub Release instead of compilinggit2/vendored-libgit2 from source (closes #27).Why the extension is hardcoded (not
{ archive-format })The issue's sketch used
{ archive-format }, but our release assets are named.tar.gz(not.tgz). Hardcoding.tar.gz/.zipinpkg-urlguarantees the URL matches the real artefacts the workflow publishes;pkg-fmtstill tells binstall how to extract. The Windows artefact is a.zip, so it gets its ownpkg-urlin the override.Verified against the packaging steps in
pre-release.yml/release.yml:gwm-v{version}-{target}.{tar.gz|zip}✓gwm-v{version}-{target}/{gwm|gwm.exe}→bin-dir = gwm-v{version}-{target}/{bin}✓Tests (TDD)
tests/binstall_metadata_tests.rsparses the manifest and pinspkg-url,pkg-fmt,bin-dir, and the windows override against artefact-naming drift (addstomlas a dev-dependency for structural assertions, mirroring howhomebrew_formula_tests.rsguards the tap template).Docs
cargo binstall gwmrow.docs/1.getting-started/1.install.md→ dedicated section.[Unreleased].Local:
cargo testgreen,cargo fmt --check,cargo clippy --all-targets -- -D warningsclean.