From d2deee0b8bc22de5e8f1115f65a8a979b1beba18 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 7 May 2023 18:12:01 +0200 Subject: [PATCH 1/2] Declare garage crates using workspace.dependencies This will allow to really disable "sled" feature without declaring `default-features = false` in every Cargo.toml where garage_db and garage_model is used. See https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table --- Cargo.toml | 10 ++++++++++ src/api/Cargo.toml | 10 +++++----- src/block/Cargo.toml | 8 ++++---- src/garage/Cargo.toml | 16 ++++++++-------- src/k2v-client/Cargo.toml | 2 +- src/model/Cargo.toml | 10 +++++----- src/rpc/Cargo.toml | 2 +- src/table/Cargo.toml | 6 +++--- src/util/Cargo.toml | 2 +- src/web/Cargo.toml | 8 ++++---- 10 files changed, 42 insertions(+), 32 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a9fd4423..386804f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,16 @@ members = [ default-members = ["src/garage"] +[workspace.dependencies] +garage_api = { version = "0.8.2", path = "src/api" } +garage_block = { version = "0.8.2", path = "src/block" } +garage_db = { version = "0.8.2", path = "src/db" } +garage_model = { version = "0.8.2", path = "src/model" } +garage_rpc = { version = "0.8.2", path = "src/rpc" } +garage_table = { version = "0.8.2", path = "src/table" } +garage_util = { version = "0.8.2", path = "src/util" } +garage_web = { version = "0.8.2", path = "src/web" } + [profile.dev] lto = "off" diff --git a/src/api/Cargo.toml b/src/api/Cargo.toml index 9babec02..747f70ab 100644 --- a/src/api/Cargo.toml +++ b/src/api/Cargo.toml @@ -14,11 +14,11 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_model = { version = "0.8.2", path = "../model" } -garage_table = { version = "0.8.2", path = "../table" } -garage_block = { version = "0.8.2", path = "../block" } -garage_util = { version = "0.8.2", path = "../util" } -garage_rpc = { version = "0.8.2", path = "../rpc" } +garage_model.workspace = true +garage_table.workspace = true +garage_block.workspace = true +garage_util.workspace = true +garage_rpc.workspace = true async-trait = "0.1.7" base64 = "0.21" diff --git a/src/block/Cargo.toml b/src/block/Cargo.toml index c6985754..3bf1c40a 100644 --- a/src/block/Cargo.toml +++ b/src/block/Cargo.toml @@ -14,10 +14,10 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_db = { version = "0.8.2", path = "../db" } -garage_rpc = { version = "0.8.2", path = "../rpc" } -garage_util = { version = "0.8.2", path = "../util" } -garage_table = { version = "0.8.2", path = "../table" } +garage_db.workspace = true +garage_rpc.workspace = true +garage_util.workspace = true +garage_table.workspace = true opentelemetry = "0.17" diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml index c8f87560..9935ce10 100644 --- a/src/garage/Cargo.toml +++ b/src/garage/Cargo.toml @@ -21,14 +21,14 @@ path = "tests/lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_db = { version = "0.8.2", path = "../db" } -garage_api = { version = "0.8.2", path = "../api" } -garage_block = { version = "0.8.2", path = "../block" } -garage_model = { version = "0.8.2", path = "../model" } -garage_rpc = { version = "0.8.2", path = "../rpc" } -garage_table = { version = "0.8.2", path = "../table" } -garage_util = { version = "0.8.2", path = "../util" } -garage_web = { version = "0.8.2", path = "../web" } +garage_db.workspace = true +garage_api.workspace = true +garage_block.workspace = true +garage_model.workspace = true +garage_rpc.workspace = true +garage_table.workspace = true +garage_util.workspace = true +garage_web.workspace = true backtrace = "0.3" bytes = "1.0" diff --git a/src/k2v-client/Cargo.toml b/src/k2v-client/Cargo.toml index 52c16d89..27e85651 100644 --- a/src/k2v-client/Cargo.toml +++ b/src/k2v-client/Cargo.toml @@ -23,7 +23,7 @@ tokio = "1.24" # cli deps clap = { version = "4.1", optional = true, features = ["derive", "env"] } -garage_util = { version = "0.8.2", path = "../util", optional = true } +garage_util = { workspace = true, optional = true } [features] diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml index 2b525a42..6dc954d4 100644 --- a/src/model/Cargo.toml +++ b/src/model/Cargo.toml @@ -14,11 +14,11 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_db = { version = "0.8.2", default-features = false, path = "../db" } -garage_rpc = { version = "0.8.2", path = "../rpc" } -garage_table = { version = "0.8.2", path = "../table" } -garage_block = { version = "0.8.2", path = "../block" } -garage_util = { version = "0.8.2", path = "../util" } +garage_db.workspace = true +garage_rpc.workspace = true +garage_table.workspace = true +garage_block.workspace = true +garage_util.workspace = true async-trait = "0.1.7" arc-swap = "1.0" diff --git a/src/rpc/Cargo.toml b/src/rpc/Cargo.toml index dcf44f4a..f0fde7a7 100644 --- a/src/rpc/Cargo.toml +++ b/src/rpc/Cargo.toml @@ -14,7 +14,7 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_util = { version = "0.8.2", path = "../util" } +garage_util.workspace = true arc-swap = "1.0" bytes = "1.0" diff --git a/src/table/Cargo.toml b/src/table/Cargo.toml index c794c924..d0776945 100644 --- a/src/table/Cargo.toml +++ b/src/table/Cargo.toml @@ -14,9 +14,9 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_db = { version = "0.8.2", path = "../db" } -garage_rpc = { version = "0.8.2", path = "../rpc" } -garage_util = { version = "0.8.2", path = "../util" } +garage_db.workspace = true +garage_rpc.workspace = true +garage_util.workspace = true opentelemetry = "0.17" diff --git a/src/util/Cargo.toml b/src/util/Cargo.toml index 2e6231f6..08fb5553 100644 --- a/src/util/Cargo.toml +++ b/src/util/Cargo.toml @@ -14,7 +14,7 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_db = { version = "0.8.2", path = "../db" } +garage_db.workspace = true arc-swap = "1.0" async-trait = "0.1" diff --git a/src/web/Cargo.toml b/src/web/Cargo.toml index d0a23af4..423d3829 100644 --- a/src/web/Cargo.toml +++ b/src/web/Cargo.toml @@ -14,10 +14,10 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_api = { version = "0.8.2", path = "../api" } -garage_model = { version = "0.8.2", path = "../model" } -garage_util = { version = "0.8.2", path = "../util" } -garage_table = { version = "0.8.2", path = "../table" } +garage_api.workspace = true +garage_model.workspace = true +garage_util.workspace = true +garage_table.workspace = true err-derive = "0.3" tracing = "0.1" From 75759a163c2e6929d9fa7de542a72371a589efaa Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 7 May 2023 18:15:48 +0200 Subject: [PATCH 2/2] Allow to really disable sled feature --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 386804f6..05eb767a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ default-members = ["src/garage"] [workspace.dependencies] garage_api = { version = "0.8.2", path = "src/api" } garage_block = { version = "0.8.2", path = "src/block" } -garage_db = { version = "0.8.2", path = "src/db" } -garage_model = { version = "0.8.2", path = "src/model" } +garage_db = { version = "0.8.2", path = "src/db", default-features = false } +garage_model = { version = "0.8.2", path = "src/model", default-features = false } garage_rpc = { version = "0.8.2", path = "src/rpc" } garage_table = { version = "0.8.2", path = "src/table" } garage_util = { version = "0.8.2", path = "src/util" }