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

Lower Rustc version requirement to 1.9 for rand_core #413

Closed
wants to merge 2 commits into from

Conversation

pitdicker
Copy link
Contributor

After seeing how much contortions some crates go through to keep building on older rust versions, I changed my mind and want to document the oldest version supported by rand_core.

Rayon depends on rust 1.12, which we can support to with just a few cosmetic changes. With those changes rand_core also builds on rust 1.9.0.

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

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

Wow, I was hoping we'd seen the last of try!

Are there users who actually want this? If so I'm quite happy to support an older version of Rust, but as it stands most (if not all) binaries using rand_core will somewhere be using rand too.

@pitdicker
Copy link
Contributor Author

Wow, I was hoping we'd seen the last of try!

Really? I was pretty happy when it got introduced, and don't mind it much. But of course ? is nicer to use.

Are there users who actually want this?

Don't know, what I had it in mind for was #399 (comment). Basically if a library wants to support older rust versions, and its requirements are really minimal, using only rand_core and possibly an RNG crate is an option. And I think it is nice for a _core crate to not require much.

@dhardy dhardy added the E-question Participation: opinions wanted label Apr 22, 2018
@vks
Copy link
Collaborator

vks commented Apr 23, 2018

I also wonder what the use case of rand_core with Rust 1.9 is if rand requires 1.22. The following scenario comes to mind: Some crate wants to implement a trait from rand_core as a non-essential feature without forcing everyone to use Rust 1.9 and without making rand_core support optional. Not sure how likely this is though...

@cuviper
Copy link
Contributor

cuviper commented Apr 27, 2018

Rayon depends on rust 1.12

FWIW, we bumped that slightly to 1.13 when we switched to crossbeam-deque.

I'm debating whether rayon-core should continue depending on rand at all, because its need is really basic -- it just wants spread the work-stealing around. We'd probably be just fine with a local implementation of a weak PRNG for this. (The remaining rand uses are in testing, for which we don't worry about rustc version.)

@dhardy
Copy link
Member

dhardy commented Apr 28, 2018

Well, this PR is about reducing the Rust version of just rand_core so it's not enough for that anyway (rand itself still requires 1.22). That said, we will move some PRNGs to separate crates in the future, so you could just depend on rand_core + rand_small_prngs or something, and seed with a constant, probably.

@pitdicker
Copy link
Contributor Author

Would this PR be acceptable if the minimum rust version was lowered to only 1.13, with the try operator?

@dhardy
Copy link
Member

dhardy commented Apr 29, 2018

I'd say supporting older compilers is acceptable if and only if there is a use case we care about supporting. If Rayon wants to support 1.13 and use only rand_core then that is sufficient IMO — but right now Rayon depends on the full Rand lib anyway.

If anyone disagrees, by all means speak up — but I don't think we should support older compilers "just because we can".

@dhardy
Copy link
Member

dhardy commented May 8, 2018

I think we can close this then. I'm happy to revisit the issue should something come up but I'd be a little surprised if rand_core requiring a recent compiler is a problem for anyone when rand already requires a recent compiler. But if this does affect you, speak up.

@dhardy dhardy closed this May 8, 2018
@pitdicker pitdicker deleted the rustc_1.0 branch June 8, 2018 18:29
@pitdicker pitdicker restored the rustc_1.0 branch June 8, 2018 18:29
@pitdicker pitdicker deleted the rustc_1.0 branch July 20, 2018 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-question Participation: opinions wanted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants