aboutsummaryrefslogtreecommitdiff
path: root/src/garage/Cargo.toml
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-09-03 19:05:32 +0200
committerJakub Jirutka <jakub@jirutka.cz>2022-09-03 19:15:57 +0200
commit7511ba5530d56a446fefe2372409d9c2ceea17c5 (patch)
tree7d5c2027e4bde2258a2ce966f19a339bb1c15e15 /src/garage/Cargo.toml
parenta6e40b75eabf0d6a863a91ae17f7d0ae20582d9e (diff)
downloadgarage-7511ba5530d56a446fefe2372409d9c2ceea17c5.tar.gz
garage-7511ba5530d56a446fefe2372409d9c2ceea17c5.zip
Allow linking against system-provided libsqlite
Unfortunately, rusqlite uses the opposite logic for enabling/disabling bundled libraries to others (libsodium-sys, zstd-sys). Cargo features are very limited and doesn't allow to enable feature A in a dependency iff feature B is disabled. Note, lmdb-rkv-sys doesn't need any special treatment because it automatically links against system liblmdb if found via pkgconf. Linux distros should build garage with `--no-default-features --features system-libs` to disable bundled-libs and enable system-libs.
Diffstat (limited to 'src/garage/Cargo.toml')
-rw-r--r--src/garage/Cargo.toml8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml
index 6cc93fc0..e19aac50 100644
--- a/src/garage/Cargo.toml
+++ b/src/garage/Cargo.toml
@@ -74,6 +74,14 @@ base64 = "0.13"
[features]
+default = [ "bundled-libs" ]
kubernetes-discovery = [ "garage_rpc/kubernetes-discovery" ]
k2v = [ "garage_util/k2v", "garage_api/k2v" ]
+
+# NOTE: bundled-libs and system-libs should be treat as mutually exclusive;
+# exactly one of them should be enabled.
+
+# Use bundled libsqlite instead of linking against system-provided.
+bundled-libs = [ "garage_db/bundled-libs" ]
+# Link against system-provided libsodium and libzstd.
system-libs = [ "garage_block/system-libs", "garage_rpc/system-libs", "sodiumoxide/use-pkg-config" ]