Allow linking against system-provided libraries (libsodium, libsqlite, libzstd) #370

Merged
lx merged 2 commits from jirutka/garage:system-libs into improve-deps 2022-09-05 10:18:09 +00:00
5 changed files with 17 additions and 1 deletions

1
Cargo.lock generated
View file

@ -4140,4 +4140,5 @@ checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f"
dependencies = [
"cc",
"libc",
"pkg-config",
]

View file

@ -36,3 +36,7 @@ serde_bytes = "0.11"
futures = "0.3"
futures-util = "0.3"
tokio = { version = "1.0", default-features = false, features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] }
[features]
system-libs = [ "zstd/pkg-config" ]

View file

@ -22,7 +22,7 @@ hexdump = "0.1"
tracing = "0.1.30"
heed = "0.11"
rusqlite = { version = "0.27", features = ["bundled"] }
rusqlite = "0.27"
sled = "0.34"
# cli deps
@ -33,4 +33,5 @@ pretty_env_logger = { version = "0.4", optional = true }
mktemp = "0.4"
[features]
bundled-libs = [ "rusqlite/bundled" ]
cli = ["clap", "pretty_env_logger"]

View file

@ -74,5 +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" ]

View file

@ -54,3 +54,4 @@ hyper = { version = "0.14", features = ["client", "http1", "runtime", "tcp"] }
[features]
kubernetes-discovery = [ "kube", "k8s-openapi", "openssl", "schemars" ]
system-libs = [ "sodiumoxide/use-pkg-config" ]