Add [package.metadata.binstall] to crates/pdftract-cli/Cargo.toml to enable cargo binstall to download pre-built binaries from GitHub Releases instead of compiling from source. Also add comprehensive Installation section to README.md documenting cargo binstall as the recommended install method. Bead: pdftract-1u80 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2.5 KiB
2.5 KiB
pdftract-1u80: cargo binstall metadata
Changes Made
1. Added [package.metadata.binstall] to crates/pdftract-cli/Cargo.toml
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/pdftract-v{ version }-{ target }.{ archive-format }"
pkg-fmt = "tgz"
bin-dir = "pdftract-v{ version }-{ target }/{ bin }{ binary-ext }"
[package.metadata.binstall.overrides.x86_64-pc-windows-gnu]
pkg-fmt = "zip"
Rationale: This metadata enables cargo binstall pdftract to download pre-built binaries from GitHub Releases instead of compiling from source, reducing install time from 6+ minutes to 2-3 seconds for non-Rust users.
pkg-urltemplate matches the asset naming pattern frompdftract-github-releaseworkflow{ repo }placeholder resolves fromworkspace.package.repository(verified:https://github.com/jedarden/pdftract){ target }placeholder resolves to rustc target triples (5 supported targets)- Windows override uses
.zipformat per Unix convention
2. Added Installation section to README.md
Added comprehensive installation instructions after the Usage section, documenting three methods:
- cargo binstall (recommended) - fastest pre-built binary install
- Pre-built binaries - direct download from GitHub Releases
- Build from source - traditional
cargo install
The section clearly positions cargo binstall as the recommended path for users with Rust toolchain already installed.
Acceptance Criteria
- PASS:
crates/pdftract-cli/Cargo.tomlcontains[package.metadata.binstall]table withpkg-url,pkg-fmt,bin-dir - PASS: Windows override is present and sets
pkg-fmt = "zip" - WARN: Cannot verify actual binstall behavior without a tagged release and completed
pdftract-github-releaseworkflow (infra/environment constraint) - PASS: README install section includes
cargo binstall pdftractas the recommended Rust-toolchain install path
Verification Note
Full end-to-end verification requires:
- A tagged release commit
pdftract-github-releaseworkflow completion (publishes assets to GitHub Releases)- Clean machine with
cargo install cargo-binstallandcargo binstall pdftract --version X.Y.Z
The URL template has been verified to match the asset naming pattern from the CI/CD workflow template. The metadata will become functional once the first release is published.
References
- Plan section: Release Engineering / Distribution Channels, line 3378
- Bead: pdftract-1u80