Repository: zellij-org/zellij (language: rust)

Issue:
zellij-utils: isahc dependency forces vendored libcurl dependency by default
Found in zellij `0.41`

`isahc`'s default features include `static-curl`: https://github.com/sagebind/isahc/blob/5c533f1ef4d6bdf1fd291b5103c22110f41d0bf0/Cargo.toml#L22

This in turn makes `curl-sys` hardcode the static vendored `libcurl` build, so distro maintainers will be forced to patch this away if they want to use system-provided `libcurl`. Unfortunately, `curl-sys` crate doesn't provide any convenient env var override, like e.g. `git2` with its `LIBGIT2_NO_VENDOR`.

My proposal to improve this in a backwards-compatible way is to add some feature switch to zellij that controls this behavior (sth like `system-curl` would be best, but cargo wants features to be strictly additive).


Discussion / hints:
Hey @tranzystorekk - thanks for pointing this out and for your patience with my reply! Would you like to whip-up a PR that would add an opt-in compile-time feature for this change? I think it will help other distro maintainers too.

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 761da7fd06..ea1b3cbc17 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -80,8 +80,10 @@ pkg-fmt = "tgz"
 
 [features]
 # See remarks in zellij_utils/Cargo.toml
-default = ["zellij-utils/plugins_from_target"]
+default = ["plugins_from_target", "vendored_curl"]
+plugins_from_target = ["zellij-utils/plugins_from_target"]
 disable_automatic_asset_installation = ["zellij-utils/disable_automatic_asset_installation"]
+vendored_curl = ["zellij-utils/vendored_curl"]
 unstable = ["zellij-client/unstable", "zellij-utils/unstable"]
 singlepass = ["zellij-server/singlepass"]
 
diff --git a/zellij-utils/Cargo.toml b/zellij-utils/Cargo.toml
index 4fd7d7da27..1f2c535eae 100644
--- a/zellij-utils/Cargo.toml
+++ b/zellij-utils/Cargo.toml
@@ -56,9 +56,9 @@ async-std = { version = "1.3.0", features = ["unstable", "attributes"] }
 notify-debouncer-full = "0.1.0"
 humantime = "2.1.0"
 futures = "0.3.28"
-openssl-sys = { version = "0.9.93", features = ["vendored"] }
-isahc = "1.7.2"
-curl-sys = { version = "0.4", features = ["force-system-lib-on-osx"] }
+openssl-sys = { version = "0.9.93", features = ["vendored"], optional = true }
+isahc = { version = "1.7.2", default-features = false, features = ["http2", "text-decoding"] }
+curl-sys = { version = "0.4", features = ["force-system-lib-on-osx"], optional = true }
 
 [dev-dependencies]
 insta = { version = "1.6.0", features = ["backtrace"] }
@@ -75,3 +75,4 @@ prost-build = "0.11.9"
 disable_automatic_asset_installation = []
 unstable = []
 plugins_from_target = []
+vendored_curl = ["isahc/static-curl", "dep:openssl-sys", "dep:curl-sys"]


Test patch: