From d79e8293aac2f1b298e36ff6a1b98edc86342230 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Tue, 19 Sep 2023 22:30:34 -0700 Subject: [PATCH] cargo: stop `cargo install` from installing `fake-editor` & co. Among other things, this prevented `jj` from working with `cargo binstall`. The trick is taken from https://github.com/rust-lang/cargo/issues/2911#issuecomment-1483256987. We could now also remove `--bin jj` from the installation commands in `install-and-setup.md`, but I'm not sure we should. That argument makes it clear that the binary is `jj`, not `jj-cli`. Fixes #216. --- Cargo.lock | 1 + cli/Cargo.toml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 32c8ba341..b87fb9954 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1023,6 +1023,7 @@ dependencies = [ "indexmap 2.0.0", "insta", "itertools 0.11.0", + "jj-cli", "jj-lib", "libc", "maplit", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 76d76f01c..f40316c47 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -19,10 +19,12 @@ path = "src/main.rs" [[bin]] name = "fake-editor" path = "testing/fake-editor.rs" +required-features = ["test-fakes"] [[bin]] name = "fake-diff-editor" path = "testing/fake-diff-editor.rs" +required-features = ["test-fakes"] [build-dependencies] cargo_metadata = { workspace = true } @@ -72,10 +74,13 @@ assert_matches = { workspace = true } insta = { workspace = true } test-case = { workspace = true } testutils = { workspace = true } +# https://github.com/rust-lang/cargo/issues/2911#issuecomment-1483256987 +jj-cli = { path = ".", features = ["test-fakes"], default-features = false } [features] default = ["watchman"] bench = ["dep:criterion"] packaging = [] +test-fakes = [] vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"] watchman = ["jj-lib/watchman"]