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

Enable clock_gettime on wasi #2499

Merged
merged 2 commits into from Nov 4, 2021
Merged

Conversation

coolreader18
Copy link
Contributor

I think this mostly addresses the issues that were brought up in #1307 regarding clock ids; I made clockid_t a wrapper struct because it needs to be Send and Sync to be used in a constant, and I figured it was opaque in wasi-libc anyway. Instead of static ZSTs, I just made them u8s, since I figured it's very unlikely that wasi-libc would change them from struct __clockid { __wasi_clockid_t id; } to struct __clockid {}, and it'll always be valid to treat a static as a /(u8)+/. One thing I was wondering about, should I add a cfg check to build.rs checking for core::ptr::addr_of? Since I think(?) using that would fix any issue of __clockid becoming a "zst" struct in the future.

@rust-highfive
Copy link

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

@Amanieu
Copy link
Member

Amanieu commented Nov 4, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Nov 4, 2021

📌 Commit cd57a93 has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Nov 4, 2021

⌛ Testing commit cd57a93 with merge 072d6de...

@bors
Copy link
Contributor

bors commented Nov 4, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: Amanieu
Pushing 072d6de to master...

@bors bors merged commit 072d6de into rust-lang:master Nov 4, 2021
bors added a commit that referenced this pull request Nov 11, 2021
Scope in Send, Sync for wasi

Without this, libc fails during the build of rustc. See rust-lang/rust#90681
This dependency was introduced in #2499.
Alternative solution: It's not clear this is necessary for core to finish building,
so maybe we should `#[cfg]` it out in that case, instead?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants