Skip to content

Conversation

@tottoto
Copy link
Contributor

@tottoto tottoto commented Jan 30, 2025

Updates to rand 0.9.

Cargo.toml Outdated
indexmap = "2"
rand = { version = "0.8.5", features = ["small_rng"] }
rand_distr = "0.4.3"
rand = { version = "0.9", features = ["small_rng"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little fuzzy on cargo resolver. Will this break consumers who also declare a dependency on 0.8?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a breaking change as rand updated rand_core and rand_core::RngCore is exposed at the Builder::build_with_rng.

https://docs.rs/turmoil/0.6.5/turmoil/struct.Builder.html#method.build_with_rng

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stash this one and we can bundle it when we go to 0.7?

Copy link
Contributor

@teskje teskje Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're going to have a breaking change anyway, can we consider removing rand from the public API? Instead of taking an rng value, could the builder take a seed instead? That's what tokio does as well. That would allow us to freely upgrade rand going forward, and it would also remove the need for the separate build_with_rng method.

Edit: I've put up an implementation of that proposal: #246

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#246 is merged. Anyone want to rebase this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased.

@tottoto tottoto force-pushed the update-to-rand-0.9 branch 2 times, most recently from dcc919b to 9aa7caa Compare May 20, 2025 15:16
Cargo.toml Outdated
indexmap = "2"
rand = { version = "0.8.5", features = ["small_rng"] }
rand_distr = "0.4.3"
rand = { version = "0.9", features = ["small_rng"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rand = { version = "0.9", features = ["small_rng"] }
rand = "0.9"

small_rng is the default now!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@tottoto tottoto force-pushed the update-to-rand-0.9 branch from 9aa7caa to 5fc52b4 Compare November 3, 2025 23:02
@tottoto tottoto force-pushed the update-to-rand-0.9 branch from 5fc52b4 to 064c0f6 Compare November 3, 2025 23:05
@mcches mcches merged commit 7474b9e into tokio-rs:main Nov 10, 2025
5 checks passed
@tottoto tottoto deleted the update-to-rand-0.9 branch November 10, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants