Skip to content

Commit 592abbe

Browse files
committed
Add feature flags to control dependency vendoring
1 parent 2956212 commit 592abbe

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ clap_complete = "4.4.4"
3434
constcat = "0.4.0"
3535
curl = "0.4.44"
3636
fmutex = "0.1.0"
37-
git2 = { version = "0.18.1", features = ["vendored-libgit2"] }
37+
git2 = "0.18.1"
3838
globwalk = "0.8.1"
3939
home = "0.5.5"
4040
indexmap = { version = "2.1.0", features = ["rayon", "serde"] }
@@ -68,3 +68,26 @@ anyhow = "1.0.75"
6868
goldie = "0.4.3"
6969
pretty_assertions = "1.4.0"
7070
tempfile = "3.8.1"
71+
72+
[features]
73+
# By default vendor libgit2 since we rely on some modern features.
74+
default = ["vendored-libgit2"]
75+
76+
# Vendor and statically link curl, libgit2, and openssl
77+
vendored = ["vendored-curl", "vendored-libgit2", "vendored-openssl"]
78+
79+
# Vendor and statically link curl
80+
vendored-curl = ["curl/static-curl"]
81+
82+
# Vendor and statically link libgit2
83+
#
84+
# Disabling this will not force the usage of the system libgit2, you can do that
85+
# using LIBGIT2_NO_VENDOR=1 which will error at compile time if the system
86+
# libgit2 is not a high enough version.
87+
vendored-libgit2 = ["git2/vendored-libgit2"]
88+
89+
# Vendor and statically link openssl
90+
#
91+
# Disabling this will not force the usage of the system OpenSSL you can do that
92+
# using OPENSSL_NO_VENDOR=1
93+
vendored-openssl = ["git2/vendored-openssl", "curl/static-ssl"]

0 commit comments

Comments
 (0)