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

A new version with getrandom? #475

Closed
RazrFalcon opened this issue Jun 24, 2020 · 7 comments
Closed

A new version with getrandom? #475

RazrFalcon opened this issue Jun 24, 2020 · 7 comments

Comments

@RazrFalcon
Copy link

Is there are plans on making a new release with getrandom instead of rand?

@ghost
Copy link

ghost commented Jul 23, 2020

Ping - I am also interested in a new release for the same reason.

@kinggoesgaming
Copy link
Member

Hi,

I recently switched from full time Linux to full time windows setup. As soon as I am done setting up my dev env I will try to get the PRs merged and all :)

@kinggoesgaming
Copy link
Member

Ok so I am thinking tomorrow to start looking into this :)

Sorry for the long pause on development

@ammgws
Copy link
Contributor

ammgws commented Oct 22, 2020

@kinggoesgaming Is #494 a blocker for this?

@RazrFalcon
Copy link
Author

Any updates?

bors bot added a commit that referenced this issue Dec 21, 2020
503: Un-breaking-change Uuid::new_v4 r=KodrAus a=CAD97

<!--
    If this PR is a breaking change, ensure that you are opening it against 
    the `breaking` branch.  If the pull request is incomplete, prepend the Title with WIP: 
-->

**I'm submitting a(n)** refactor

# Description

#447 changed from using `rand::thread_rng` to using `getrandom` in `Uuid::new_v4`. This also changed the return type from `Uuid` to `Result<Uuid, getrandom::Error>`. This PR reverts the signature to the simpler `new_v4() -> Uuid`.

# Motivation

This signature is much simpler to use, and avoids a breaking change. `getrandom` is _highly_ unlikely to fail, and previously we used `thread_rng` here, which also panics if it fails to initialize from the OS entropy source. If `getrandom` fails, it is highly unlikely that any program creating v4 UUIDs has any reasonable recovery other than to abort, as the system is in a broken state.

If users absolutely need to recover in this situation, they can call `getrandom` first themselves to make sure that their system is working, or generate the bytes themselves and create the UUID from those bytes.

Additionally, actually wrapping `getrandom::Error` in `uuid::Error` comes with its own fun set of problems, described in #502.

# Tests

N/A

# Related Issue(s)

#475: this undoes the breaking change to `Uuid::new_v4`, thus making the requested publish a patch update

Closes #502: alternate approach to the same TODO

Co-authored-by: CAD97 <[email protected]>
@KodrAus
Copy link
Member

KodrAus commented Dec 21, 2020

We've added getrandom support to the master branch. I'm backporting now to 0.8.x so we can push out a new release with it.

bors bot added a commit that referenced this issue Dec 24, 2020
504: Merge master into 0.8.x r=kinggoesgaming a=KodrAus

This PR merges the current `master` branch into `0.8.x` along with a new commit that reverts the breaking change to `from_guid`. I'll give the diff another look over, but this should let us push a new `0.8.x` release with the last year's worth of effort.

Closes:

- #475 

Co-authored-by: Hunar Roop Kahlon <[email protected]>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Jason Nader <[email protected]>
@KodrAus
Copy link
Member

KodrAus commented Jan 11, 2021

0.8.2 has now been published 🎉

I gave the diff a good long look to make sure there weren't breaking changes in there, but that's one of the challenges of infrequent releases!

@KodrAus KodrAus closed this as completed Jan 11, 2021
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

No branches or pull requests

4 participants