build(deps): update rand requirement

Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version.

Updates `rand` to 0.8.5
- [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.0...0.8.5)

---
updated-dependencies:
- dependency-name: rand
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
reviewable/pr1177/r1
dependabot[bot] 1 week ago committed by Tamir Duberstein
parent c608a2d3d2
commit 5e5cd29922
No known key found for this signature in database

@ -87,7 +87,7 @@ proc-macro2 = { version = "1", default-features = false }
proc-macro2-diagnostics = { version = "0.10.1", default-features = false } proc-macro2-diagnostics = { version = "0.10.1", default-features = false }
public-api = { version = "0.44.0", default-features = false } public-api = { version = "0.44.0", default-features = false }
quote = { version = "1", default-features = false } quote = { version = "1", default-features = false }
rand = { version = "0.8", default-features = false } rand = { version = "0.9", default-features = false }
rbpf = { version = "0.3.0", default-features = false } rbpf = { version = "0.3.0", default-features = false }
rustdoc-json = { version = "0.9.0", default-features = false } rustdoc-json = { version = "0.9.0", default-features = false }
rustup-toolchain = { version = "0.1.5", default-features = false } rustup-toolchain = { version = "0.1.5", default-features = false }
@ -105,3 +105,7 @@ xdpilone = { version = "1.0.5", default-features = false }
[profile.release.package.integration-ebpf] [profile.release.package.integration-ebpf]
debug = 2 debug = 2
codegen-units = 1 codegen-units = 1
[patch.crates-io]
# TODO: Remove when https://github.com/rust-random/getrandom/commit/b75db5cede302bc9734f5bf2b9048a6e05c7f11e appears in a release.
getrandom = { git = "https://github.com/rust-random/getrandom.git#b75db5cede302bc9734f5bf2b9048a6e05c7f11e" }

@ -22,7 +22,7 @@ libc = { workspace = true }
log = { workspace = true } log = { workspace = true }
netns-rs = { workspace = true } netns-rs = { workspace = true }
object = { workspace = true, features = ["elf", "read_core", "std"] } object = { workspace = true, features = ["elf", "read_core", "std"] }
rand = { workspace = true, features = ["std", "std_rng"] } rand = { workspace = true, features = ["thread_rng"] }
rbpf = { workspace = true } rbpf = { workspace = true }
test-case = { workspace = true } test-case = { workspace = true }
test-log = { workspace = true, features = ["log"] } test-log = { workspace = true, features = ["log"] }

@ -77,8 +77,8 @@ struct WithData(RingBufTest, Vec<u64>);
impl WithData { impl WithData {
fn new(n: usize) -> Self { fn new(n: usize) -> Self {
Self(RingBufTest::new(), { Self(RingBufTest::new(), {
let mut rng = rand::thread_rng(); let mut rng = rand::rng();
std::iter::repeat_with(|| rng.gen()).take(n).collect() std::iter::repeat_with(|| rng.random()).take(n).collect()
}) })
} }
} }
@ -270,13 +270,17 @@ async fn ring_buf_async_no_drop() {
) = WithData::new(RING_BUF_MAX_ENTRIES * 3); ) = WithData::new(RING_BUF_MAX_ENTRIES * 3);
let writer = { let writer = {
let data = data.to_owned(); let mut rng = rand::rng();
let data: Vec<_> = data
.iter()
.copied()
.map(|value| (value, Duration::from_nanos(rng.random_range(0..10))))
.collect();
tokio::spawn(async move { tokio::spawn(async move {
for value in data { for (value, duration) in data {
// Sleep a tad so we feel confident that the consumer will keep up // Sleep a tad so we feel confident that the consumer will keep up
// and no messages will be dropped. // and no messages will be dropped.
let dur = Duration::from_nanos(rand::thread_rng().gen_range(0..10)); sleep(duration).await;
sleep(dur).await;
ring_buf_trigger_ebpf_program(value); ring_buf_trigger_ebpf_program(value);
} }
}) })

Loading…
Cancel
Save