From c565b01e3e5ff9c3d6386dcce901fbe91c7eb788 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:49:25 +0000 Subject: [PATCH 1/2] build(deps): update rand requirement from 0.8.5 to 0.9.0 Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.9.0) --- updated-dependencies: - dependency-name: rand dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- benchmark/Cargo.toml | 2 +- firewood/Cargo.toml | 2 +- grpc-testtool/Cargo.toml | 2 +- storage/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmark/Cargo.toml b/benchmark/Cargo.toml index 591d376771..27e85628a2 100644 --- a/benchmark/Cargo.toml +++ b/benchmark/Cargo.toml @@ -12,7 +12,7 @@ metrics = "0.24.1" metrics-util = "0.19.0" metrics-exporter-prometheus = "0.16.1" tokio = { version = "1.36.0", features = ["rt", "sync", "macros", "rt-multi-thread"] } -rand = "0.8.5" +rand = "0.9.0" pretty-duration = "0.1.1" tikv-jemallocator = "0.6.0" env_logger = "0.11.5" diff --git a/firewood/Cargo.toml b/firewood/Cargo.toml index 58f7155166..71e3bceb8b 100644 --- a/firewood/Cargo.toml +++ b/firewood/Cargo.toml @@ -44,7 +44,7 @@ branch_factor_256 = [ "storage/branch_factor_256" ] [dev-dependencies] criterion = {version = "0.5.1", features = ["async_tokio"]} -rand = "0.8.5" +rand = "0.9.0" triehash = "0.8.4" clap = { version = "4.5.0", features = ['derive'] } pprof = { version = "0.14.0", features = ["flamegraph"] } diff --git a/grpc-testtool/Cargo.toml b/grpc-testtool/Cargo.toml index db238dc8c4..fcc2e1e329 100644 --- a/grpc-testtool/Cargo.toml +++ b/grpc-testtool/Cargo.toml @@ -33,7 +33,7 @@ tonic-build = "0.12.1" [dev-dependencies] criterion = {version = "0.5.1", features = ["async_tokio"]} -rand = "0.8.5" +rand = "0.9.0" [lints.rust] unsafe_code = "deny" diff --git a/storage/Cargo.toml b/storage/Cargo.toml index e390de49d4..a3ff23ea46 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -24,7 +24,7 @@ bitfield = "0.17.0" fastrace = { version = "0.7.4" } [dev-dependencies] -rand = "0.8.5" +rand = "0.9.0" test-case = "3.3.1" criterion = { version = "0.5.1", features = ["async_tokio", "html_reports"] } pprof = { version = "0.14.0", features = ["flamegraph"] } From 95dcac3c56552a8941d6bf8fb030aa2f4f16d9f4 Mon Sep 17 00:00:00 2001 From: Ron Kuris Date: Thu, 30 Jan 2025 09:24:32 -0800 Subject: [PATCH 2/2] Add compatibility with rand0.9.0 thread_rng has been renamed to rng Distribution moved --- benchmark/src/zipf.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/src/zipf.rs b/benchmark/src/zipf.rs index a054abdfbc..cb179642d8 100644 --- a/benchmark/src/zipf.rs +++ b/benchmark/src/zipf.rs @@ -6,8 +6,8 @@ use firewood::db::{BatchOp, Db}; use firewood::v2::api::{Db as _, Proposal as _}; use log::{debug, trace}; use pretty_duration::pretty_duration; -use rand::prelude::Distribution as _; -use rand::thread_rng; +use rand::distr::Distribution as _; +use rand::rng; use sha2::{Digest, Sha256}; use std::collections::HashSet; use std::error::Error; @@ -74,7 +74,7 @@ fn generate_updates( zipf: &zipf::ZipfDistribution, ) -> impl Iterator, Vec>> { let hash_of_batch_id = Sha256::digest(batch_id.to_ne_bytes()).to_vec(); - let rng = thread_rng(); + let rng = rng(); zipf.sample_iter(rng) .take(batch_size) .map(|inner_key| {