Skip to content

Use common Timestamp impl in Hermit (attempt 2)#154234

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
stepancheg:hermit-timespec
Mar 28, 2026
Merged

Use common Timestamp impl in Hermit (attempt 2)#154234
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
stepancheg:hermit-timespec

Conversation

@stepancheg
Copy link
Copy Markdown
Contributor

@stepancheg stepancheg commented Mar 23, 2026

The goal is to have less code to maintain, so to be able to make changes easier.

Previous attempt #148847 was asked to postpone because there was restructure of code, which is complete now.

r? joboet

@rustbot rustbot added O-hermit Operating System: Hermit O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 23, 2026
@stepancheg stepancheg force-pushed the hermit-timespec branch 2 times, most recently from 878bcf6 to a5006e0 Compare March 23, 2026 03:35
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 23, 2026

joboet is currently at their maximum review capacity.
They may take a while to respond.

@stepancheg stepancheg marked this pull request as ready for review March 23, 2026 03:40
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 23, 2026
@stepancheg
Copy link
Copy Markdown
Contributor Author

r? Mark-Simulacrum

@rustbot rustbot assigned Mark-Simulacrum and unassigned joboet Mar 23, 2026
@rust-bors

This comment has been minimized.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 23, 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.

Copy link
Copy Markdown
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me with comment addressed

View changes since this review


fn clock_gettime(clock: hermit_abi::clockid_t) -> Timespec {
let mut t = hermit_abi::timespec { tv_sec: 0, tv_nsec: 0 };
let _ = unsafe { hermit_abi::clock_gettime(clock, &raw mut t) };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we ignoring the error here? In unix/time.rs we panic if there's an error, probably should match that here?

                cvt(unsafe { clock_gettime64(clock, t.as_mut_ptr()) }).unwrap();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Mark-Simulacrum

It was ignored before, so I did not include it in this PR which moves files and does not change semantics.

let _ = unsafe { hermit_abi::clock_gettime(CLOCK_MONOTONIC, &raw mut time.t) };

Should I include unwrap in this PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's merge this and if you can file a followup (maybe check for other similar discrepancies too) that would be good. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure thing!

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 27, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 27, 2026

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

@Mark-Simulacrum
Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 28, 2026

📌 Commit 178882d has been approved by Mark-Simulacrum

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 28, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 28, 2026
Rollup of 9 pull requests

Successful merges:

 - #154357 (uefi: extend comment for TcpStream Send impl)
 - #154410 (Clean up the API for opening/checking incremental-compilation files )
 - #154081 (format safety doc of Rc/Arc::from_raw/from_raw_in)
 - #154110 (Change "error finalizing incremental compilation" text and emit it as a note, not a warning)
 - #154196 (Make `Ipv6Addr::multicast_scope()` exhaustive)
 - #154221 (`vec::as_mut_slice()`: use lowercase "isize" in safety comment)
 - #154234 (Use common Timestamp impl in Hermit (attempt 2))
 - #154396 (chore(deps): update rust crate tar to v0.4.45)
 - #154488 (Revert "Unstable book options parser")
rust-bors bot pushed a commit that referenced this pull request Mar 28, 2026
Rollup of 9 pull requests

Successful merges:

 - #154357 (uefi: extend comment for TcpStream Send impl)
 - #154410 (Clean up the API for opening/checking incremental-compilation files )
 - #154081 (format safety doc of Rc/Arc::from_raw/from_raw_in)
 - #154110 (Change "error finalizing incremental compilation" text and emit it as a note, not a warning)
 - #154196 (Make `Ipv6Addr::multicast_scope()` exhaustive)
 - #154221 (`vec::as_mut_slice()`: use lowercase "isize" in safety comment)
 - #154234 (Use common Timestamp impl in Hermit (attempt 2))
 - #154396 (chore(deps): update rust crate tar to v0.4.45)
 - #154488 (Revert "Unstable book options parser")
@rust-bors rust-bors bot merged commit d471d0b into rust-lang:main Mar 28, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 28, 2026
rust-timer added a commit that referenced this pull request Mar 28, 2026
Rollup merge of #154234 - stepancheg:hermit-timespec, r=Mark-Simulacrum

Use common Timestamp impl in Hermit (attempt 2)

The goal is to have less code to maintain, so to be able to make changes easier.

Previous attempt #148847 was asked to postpone because there was restructure of code, which is complete now.

r? joboet
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-hermit Operating System: Hermit O-unix Operating system: Unix-like 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