From 8ba29ca2276b6f5e2970e5aec47db9d3646bab70 Mon Sep 17 00:00:00 2001 From: Waleed Khan Date: Sat, 7 Dec 2024 12:22:47 -0800 Subject: [PATCH 1/2] build: switch back to `gix/max-performance-safe` feature by default Using `gix/max-performance` requires `cmake` as a build-time dependency, which could be a significant barrier for contributors (including existing ones, like me, who already work on jj but didn't have `cmake` installed thus far). This commit switches back to using `gix/max-performance-safe`, which doesn't have the `cmake` dependency, and adds `gix/max-performance` behind the `gix-max-performance` feature for `jj-lib`. It also adds `gix-max-performance` to the `packaging` feature group, since I'm assuming that packagers will want maximum performance, and are more likely to have `cmake` at hand. Tested with ``` $ cargo build --workspace $ cargo build --workspace --features packaging ``` (and the `--features packaging` build failed until I installed `cmake`) --- Cargo.toml | 2 +- cli/Cargo.toml | 3 ++- lib/Cargo.toml | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3f6b77768a..adc85b323e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ gix = { version = "0.68.0", default-features = false, features = [ "attributes", "blob-diff", "index", - "max-performance", + "max-performance-safe", ] } glob = "0.3.1" hashbrown = { version = "0.15.2", default-features = false, features = ["inline-more"] } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a2d3400a91..2548abc2e3 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -111,7 +111,8 @@ jj-cli = { path = ".", features = ["test-fakes"], default-features = false } [features] default = ["watchman"] bench = ["dep:criterion"] -packaging = [] +gix-max-performance = ["jj-lib/gix-max-performance"] +packaging = ["gix-max-performance"] test-fakes = ["jj-lib/testing"] vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"] watchman = ["jj-lib/watchman"] diff --git a/lib/Cargo.toml b/lib/Cargo.toml index aca359958a..3316876c36 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -98,6 +98,12 @@ tokio = { workspace = true, features = ["full"] } [features] default = ["git"] git = ["dep:git2", "dep:gix"] +gix-max-performance = [ + # Requires `cmake` as a build dependency. + # Note that this feature is different from `gix/max-performance-safe`. + # See: https://docs.rs/gix/latest/gix/#performance + "gix/max-performance", +] vendored-openssl = ["git2/vendored-openssl"] watchman = ["dep:tokio", "dep:watchman_client"] testing = ["git"] From defa823e0f4fe38531765e3b71b6bc38f24c8d3d Mon Sep 17 00:00:00 2001 From: Waleed Khan Date: Sun, 8 Dec 2024 12:53:04 -0800 Subject: [PATCH 2/2] docs: revert "docs: update installation docs to say that `cmake` is needed" This reverts commit b7ba3fc0be734cfa39bb7d6cfc50ed67eee15dce. As per discussion in https://github.com/martinvonz/jj/pull/5047, I would like to make it so that the default build configuration doesn't need `cmake`. --- docs/install-and-setup.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/docs/install-and-setup.md b/docs/install-and-setup.md index dd1524a933..b6df3f0a05 100644 --- a/docs/install-and-setup.md +++ b/docs/install-and-setup.md @@ -30,12 +30,12 @@ be compiled from the same source code. #### From Source -First make sure that you have a Rust version >= 1.76 and that the `cmake`, -`libssl-dev`, `openssl`, `pkg-config`, and `build-essential` packages are -installed by running something like this: +First make sure that you have a Rust version >= 1.76 and that the `libssl-dev`, +`openssl`, `pkg-config`, and `build-essential` packages are installed by running +something like this: ```shell -sudo apt-get install cmake libssl-dev openssl pkg-config build-essential +sudo apt-get install libssl-dev openssl pkg-config build-essential ``` Now run either: @@ -139,7 +139,6 @@ these: ```shell xcode-select --install -brew install cmake brew install openssl brew install pkg-config export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl@3/lib/pkgconfig" @@ -181,14 +180,7 @@ sudo port install jujutsu ### Windows -First make sure that you have a Rust version >= 1.76. You will also need -`cmake`, which you can install by running this: - -```shell -winget install cmake -``` - -Now run either: +First make sure that you have a Rust version >= 1.76. Now run either: ```shell # To install the *prerelease* version from the main branch