Skip to content

Commit 31d9e8f

Browse files
chore(deps/rand): update to rand v0.9.0 (#3574)
supersedes #3569. this branch updates [`rand`](https://github.com/rust-random/rand) from 0.8.5 to 0.9.0. - [release notes](https://github.com/rust-random/rand/releases) - [changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [commits](rust-random/rand@0.8.5...0.9.0) note the changes to `rand::distr::weighted::Error`'s variants. see rust-random/rand#1382, and rust-random/rand#1470. in particular, this change: https://github.com/rust-random/rand/pull/1382/files#diff-b0eb1b0ef894742b65e07f23af6cbeffae64ec8311adb6ea606603e978023e0cL116-R113 most other changes in this branch relate to the renaming of `thread_rng()` to `rng()`, and `gen()` to `random()`. --- * build(deps): bump rand from 0.8.5 to 0.9.0 Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.9.0. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](rust-random/rand@0.8.5...0.9.0) --- updated-dependencies: - dependency-name: rand dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore(exp-backoff): address `rand` breaking changes Signed-off-by: katelyn martin <[email protected]> * chore(pool/p2c): address `rand` breaking changes Signed-off-by: katelyn martin <[email protected]> * chore(distribute): address `rand` breaking changes see rust-random/rand#1382. in particular, this part of the change: https://github.com/rust-random/rand/pull/1382/files#diff-b0eb1b0ef894742b65e07f23af6cbeffae64ec8311adb6ea606603e978023e0cL116-R113 see also rust-random/rand#1470. Signed-off-by: katelyn martin <[email protected]> * chore(http/route): address `rand` breaking changes Signed-off-by: katelyn martin <[email protected]> * chore(exp-backoff): address `rand` breaking changes Signed-off-by: katelyn martin <[email protected]> * chore(deny.toml): skip previous `rand` dependencies this addresses some ci errors related to duplicate dependencies: ``` error[duplicate]: found 2 duplicate entries for crate 'getrandom' ┌─ /github/workspace/Cargo.lock:75:1 │ 75 │ ╭ getrandom 0.2.15 registry+https://github.com/rust-lang/crates.io-index 76 │ │ getrandom 0.3.1 registry+https://github.com/rust-lang/crates.io-index │ ╰─────────────────────────────────────────────────────────────────────┘ lock entries │ ``` Signed-off-by: katelyn martin <[email protected]> * review(distribute): add `use` statement Signed-off-by: katelyn martin <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: katelyn martin <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 2062f0c commit 31d9e8f

File tree

17 files changed

+142
-59
lines changed

17 files changed

+142
-59
lines changed

Cargo.lock

Lines changed: 109 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
3636
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
3737
dependencies = [
3838
"cfg-if",
39-
"getrandom",
39+
"getrandom 0.2.15",
4040
"once_cell",
4141
"version_check",
42-
"zerocopy",
42+
"zerocopy 0.7.35",
4343
]
4444

4545
[[package]]
@@ -753,7 +753,19 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
753753
dependencies = [
754754
"cfg-if",
755755
"libc",
756-
"wasi",
756+
"wasi 0.11.0+wasi-snapshot-preview1",
757+
]
758+
759+
[[package]]
760+
name = "getrandom"
761+
version = "0.3.1"
762+
source = "registry+https://github.com/rust-lang/crates.io-index"
763+
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
764+
dependencies = [
765+
"cfg-if",
766+
"libc",
767+
"wasi 0.13.3+wasi-0.2.2",
768+
"windows-targets 0.52.0",
757769
]
758770

759771
[[package]]
@@ -860,7 +872,7 @@ dependencies = [
860872
"idna",
861873
"ipnet",
862874
"once_cell",
863-
"rand",
875+
"rand 0.8.5",
864876
"thiserror 1.0.69",
865877
"tinyvec",
866878
"tokio",
@@ -881,7 +893,7 @@ dependencies = [
881893
"lru-cache",
882894
"once_cell",
883895
"parking_lot",
884-
"rand",
896+
"rand 0.8.5",
885897
"resolv-conf",
886898
"smallvec",
887899
"thiserror 1.0.69",
@@ -1261,7 +1273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
12611273
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
12621274
dependencies = [
12631275
"cfg-if",
1264-
"windows-targets 0.48.5",
1276+
"windows-targets 0.52.0",
12651277
]
12661278

12671279
[[package]]
@@ -1584,7 +1596,7 @@ dependencies = [
15841596
"ahash",
15851597
"linkerd-stack",
15861598
"parking_lot",
1587-
"rand",
1599+
"rand 0.9.0",
15881600
"tokio",
15891601
"tokio-test",
15901602
"tower-test",
@@ -1653,7 +1665,7 @@ dependencies = [
16531665
"futures",
16541666
"pin-project",
16551667
"quickcheck",
1656-
"rand",
1668+
"rand 0.9.0",
16571669
"thiserror 2.0.11",
16581670
"tokio",
16591671
]
@@ -1820,7 +1832,7 @@ dependencies = [
18201832
"http",
18211833
"linkerd2-proxy-api",
18221834
"maplit",
1823-
"rand",
1835+
"rand 0.9.0",
18241836
"regex",
18251837
"thiserror 2.0.11",
18261838
"tracing",
@@ -2088,7 +2100,7 @@ dependencies = [
20882100
"parking_lot",
20892101
"prometheus-client",
20902102
"quickcheck",
2091-
"rand",
2103+
"rand 0.9.0",
20922104
"tokio",
20932105
"tokio-test",
20942106
"tower",
@@ -2131,7 +2143,7 @@ dependencies = [
21312143
"linkerd-proxy-balance-queue",
21322144
"linkerd-proxy-core",
21332145
"linkerd-stack",
2134-
"rand",
2146+
"rand 0.9.0",
21352147
"tokio",
21362148
"tower",
21372149
"tracing",
@@ -2250,7 +2262,7 @@ dependencies = [
22502262
"linkerd-tracing",
22512263
"parking_lot",
22522264
"pin-project",
2253-
"rand",
2265+
"rand 0.9.0",
22542266
"thiserror 2.0.11",
22552267
"tokio",
22562268
"tokio-test",
@@ -2355,7 +2367,7 @@ dependencies = [
23552367
"pin-project",
23562368
"prost-types",
23572369
"quickcheck",
2358-
"rand",
2370+
"rand 0.9.0",
23592371
"thiserror 2.0.11",
23602372
"tokio",
23612373
"tonic",
@@ -2373,7 +2385,7 @@ dependencies = [
23732385
"linkerd-proxy-balance",
23742386
"linkerd-stack",
23752387
"pin-project",
2376-
"rand",
2388+
"rand 0.9.0",
23772389
"tokio",
23782390
"tower",
23792391
]
@@ -2551,7 +2563,7 @@ dependencies = [
25512563
"linkerd-dns",
25522564
"linkerd-tls",
25532565
"linkerd2-proxy-api",
2554-
"rand",
2566+
"rand 0.9.0",
25552567
"regex",
25562568
"thiserror 2.0.11",
25572569
"tracing",
@@ -2603,7 +2615,7 @@ dependencies = [
26032615
"http",
26042616
"linkerd-error",
26052617
"linkerd-stack",
2606-
"rand",
2618+
"rand 0.8.5",
26072619
"thiserror 1.0.69",
26082620
"tower",
26092621
"tracing",
@@ -2805,7 +2817,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
28052817
checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
28062818
dependencies = [
28072819
"libc",
2808-
"wasi",
2820+
"wasi 0.11.0+wasi-snapshot-preview1",
28092821
"windows-sys 0.52.0",
28102822
]
28112823

@@ -2984,7 +2996,7 @@ dependencies = [
29842996
"futures-util",
29852997
"opentelemetry",
29862998
"percent-encoding",
2987-
"rand",
2999+
"rand 0.8.5",
29883000
"thiserror 1.0.69",
29893001
]
29903002

@@ -3118,7 +3130,7 @@ version = "0.2.20"
31183130
source = "registry+https://github.com/rust-lang/crates.io-index"
31193131
checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
31203132
dependencies = [
3121-
"zerocopy",
3133+
"zerocopy 0.7.35",
31223134
]
31233135

31243136
[[package]]
@@ -3250,7 +3262,7 @@ version = "1.0.3"
32503262
source = "registry+https://github.com/rust-lang/crates.io-index"
32513263
checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6"
32523264
dependencies = [
3253-
"rand",
3265+
"rand 0.8.5",
32543266
]
32553267

32563268
[[package]]
@@ -3269,8 +3281,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32693281
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
32703282
dependencies = [
32713283
"libc",
3272-
"rand_chacha",
3273-
"rand_core",
3284+
"rand_chacha 0.3.1",
3285+
"rand_core 0.6.4",
3286+
]
3287+
3288+
[[package]]
3289+
name = "rand"
3290+
version = "0.9.0"
3291+
source = "registry+https://github.com/rust-lang/crates.io-index"
3292+
checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
3293+
dependencies = [
3294+
"rand_chacha 0.9.0",
3295+
"rand_core 0.9.0",
3296+
"zerocopy 0.8.14",
32743297
]
32753298

32763299
[[package]]
@@ -3280,7 +3303,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32803303
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
32813304
dependencies = [
32823305
"ppv-lite86",
3283-
"rand_core",
3306+
"rand_core 0.6.4",
3307+
]
3308+
3309+
[[package]]
3310+
name = "rand_chacha"
3311+
version = "0.9.0"
3312+
source = "registry+https://github.com/rust-lang/crates.io-index"
3313+
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
3314+
dependencies = [
3315+
"ppv-lite86",
3316+
"rand_core 0.9.0",
32843317
]
32853318

32863319
[[package]]
@@ -3289,7 +3322,17 @@ version = "0.6.4"
32893322
source = "registry+https://github.com/rust-lang/crates.io-index"
32903323
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
32913324
dependencies = [
3292-
"getrandom",
3325+
"getrandom 0.2.15",
3326+
]
3327+
3328+
[[package]]
3329+
name = "rand_core"
3330+
version = "0.9.0"
3331+
source = "registry+https://github.com/rust-lang/crates.io-index"
3332+
checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff"
3333+
dependencies = [
3334+
"getrandom 0.3.1",
3335+
"zerocopy 0.8.14",
32933336
]
32943337

32953338
[[package]]
@@ -3382,7 +3425,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d"
33823425
dependencies = [
33833426
"cc",
33843427
"cfg-if",
3385-
"getrandom",
3428+
"getrandom 0.2.15",
33863429
"libc",
33873430
"spin",
33883431
"untrusted",
@@ -3689,7 +3732,7 @@ checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704"
36893732
dependencies = [
36903733
"cfg-if",
36913734
"fastrand",
3692-
"getrandom",
3735+
"getrandom 0.2.15",
36933736
"once_cell",
36943737
"rustix",
36953738
"windows-sys 0.52.0",
@@ -3980,7 +4023,7 @@ dependencies = [
39804023
"indexmap 1.9.3",
39814024
"pin-project",
39824025
"pin-project-lite",
3983-
"rand",
4026+
"rand 0.8.5",
39844027
"slab",
39854028
"tokio",
39864029
"tokio-util",
@@ -4171,6 +4214,15 @@ version = "0.11.0+wasi-snapshot-preview1"
41714214
source = "registry+https://github.com/rust-lang/crates.io-index"
41724215
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
41734216

4217+
[[package]]
4218+
name = "wasi"
4219+
version = "0.13.3+wasi-0.2.2"
4220+
source = "registry+https://github.com/rust-lang/crates.io-index"
4221+
checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
4222+
dependencies = [
4223+
"wit-bindgen-rt",
4224+
]
4225+
41744226
[[package]]
41754227
name = "wasm-bindgen"
41764228
version = "0.2.93"
@@ -4396,6 +4448,15 @@ dependencies = [
43964448
"windows-sys 0.48.0",
43974449
]
43984450

4451+
[[package]]
4452+
name = "wit-bindgen-rt"
4453+
version = "0.33.0"
4454+
source = "registry+https://github.com/rust-lang/crates.io-index"
4455+
checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
4456+
dependencies = [
4457+
"bitflags 2.4.2",
4458+
]
4459+
43994460
[[package]]
44004461
name = "write16"
44014462
version = "1.0.0"
@@ -4465,7 +4526,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
44654526
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
44664527
dependencies = [
44674528
"byteorder",
4468-
"zerocopy-derive",
4529+
"zerocopy-derive 0.7.35",
4530+
]
4531+
4532+
[[package]]
4533+
name = "zerocopy"
4534+
version = "0.8.14"
4535+
source = "registry+https://github.com/rust-lang/crates.io-index"
4536+
checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468"
4537+
dependencies = [
4538+
"zerocopy-derive 0.8.14",
44694539
]
44704540

44714541
[[package]]
@@ -4479,6 +4549,17 @@ dependencies = [
44794549
"syn",
44804550
]
44814551

4552+
[[package]]
4553+
name = "zerocopy-derive"
4554+
version = "0.8.14"
4555+
source = "registry+https://github.com/rust-lang/crates.io-index"
4556+
checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1"
4557+
dependencies = [
4558+
"proc-macro2",
4559+
"quote",
4560+
"syn",
4561+
]
4562+
44824563
[[package]]
44834564
name = "zerofrom"
44844565
version = "0.1.5"

deny.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ skip = [
6262
# Some dependencies still use indexmap v1.
6363
{ name = "indexmap", version = "1" },
6464
{ name = "hashbrown", version = "0.12" },
65+
6566
]
6667
skip-tree = [
6768
# thiserror v2 is still propagating through the ecosystem
6869
{ name = "thiserror", version = "1" },
70+
# rand 0.9 is still propagating through the ecosystem
71+
{ name = "rand", version = "0.8" },
6972
]
7073

7174
[sources]

linkerd/distribute/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ publish = false
99
ahash = "0.8"
1010
linkerd-stack = { path = "../stack" }
1111
parking_lot = "0.12"
12-
rand = { version = "0.8", features = ["small_rng"] }
12+
rand = { version = "0.9", features = ["small_rng"] }
1313
tokio = { version = "1", features = ["macros"] }
1414
tracing = "0.1"
1515

linkerd/distribute/src/keys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use ahash::{HashMap, HashMapExt};
22
use rand::{
3-
distributions::{WeightedError, WeightedIndex},
3+
distr::weighted::{Error as WeightedError, WeightedIndex},
44
prelude::Distribution as _,
55
Rng,
66
};

linkerd/distribute/src/params.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::{
33
WeightedServiceKeys,
44
};
55
use ahash::AHashSet;
6-
use rand::distributions::WeightedError;
76
use std::{fmt::Debug, hash::Hash, sync::Arc};
87

98
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -73,7 +72,7 @@ impl<K> Distribution<K> {
7372

7473
pub fn random_available<T: IntoIterator<Item = (K, u32)>>(
7574
iter: T,
76-
) -> Result<Self, WeightedError> {
75+
) -> Result<Self, rand::distr::weighted::Error> {
7776
let weighted_keys = WeightedServiceKeys::new(
7877
iter.into_iter()
7978
.map(|(key, weight)| WeightedKey { key, weight }),

0 commit comments

Comments
 (0)