just icon indicating copy to clipboard operation
just copied to clipboard

Add install instructions for how to install just with cargo-binstall

Open tomkarw opened this issue 3 years ago • 4 comments

Casey: This will be supported by cargo-binstall soon, and once it is, we should add instructions for how to install just with cargo-binstall in the readme.


Describe your feature request

cargo-binstall is a way to fetch precompiled binaries without the need to build from source. It is meant to speed up installing new cargo tools.

By default, cargo-binstall will look for GitHub releases artifacts, and just has these. Unfortunately, cargo-generate requires the version component to conform to v.* pattern, and just doesn't include the v.

The easiest way to achieve the desired result would be to override this default by adding this to Cargo.toml:

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/{ version }/{ name }-{ target }-v{ version }.{ archive-format }"

(notice the lack of v in the version component)

If support for cargo-binstall is deemed preferable, I'd be happy to land such PR and test that this solution works.

Alternative

An alternative would be to change the naming conventions for the releases, but I think the above solution is more surgical and less interfering.

Disclaimer

This is a copy-paste of an issue I submitted to ripgrep crate, as it suffers from the same issue.

tomkarw avatar Sep 01 '22 22:09 tomkarw

Very cool! Would it be possible for cargo-binstall to look for releases both with and without a v prefix? just used to use the v prefix, but I found that it was easier to type/etc to just use the version number. For example, without the v prefix, the tag for a version is the same as the version field in Cargo.toml, and you don't have to add and remove a v to convert between the two.

casey avatar Sep 02 '22 01:09 casey

Yeah, I thought the same thing and dropped a ticket in cargo-binstall afterwards, and they added it straight away: https://github.com/cargo-bins/cargo-binstall/issues/328!

You can close this ticket, or we can wait till this improvement in cargo-binstall gets released and mention it in the https://github.com/casey/just#packages section.

tomkarw avatar Sep 02 '22 06:09 tomkarw

Awesome! Let's keep this issue open as a reminder to add something to the readme once support for v-less versions lands in cargo-binstall.

casey avatar Sep 02 '22 06:09 casey

Looks like cargo binstall just works!

rajsite avatar Nov 19 '25 23:11 rajsite