Skip to content

Conversation

@PiJoules
Copy link
Contributor

Fuchsia doesn't support clock_nanosleep so default back to using nanosleep

@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 Jan 26, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2026

r? @jhpratt

rustbot has assigned @jhpratt.
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

@JayanAXHF JayanAXHF added the O-fuchsia Operating system: Fuchsia label Jan 26, 2026
Copy link
Contributor

@erickt erickt left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'll also need to update this code as well. However, it looks like this code has been in Rust for a couple months now, and was added in #145177. Looking through Fuchsia it seems like we've never used this API and didn't notice it was using the wrong one? I'll do a trial run of removing this function and make sure it doesn't break things for us.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't realize sleep_until hasn't stabilized, so it makes sense we didn't notice this. So I think we can put fixing that off for a future PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it to this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NM. Will save that for a future PR.

Copy link
Member

Choose a reason for hiding this comment

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

Actually I think it'd be better to remove this line now – this PR should fix all the bugs resulting from Fuchsia's lacking clock_nanosleep support. Leaving an actual working sleep_until implementation for a future PR sounds like a good idea though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 27, 2026
@PiJoules
Copy link
Contributor Author

Could you also update https://github.com/rust-lang/rust/blob/main/library/std/src/thread/functions.rs#L319 to say fuchsia is using nanosleep?

View changes since this review

Done

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 27, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@PiJoules PiJoules requested review from erickt and joboet January 27, 2026 18:32
Copy link
Member

@joboet joboet left a comment

Choose a reason for hiding this comment

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

The #[cfg] on the generic sleep_until in sys/thread/mod.rs needs to be updated, too. And could you please squash your commits?

View changes since this review

@joboet
Copy link
Member

joboet commented Jan 27, 2026

r? joboet

@rustbot rustbot assigned joboet and unassigned jhpratt Jan 27, 2026
@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 27, 2026
@PiJoules
Copy link
Contributor Author

The #[cfg] on the generic sleep_until in sys/thread/mod.rs needs to be updated, too. And could you please squash your commits?

View changes since this review

Done

@PiJoules PiJoules requested a review from joboet January 27, 2026 21:31
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 27, 2026
Copy link
Member

@joboet joboet Jan 27, 2026

Choose a reason for hiding this comment

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

This line also needs to be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@joboet
Copy link
Member

joboet commented Jan 27, 2026

May I suggest running ./x check library/std --target aarch64-unknown-fuchsia? That way you can check your changes locally – they aren't checked in the PR CI.

@PiJoules
Copy link
Contributor Author

May I suggest running ./x check library/std --target aarch64-unknown-fuchsia? That way you can check your changes locally – they aren't checked in the PR CI.

Thanks. I don't work on rust a lot so this was helpful.

@PiJoules PiJoules requested review from erickt and joboet January 27, 2026 22:10
@joboet
Copy link
Member

joboet commented Jan 28, 2026

Thanks!
@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 28, 2026

📌 Commit 5dbaac1 has been approved by joboet

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Jan 28, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 28, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #150491 (resolve: Mark items under exported ambiguous imports as exported)
 - #150720 (Do not suggest `derive` if there is already an impl)
 - #150968 (compiler-builtins: Remove the no-f16-f128 feature)
 - #151493 ([RFC] rustc_parse: improve the error diagnostic for "missing let in let chain")
 - #151660 (Bump `std`'s `backtrace`'s `rustc-demangle`)
 - #151696 (Borrowck: Simplify SCC annotation computation, placeholder rewriting)
 - #151704 (Implement `set_output_kind` for Emscripten linker)
 - #151706 (Remove Fuchsia from target OS list in unix.rs for sleep)
 - #151769 (fix undefined behavior in VecDeque::splice)
 - #151779 (stdarch subtree update)
 - #151449 ([rustdoc] Add regression test for #151411)
 - #151773 (clean up checks for constant promotion of integer division/remainder operations)
@rust-bors rust-bors bot merged commit b841ab2 into rust-lang:main Jan 29, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 29, 2026
rust-timer added a commit that referenced this pull request Jan 29, 2026
Rollup merge of #151706 - PiJoules:fuchsia-nanosleep, r=joboet

Remove Fuchsia from target OS list in unix.rs for sleep

Fuchsia doesn't support clock_nanosleep so default back to using nanosleep
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Jan 29, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#150491 (resolve: Mark items under exported ambiguous imports as exported)
 - rust-lang/rust#150720 (Do not suggest `derive` if there is already an impl)
 - rust-lang/rust#150968 (compiler-builtins: Remove the no-f16-f128 feature)
 - rust-lang/rust#151493 ([RFC] rustc_parse: improve the error diagnostic for "missing let in let chain")
 - rust-lang/rust#151660 (Bump `std`'s `backtrace`'s `rustc-demangle`)
 - rust-lang/rust#151696 (Borrowck: Simplify SCC annotation computation, placeholder rewriting)
 - rust-lang/rust#151704 (Implement `set_output_kind` for Emscripten linker)
 - rust-lang/rust#151706 (Remove Fuchsia from target OS list in unix.rs for sleep)
 - rust-lang/rust#151769 (fix undefined behavior in VecDeque::splice)
 - rust-lang/rust#151779 (stdarch subtree update)
 - rust-lang/rust#151449 ([rustdoc] Add regression test for rust-lang/rust#151411)
 - rust-lang/rust#151773 (clean up checks for constant promotion of integer division/remainder operations)
@PiJoules PiJoules deleted the fuchsia-nanosleep branch January 29, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-fuchsia Operating system: Fuchsia 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.

7 participants