From a258e58f398fdf528461cbc2b3711c274d318d3d Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Tue, 19 Sep 2023 22:54:42 -0700 Subject: [PATCH] cargo: make `jj` installable with `cargo binstall` https://github.com/cargo-bins/cargo-binstall Note that `jj` will only become installable once the next release is published to crates.io. For this reason, I am planning to wait until then before documenting the fact that `jj` can be installed this way. At that point, `cargo binstall jj-cli` should be sufficient. Before then, it's possible to test that this will work by doing ``` cargo binstall jj-cli --force --strategies crate-meta-data --log-level debug --dry-run --manifest-path cli/Cargo.toml ``` Without --dry-run, this should install the 0.9 release if run on `cli/Cargo.toml` form this commit. --- CHANGELOG.md | 2 ++ cli/Cargo.toml | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d2b41c3e9..1a7a095c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### New features +* `jj`'s stable release can now be installed with [`cargo binstall jj-cli`](https://github.com/cargo-bins/cargo-binstall). + * The `ancestors()` revset function now takes an optional `depth` argument to limit the depth of the ancestor set. For example, use `jj log -r 'ancestors(@, 5)` to view the last 5 commits. diff --git a/cli/Cargo.toml b/cli/Cargo.toml index f40316c47c..261fef02dd 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -84,3 +84,8 @@ packaging = [] test-fakes = [] vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"] watchman = ["jj-lib/watchman"] + +[package.metadata.binstall] +# The archive name is jj, not jj-cli. Also, `cargo binstall` gets +# confused by the `v` before versions in archive name. +pkg-url="{ repo }/releases/download/v{ version }/jj-v{ version }-{ target }.{ archive-format }"