From ae51e1f72d31de65ef606bb8175c314e7b9a536f Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 26 Apr 2022 17:42:03 -0700 Subject: [PATCH] Avoid unconditional dependency on libssh2-sys when using zlib-ng-compat Use a weak dependency feature to enable zlib-ng-compat on libssh2-sys without forcibly enabling libssh2-sys. --- libgit2-sys/Cargo.toml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml index 8e99666407..90af3a9aa9 100644 --- a/libgit2-sys/Cargo.toml +++ b/libgit2-sys/Cargo.toml @@ -38,9 +38,4 @@ https = ["openssl-sys"] ssh_key_from_memory = [] vendored = [] vendored-openssl = ["openssl-sys/vendored"] -# Cargo does not support requiring features on an optional dependency without -# requiring the dependency. Rather than introduce additional complexity, we -# just require libssh2 when using zlib-ng-compat. This will require building -# libssh2, but it will not add code to the final binary without the "ssh" -# feature enabled. -zlib-ng-compat = ["libz-sys/zlib-ng", "libssh2-sys/zlib-ng-compat"] +zlib-ng-compat = ["libz-sys/zlib-ng", "libssh2-sys?/zlib-ng-compat"]