Skip to content

fix: use literal binary name in cargo-binstall pkg-url - #1963

Open
gyscos wants to merge 1 commit into
rustic-rs:mainfrom
gyscos:fix-binstall-pkg-url
Open

gyscos wants to merge 1 commit into
rustic-rs:mainfrom
gyscos:fix-binstall-pkg-url

Conversation

@gyscos

@gyscos gyscos commented Oct 19, 2026

Copy link
Copy Markdown

cargo binstall rustic-rs currently can't find any of the prebuilt release binaries, on any target, and falls back to compiling from source.

The pkg-url template uses { bin }, but cargo-binstall doesn't provide bin when rendering pkg-url. It's only set when rendering bin-dir, once per binary (see the Context in binstalk-fetchers/src/gh_crate_meta.rs). Every candidate URL fails with:

WARN Failed to render url for Context { name: "rustic", target: "x86_64-unknown-linux-gnu", version: "0.11.4", ... }: Failed to render template: missing key `bin`

{ name } won't work either, because it would expand to rustic-rs while the assets are named rustic-v…. So this PR writes the asset prefix out literally:

-pkg-url = "{ repo }/releases/download/v{ version }/{ bin }-v{ version }-{ target }{ archive-suffix }"
+pkg-url = "{ repo }/releases/download/v{ version }/rustic-v{ version }-{ target }{ archive-suffix }"

Testing

I ran cargo binstall --dry-run --disable-strategies compile,quick-install --manifest-path Cargo.toml --targets <target> rustic-rs with cargo-binstall 1.x:

  • Before: missing key 'bin', then Fallback to cargo-install is disabled
  • After: x86_64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf and x86_64-pc-windows-msvc all resolve to the v0.11.4 release asset, with Verified signature for package 'rustic-rs': Signed by rustic Maintainers

I also installed the armv7 binary on a real armv7 machine using the same template passed through --pkg-url, and rustic --version works.

🤖 Generated with Claude Code

https://claude.ai/code/session_016hAmeogg6mbXfzreR2EJUM

cargo-binstall does not provide the `bin` key when rendering `pkg-url`
(it is only available in `bin-dir`), so the template failed to render
with "missing key `bin`" and binstall fell back to building from source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016hAmeogg6mbXfzreR2EJUM
Copilot AI balanced review requested due to automatic review settings October 19, 2026 18:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants