From f973bcb90ce2354c5dbac2d8d812907c7280568f Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 17 Jun 2025 20:11:44 -0700 Subject: [PATCH] Set `default-features = false` on `git2` to reduce dependencies and binary size With current git2, this reduces lstr from 144 dependencies to 137, and from 4.3M to 3.6M. With https://github.com/rust-lang/git2-rs/pull/1168 merged into upstream git2-rs, it further reduces lstr to 106 dependencies (though with negligible additional improvement to binary size as the additional dependencies were compiled out). --- Cargo.lock | 44 ++++---------------------------------------- Cargo.toml | 4 ++-- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19313c0..b7508a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -352,16 +352,14 @@ dependencies = [ [[package]] name = "git2" -version = "0.19.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" +checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110" dependencies = [ "bitflags", "libc", "libgit2-sys", "log", - "openssl-probe", - "openssl-sys", "url", ] @@ -563,32 +561,16 @@ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libgit2-sys" -version = "0.17.0+1.8.1" +version = "0.18.1+1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" +checksum = "e1dcb20f84ffcdd825c7a311ae347cce604a6f084a767dec4a4929829645290e" dependencies = [ "cc", "libc", - "libssh2-sys", "libz-sys", - "openssl-sys", "pkg-config", ] -[[package]] -name = "libssh2-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - [[package]] name = "libz-sys" version = "1.1.22" @@ -700,24 +682,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.4" diff --git a/Cargo.toml b/Cargo.toml index 7dbf765..7696131 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ anyhow = "1.0" colored = "2.1.0" clap = { version = "4.5.7", features = ["derive"] } crossterm = "0.27.0" -git2 = "0.19.0" +git2 = { version = "0.20.2", default-features = false } ignore = "0.4.22" ratatui = "0.27.0" rayon = "1.10.0" @@ -25,4 +25,4 @@ rayon = "1.10.0" [dev-dependencies] assert_cmd = "2.0" predicates = "3.1" -tempfile = "3.10" \ No newline at end of file +tempfile = "3.10"