Skip to content

Commit ac74804

Browse files
committed
workspace: use a global patch.crates-io to avoid duplicates
When pulling crates via git (to grab non-released yet fixes or otherwise), the `path = "../"` in each crate crates duplicates unless you pull the whole tree in your local `[patch.crates-io]`. This creates issues in downstream packaging (nix, ...) where a crate version can only appear once. Those are somewhat difficult to diagnose. Using a `[patch.crates-io]` in the workspace serves the same purpose but does not create the duplication in consumers' tree.
1 parent 03df416 commit ac74804

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ resolver = "2"
1010
[profile.dev]
1111
opt-level = 2
1212

13+
[patch.crates-io]
14+
curve25519-dalek-derive = { path = "./curve25519-dalek-derive" }
15+
curve25519-dalek = { path = "./curve25519-dalek" }
16+
x25519-dalek = { path = "./x25519-dalek" }

curve25519-dalek/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ group-bits = ["group", "ff/bits"]
8484
digest = ["dep:digest"]
8585

8686
[target.'cfg(all(not(curve25519_dalek_backend = "fiat"), not(curve25519_dalek_backend = "serial"), target_arch = "x86_64"))'.dependencies]
87-
curve25519-dalek-derive = { version = "0.1", path = "../curve25519-dalek-derive" }
87+
curve25519-dalek-derive = "0.1"
8888

8989
[lints.rust.unexpected_cfgs]
9090
level = "warn"

ed25519-dalek/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ rustdoc-args = [
2828
features = ["batch", "digest", "hazmat", "pem", "serde"]
2929

3030
[dependencies]
31-
curve25519-dalek = { version = "=5.0.0-pre.0", path = "../curve25519-dalek", default-features = false, features = [
31+
curve25519-dalek = { version = "=5.0.0-pre.0", default-features = false, features = [
3232
"digest",
3333
] }
3434
ed25519 = { version = "=3.0.0-pre.0", default-features = false }
@@ -43,11 +43,11 @@ serde = { version = "1.0", default-features = false, optional = true }
4343
zeroize = { version = "1.5", default-features = false, optional = true }
4444

4545
[dev-dependencies]
46-
curve25519-dalek = { version = "=5.0.0-pre.0", path = "../curve25519-dalek", default-features = false, features = [
46+
curve25519-dalek = { version = "=5.0.0-pre.0", default-features = false, features = [
4747
"digest",
4848
"rand_core",
4949
] }
50-
x25519-dalek = { version = "=3.0.0-pre.0", path = "../x25519-dalek", default-features = false, features = [
50+
x25519-dalek = { version = "=3.0.0-pre.0", default-features = false, features = [
5151
"static_secrets",
5252
] }
5353
blake2 = "0.11.0-rc.0"

x25519-dalek/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ rustdoc-args = [
4242
features = ["os_rng", "reusable_secrets", "serde", "static_secrets"]
4343

4444
[dependencies]
45-
curve25519-dalek = { version = "=5.0.0-pre.0", path = "../curve25519-dalek", default-features = false }
45+
curve25519-dalek = { version = "=5.0.0-pre.0", default-features = false }
4646
rand_core = { version = "0.9", default-features = false }
4747
serde = { version = "1", default-features = false, optional = true, features = [
4848
"derive",

0 commit comments

Comments
 (0)