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

Disable default features for rand dep in phf_generator #263

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Disable default features for rand dep in phf_generator #263

merged 1 commit into from
Aug 3, 2022

Conversation

lopopolo
Copy link
Contributor

@lopopolo lopopolo commented Aug 2, 2022

These dependencies are not needed when using distributions and small_rng.

These dependencies are not needed when using distributions and small_rng.
lopopolo added a commit to artichoke/artichoke that referenced this pull request Aug 2, 2022
In MRI Ruby, `SecureRandom` is implemented with `Random::urandom` which
itself is implemented with an OS-provided cryptographically secure
random number source.

This commit removes an intermediate CSPRNG and instead delegates
directly to the host operating system for random bytes by using the
`getrandom` crate-backed `OsRng` from `rand`.

This allows deactivating a bunch of features in `rand` which will
hopefully drop some deps if rust-phf/rust-phf#263
is accepted and Artichoke upgrades to `pfh` 0.11.0+.
lopopolo added a commit to artichoke/artichoke that referenced this pull request Aug 2, 2022
In MRI Ruby, `SecureRandom` is implemented with `Random::urandom` which
itself is implemented with an OS-provided cryptographically secure
random number source.

This commit removes an intermediate CSPRNG and instead delegates
directly to the host operating system for random bytes by using the
`getrandom` crate-backed `OsRng` from `rand`.

This allows deactivating a bunch of features in `rand` which will
hopefully drop some deps if rust-phf/rust-phf#263
is accepted and Artichoke upgrades to `pfh` 0.11.0+.
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Thanks!

@JohnTitor JohnTitor merged commit d441940 into rust-phf:master Aug 3, 2022
@lopopolo lopopolo deleted the lopopolo/rand-no-default-features branch August 3, 2022 23:23
@lopopolo
Copy link
Contributor Author

lopopolo commented Aug 5, 2022

@JohnTitor I'm not sure how toilsome cutting a point release is, but I'd be interested in a new release that includes this PR. 🙏

@JohnTitor
Copy link
Member

Sure, I'll make a new release later today!

@JohnTitor
Copy link
Member

Release v0.11.1 including this PR: https://crates.io/crates/phf_generator/0.11.1

@lopopolo
Copy link
Contributor Author

lopopolo commented Aug 8, 2022

Thank you!

lopopolo added a commit to artichoke/artichoke that referenced this pull request Aug 9, 2022
This removes dependencies on CSPRNGs from `rand` as a followup to #2040
and rust-phf/rust-phf#263.

```console
$ cargo update -p phf -p phf_shared -p phf_codegen -p phf_generator
    Updating crates.io index
    Updating phf v0.11.0 -> v0.11.1
    Updating phf_codegen v0.11.0 -> v0.11.1
    Updating phf_generator v0.11.0 -> v0.11.1
    Updating phf_shared v0.11.0 -> v0.11.1
    Removing ppv-lite86 v0.2.16
    Removing rand_chacha v0.3.1
```

Part of tracking issue #2052.
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.

2 participants