Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracker: rand 0.9 #1165

Open
18 of 23 tasks
vks opened this issue Aug 24, 2021 · 42 comments
Open
18 of 23 tasks

Tracker: rand 0.9 #1165

vks opened this issue Aug 24, 2021 · 42 comments
Labels
X-tracker Type: tracker
Milestone

Comments

@vks
Copy link
Collaborator

vks commented Aug 24, 2021

Blocker:

Planned breaking changes for rand 0.9 are:

Possibly also:

Non-breaking TODOs:

@dhardy
Copy link
Member

dhardy commented Oct 18, 2021

We should also conform to common Rust coding standards (generally expected of open projects now). I have argued against these in the past (some poor formatting and false-positive lints, verbosity of opt-outs), but the reasons not to use these are fewer (less active development) and reasons to do so greater (mature tools and very widespread usage):

  • use rustfmt (with #[rustfmt::skip] where required), including CI check
  • use Clippy (with required opt-outs), including CI check

I suggest only doing this late before v0.9 since both will cause significant merge conflicts and there is currently some on-going work.

@vks
Copy link
Collaborator Author

vks commented Oct 21, 2021

Fixing the clippy warnings is not a big deal, we are already doing pretty well. Also see #1197.

@dhardy
Copy link
Member

dhardy commented Feb 22, 2022

We should consider bumping the MSRV to Rust 1.51.0 (March 2021), enabling usage of const generics by default.

@dhardy
Copy link
Member

dhardy commented Nov 22, 2022

Question: do we make a breaking release of rand_core at the same time or stick with 0.6.x?

See my comment in #1269:

  • Avoiding breaking changes to rand_core lets users upgrade to Rand v0.9 more easily (no need to touch RNGs)
  • We may well make breaking changes to RngCore in the future, but likely not soon (most ideas floated depend on unstable language features)
  • We cannot release 1.0 without getrandom 1.0
  • Avoiding breaking changes effectively means we have two MSRVs and corresponding CI tests within the project, but this should be okay

@vks
Copy link
Collaborator Author

vks commented Nov 22, 2022

What breaking changes would we want to release for rand_core?

@dhardy
Copy link
Member

dhardy commented Nov 23, 2022

Pending: #1182, #1267.

Possible future changes: #1261, and @newpavlov mentioned somewhere using const generics to re-write RngCore with a method like fn generate(&mut self, result: &mut [u8; Self::LENGTH]). (I can't find his comment.)

@newpavlov
Copy link
Member

newpavlov commented Nov 23, 2022

I also would like to rework a bit the crypto traits. We have some issues with them in RustCrypto, see: RustCrypto/traits#1148

@coolreader18
Copy link

coolreader18 commented Nov 30, 2022

Not sure if this would be the place for it, but in terms of major version bumps it'd be good to switch feature specifications over to weak feature dependencies ("dep?/feature" syntax) once the MSRV >= 1.60. Otherwise there's no actual way to e.g. enable std without also enabling rand_chacha as a dependency cause it's std = [.. "rand_chacha/std", ..]

@dhardy
Copy link
Member

dhardy commented Dec 1, 2022

I guess we could go all the way to 1.60 (April 2022). We already have a PR for 1.56: #1269.

@dhardy
Copy link
Member

dhardy commented Dec 6, 2022

Lets go with a breaking release for rand_core since we have a few proposed changes and no objections.

@coolreader18 feel free to make a PR with your proposed changes after the 1.56 PR is merged. I'm not certain yet we'll use 1.60 but think it's unlikely there will be a significant reason not to.

@SUPERCILEX
Copy link
Contributor

Is it worth making a release with what we currently have? Selfishly, I'd like to be able to use my PRs, but it's also worth noting that the last release was in February 2022. I tend to prefer the regular release cadence approach rather than the wait for everything to be ready approach. Thoughts?

@dhardy
Copy link
Member

dhardy commented Nov 19, 2023

I would like to get a release out soon, if only because we've had a lot of changes since the last release. Will have to review (and dedicate a bit of time to this).

@dhardy
Copy link
Member

dhardy commented Feb 13, 2024

Update: a pre-release is planned.

I'd like to get a couple more significant changes in before the actual release:

@dhardy
Copy link
Member

dhardy commented Mar 21, 2024

We should also resolve this, one way or another:

@vks
Copy link
Collaborator Author

vks commented Mar 22, 2024

I don't think #1399 is a blocker, it's one of the caveats of using usize. I think we can fix it, and it would be a value-breaking change, but I would be fine with leaving this for Rand 0.10. If we just add gen_index, it would not even be a breaking change.

@dhardy
Copy link
Member

dhardy commented Mar 22, 2024

Fair point, although we already have value-breaking changes here.

zerocopy may be our biggest blocker right now anyway (see update at the very top of this issue).

@josephlr
Copy link
Member

josephlr commented May 1, 2024

We are looking at updating the getrandom implementation on Windows to match that in libstd: rust-random/getrandom#414

The simplest way to implement this is to use raw-dylib which was only stabilized in Rust 1.71 (released July 2023). We were considering releasing a release of getrandom which bumped the MSRV to 1.71. Would that be too new for rand 0.9?

CC: @newpavlov

@dhardy
Copy link
Member

dhardy commented May 1, 2024

At the rate we're going, that may still be a year old by the time 0.9 is ready (though I hope not).

I am not aware of any hard constraints here.

@joshlf
Copy link
Contributor

joshlf commented May 4, 2024

Fair point, although we already have value-breaking changes here.

zerocopy may be our biggest blocker right now anyway (see update at the very top of this issue).

Is there a reason you can't use zerocopy 0.7.32? What 0.8 features do you need? Maybe we could backport things to 0.7 to unblock you?

@joshlf
Copy link
Contributor

joshlf commented May 4, 2024

Update: I've submitted #1446; at least as of the current state of master, 0.7.33 works, which I hope can unblock you guys.

@dhardy
Copy link
Member

dhardy commented May 5, 2024

It might be worth deciding whether to adopt #1424 before the next release. (Comments welcome.)

I was also hoping to see the migration to chacha20. Not sure exactly where that's at. @tarcieri?

@tarcieri
Copy link

tarcieri commented May 7, 2024

We've merged RustCrypto/stream-ciphers#333 which re-adds rand_core support.

However, it will probably still be some time before we cut a release, and one of the potential blockers on such a release is if we should upgrade to a prospective rand_core v0.7 first

@dhardy dhardy added the X-tracker Type: tracker label Jul 10, 2024
@dhardy
Copy link
Member

dhardy commented Jul 10, 2024

I'd like to get #1299 solved one way (#1301) or another (#1462 — assuming I can convince people that the differences between open and closed ranges are unimportant for floats), then I think we can drop a Beta release.

@SUPERCILEX
Copy link
Contributor

It sounds like numpy allows returning the exclusive bound of a range, so doing #1462 seems reasonable especially since it probably improves performance.

@WarrenWeckesser
Copy link
Collaborator

@dhardy, sorry for disappearing for so long. I can take another look at the uniform changes this weekend (probably Sunday), but don't wait for me if you want to get the release out sooner!

@dhardy
Copy link
Member

dhardy commented Jul 28, 2024

Our to-do list is now done (excepting replacing ChaCha code with the chacha20 implementation, for which it's been requested we release the next rand version first).

One last thing I'd like to solve, however, is usize / isize non-portability (#1399). To that end I have opened #1471, though I release that approach may be unpopular. Opinions on that PR please.

I'm away on holiday from Thursday and would love to make a beta release of v0.9 before then.

@dhardy
Copy link
Member

dhardy commented Jul 29, 2024

I have published an alpha: https://github.com/rust-random/rand/tree/0.9.0-alpha.2 (master + #1471 + #1480 + a couple of tweaks to Cargo.toml).

@dhardy
Copy link
Member

dhardy commented Jul 31, 2024

@SUPERCILEX
Copy link
Contributor

Can https://github.com/rust-random/rngs get alpha releases too? Pretty sure it's not possible to upgrade if use something like rand_xoshiro. Then again might be a bit of a pain, so could wait for the full release.

@hsn10
Copy link

hsn10 commented Aug 5, 2024

Create MSRV policy and hardcode dependencies, otherwise you can lose MSRV if dependency upgrades its MSRV in minor version.

I am happy with any MSRV <= 1.60. Usually 1.56.0 is used for simple crates because its lowest 2021 edition.

@newpavlov

This comment was marked as off-topic.

@hsn10

This comment was marked as off-topic.

@newpavlov

This comment was marked as off-topic.

@hsn10

This comment was marked as off-topic.

@newpavlov

This comment was marked as off-topic.

@tarcieri

This comment was marked as off-topic.

@epage

This comment was marked as off-topic.

@joshlf

This comment was marked as off-topic.

@epage

This comment was marked as off-topic.

@dhardy
Copy link
Member

dhardy commented Oct 1, 2024

I marked that whole discussion off-topic (the short version is that we will not be pinning dependencies).

Our MSRV policy is basically just "at least a year old at the time of the next Rand release, and consider other factors". In effect, I decide.

We are open to a PR reducing the MSRV to 1.60, assuming there isn't too much fallout. #1513

@dhardy
Copy link
Member

dhardy commented Nov 23, 2024

PR for beta release: #1535

@newpavlov
Copy link
Member

newpavlov commented Nov 24, 2024

It may be worth to bump MSRV to 1.63 following the libc bump: rust-lang/libc#4040

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
X-tracker Type: tracker
Projects
None yet
Development

No branches or pull requests