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

Revert to using RtlGenRandom as a fallback #108060

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

ChrisDenton
Copy link
Member

This is required due to BCryptGenRandom failing to load a dll it depends on.

Fixes #108059

This is required due to `BCryptGenRandom` failing to load the necessary dll on some systems.
@rustbot
Copy link
Collaborator

rustbot commented Feb 14, 2023

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 14, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 14, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@ChrisDenton ChrisDenton changed the title Revert to using RtlGenRandom Revert to using RtlGenRandom as a fallback Feb 14, 2023
@ChrisDenton ChrisDenton added the O-windows Operating system: Windows label Feb 14, 2023
@thomcc
Copy link
Member

thomcc commented Feb 14, 2023

I think this is good (and honestly was surprised we didn't need to keep the old code to begin with)

@bors r+

@bors
Copy link
Contributor

bors commented Feb 14, 2023

📌 Commit dfd0afb has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 14, 2023
@ChrisDenton
Copy link
Member Author

I'm nominating this for a beta backport because it can lead to a startup crash (e.g. in env-logger) or really any use of HashMap with the default hasher.

@rustbot label +beta-nominated

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 14, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 15, 2023
Rollup of 7 pull requests

Successful merges:

 - rust-lang#105300 (rework min_choice algorithm of member constraints)
 - rust-lang#107163 (Remove some superfluous type parameters from layout.rs.)
 - rust-lang#107173 (Suggest the correct array length on mismatch)
 - rust-lang#107411 (Handle discriminant in DataflowConstProp)
 - rust-lang#107968 (Enable `#[thread_local]` on armv6k-nintendo-3ds)
 - rust-lang#108032 (Un📦ing the Resolver)
 - rust-lang#108060 (Revert to using `RtlGenRandom` as a fallback)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ef6de70 into rust-lang:master Feb 15, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 15, 2023
@ChrisDenton ChrisDenton deleted the rtlgenrandom branch February 16, 2023 04:25
chutten added a commit to chutten/getrandom that referenced this pull request Feb 16, 2023
In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes rust-random#314
chutten added a commit to chutten/getrandom that referenced this pull request Feb 16, 2023
In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes rust-random#314
chutten added a commit to chutten/getrandom that referenced this pull request Feb 16, 2023
In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes rust-random#314
chutten added a commit to chutten/getrandom that referenced this pull request Feb 17, 2023
In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes rust-random#314
chutten added a commit to chutten/getrandom that referenced this pull request Feb 21, 2023
In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes rust-random#314
chutten added a commit to chutten/getrandom that referenced this pull request Feb 22, 2023
In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes rust-random#314
@m-ou-se m-ou-se added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Feb 22, 2023
josephlr pushed a commit to rust-random/getrandom that referenced this pull request Feb 22, 2023
* Add in a RtlGenRandom fallback for non-UWP Windows

In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes #314

* style suggestion

Co-authored-by: Artyom Pavlov <[email protected]>

* appease clippy

---------

Co-authored-by: Artyom Pavlov <[email protected]>
@ChrisDenton ChrisDenton added beta-nominated Nominated for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Feb 23, 2023
@cuviper cuviper modified the milestones: 1.69.0, 1.68.0 Mar 2, 2023
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 2, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2023
[beta] stage0 bump and backports

- Bump stage0 to stable
- Revert to using `RtlGenRandom` as a fallback rust-lang#108060
- Fix `VecDeque::shrink_to` and add tests. rust-lang#108475
- Fix `VecDeque::append` capacity overflow for ZSTs rust-lang#108462
- Clippy: Fix array-size-threshold config deserialization error rust-lang#108673 / rust-lang/rust-clippy#10423
- Yeet point_at_expr_source_of_inferred_type for now rust-lang#108703

r? `@ghost`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std::sys::windows::rand::hashmap_random_keys() panics on some systems
6 participants