Skip to content

std: move NuttX to use arc4random for random number generation #143776

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

Merged
merged 1 commit into from
Jul 13, 2025

Conversation

no1wudi
Copy link
Contributor

@no1wudi no1wudi commented Jul 11, 2025

arc4random support in libc merged in rust-lang/libc#4464, so:

  • Move target_os = "nuttx" from unix_legacy to arc4random section
  • This aligns NuttX with other POSIX-compliant systems that support arc4random
  • Improves random number generation quality on NuttX by using the system's built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security compared to the legacy random number generation methods.

* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's
  built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security
compared to the legacy random number generation methods.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
@rustbot
Copy link
Collaborator

rustbot commented Jul 11, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jul 11, 2025
@tgross35
Copy link
Contributor

Thanks!
@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 11, 2025

📌 Commit 0748462 has been approved by tgross35

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 Jul 11, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 12, 2025
std: move NuttX to use arc4random for random number generation

arc4random support in libc merged in rust-lang/libc#4464, so:

* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security compared to the legacy random number generation methods.
bors added a commit that referenced this pull request Jul 12, 2025
Rollup of 15 pull requests

Successful merges:

 - #143554 (slice: Mark `rotate_left`, `rotate_right` unstably const)
 - #143634 (interpret/allocation: expose init + write_wildcards on a range)
 - #143710 (Updates to random number generation APIs)
 - #143774 (constify `From` and `Into`)
 - #143776 (std: move NuttX to use arc4random for random number generation)
 - #143778 (Some const_trait_impl test cleanups)
 - #143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests)
 - #143791 (Update sysinfo version to `0.36.0`)
 - #143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute)
 - #143798 (Remove format short command trait)
 - #143803 (New tracking issues for const_ops and const_cmp)
 - #143814 (htmldocck: better error messages for some negative directives)
 - #143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap)
 - #143822 (./x test miri: fix cleaning the miri_ui directory)
 - #143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 13, 2025
Rollup of 12 pull requests

Successful merges:

 - #143776 (std: move NuttX to use arc4random for random number generation)
 - #143778 (Some const_trait_impl test cleanups)
 - #143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests)
 - #143791 (Update sysinfo version to `0.36.0`)
 - #143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute)
 - #143798 (Remove format short command trait)
 - #143803 (New tracking issues for const_ops and const_cmp)
 - #143814 (htmldocck: better error messages for some negative directives)
 - #143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap)
 - #143822 (./x test miri: fix cleaning the miri_ui directory)
 - #143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups)
 - #143841 (Label clippy changes with `T-clippy`)

Failed merges:

 - #143850 (Compiletest: Simplify {Html,Json}DocCk directive handling)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5d56459 into rust-lang:master Jul 13, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 13, 2025
rust-timer added a commit that referenced this pull request Jul 13, 2025
Rollup merge of #143776 - no1wudi:fix, r=tgross35

std: move NuttX to use arc4random for random number generation

arc4random support in libc merged in rust-lang/libc#4464, so:

* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security compared to the legacy random number generation methods.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jul 14, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#143776 (std: move NuttX to use arc4random for random number generation)
 - rust-lang/rust#143778 (Some const_trait_impl test cleanups)
 - rust-lang/rust#143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests)
 - rust-lang/rust#143791 (Update sysinfo version to `0.36.0`)
 - rust-lang/rust#143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute)
 - rust-lang/rust#143798 (Remove format short command trait)
 - rust-lang/rust#143803 (New tracking issues for const_ops and const_cmp)
 - rust-lang/rust#143814 (htmldocck: better error messages for some negative directives)
 - rust-lang/rust#143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap)
 - rust-lang/rust#143822 (./x test miri: fix cleaning the miri_ui directory)
 - rust-lang/rust#143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups)
 - rust-lang/rust#143841 (Label clippy changes with `T-clippy`)

Failed merges:

 - rust-lang/rust#143850 (Compiletest: Simplify {Html,Json}DocCk directive handling)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants