From 4aead4b4645030e9bfad9b60cc87e993fe48b736 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 15 Oct 2024 17:01:58 +0000 Subject: [PATCH] workspace: limit duplicate dependencies (#871) This makes use of a global `patch.crates-io` instead of local `path =` attributes in the dependencies. When pulling dependencies through git to try unreleased crates, the dependency in `path` will get duplicated. Which makes for twice the definition of types incompatible with each other. --- Cargo.toml | 12 ++++++++++++ dsa/Cargo.toml | 2 +- ecdsa/Cargo.toml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d9709ecd..9a5ade09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,3 +13,15 @@ members = [ [profile.dev] opt-level = 2 + +[patch.crates-io] +# A global patch crates-io block is used to avoid duplicate dependencies +# when pulling a member crate through git +dsa = { path = "./dsa" } +ecdsa = { path = "./ecdsa" } +ed448-signature = { path = "./ed448" } +ed25519 = { path = "./ed25519" } +lms-signature = { path = "./lms" } +ml-dsa = { path = "./ml-dsa" } +rfc6979 = { path = "./rfc6979" } +slh-dsa = { path = "./slh-dsa" } diff --git a/dsa/Cargo.toml b/dsa/Cargo.toml index 19f50d38..61c12e86 100644 --- a/dsa/Cargo.toml +++ b/dsa/Cargo.toml @@ -20,7 +20,7 @@ digest = "=0.11.0-pre.9" num-bigint = { package = "num-bigint-dig", version = "0.8", default-features = false, features = ["prime", "rand", "zeroize"] } num-traits = { version = "0.2", default-features = false } pkcs8 = { version = "=0.11.0-rc.1", default-features = false, features = ["alloc"] } -rfc6979 = { version = "=0.5.0-pre.4", path = "../rfc6979" } +rfc6979 = { version = "=0.5.0-pre.4" } sha2 = { version = "=0.11.0-pre.4", default-features = false } signature = { version = "=2.3.0-pre.4", default-features = false, features = ["alloc", "digest", "rand_core"] } zeroize = { version = "1", default-features = false } diff --git a/ecdsa/Cargo.toml b/ecdsa/Cargo.toml index 4162793f..b6fd3bbc 100644 --- a/ecdsa/Cargo.toml +++ b/ecdsa/Cargo.toml @@ -23,7 +23,7 @@ signature = { version = "=2.3.0-pre.4", default-features = false, features = ["r # optional dependencies der = { version = "0.8.0-rc.1", optional = true } digest = { version = "=0.11.0-pre.9", optional = true, default-features = false, features = ["oid"] } -rfc6979 = { version = "=0.5.0-pre.4", optional = true, path = "../rfc6979" } +rfc6979 = { version = "=0.5.0-pre.4", optional = true } serdect = { version = "0.3.0-rc.0", optional = true, default-features = false, features = ["alloc"] } sha2 = { version = "=0.11.0-pre.4", optional = true, default-features = false, features = ["oid"] } spki = { version = "0.8.0-rc.0", optional = true, default-features = false }