-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Provide SYS_statx for more target_arch/target_env #1577
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
You probably need to update the musl headers or the musl-sanitized linux kernel headers for this to work. The current kernel headers used by |
@gnzlbg Maybe need to upgrade? |
The current musl version used by libc on most targets is here: https://github.com/rust-lang/libc/blob/master/ci/install-musl.sh#L8 and the linux kernel that these targets support is here: https://github.com/rust-lang/libc/blob/master/ci/install-musl.sh#L75 However, for some targets (e.g. the mips ones), the latest available musl version in their toolchains is older, e.g., the mips 32-bit target only support musl 1.1.15: https://github.com/rust-lang/libc/blob/master/ci/docker/mips-unknown-linux-musl/Dockerfile#L14 I doubt there is a new toolchain for these targets, but if there is, sure, we could update. Otherwise, just do not expose the feature in those targets. |
Why we use OpenWrt snapshots instead of building from souce only in |
Probably because building the toolchain from source takes a long time. You can try to change those to build from source though, but given everything that OpenWrt provides it might take a while. |
Upgrade to musl 1.1.24 in CI Required by #1577 Note that in musl 1.1.24, `struct sched_param` from `sched.h` has changed and some fields became reserved. So [these fields](https://github.com/rust-lang/libc/blob/13d4a5da2eafd82d3ebb2acb729d8b8c9148fb1f/src/unix/linux_like/mod.rs#L97) are outdated. I'm not sure if we should rename them, since they are in public API. I simply skip `struct sched_param` from the test now. Here's the diff between musl 1.1.23 and 1.1.24 ``` diff --git a/include/sched.h b/include/sched.h index 05d40b1e..7e470d3a 100644 --- a/include/sched.h +++ b/include/sched.h @@ -18,10 +18,12 @@ extern "C" { struct sched_param { int sched_priority; - int sched_ss_low_priority; - struct timespec sched_ss_repl_period; - struct timespec sched_ss_init_budget; - int sched_ss_max_repl; + int __reserved1; + struct { + time_t __reserved1; + long __reserved2; + } __reserved2[2]; + int __reserved3; }; ```
IIUC this is blocked by #1588 , right? |
Yes
|
Upgrade to musl 1.1.24 in CI Required by #1577 Note that in musl 1.1.24, `struct sched_param` from `sched.h` has changed and some fields became reserved. So [these fields](https://github.com/rust-lang/libc/blob/13d4a5da2eafd82d3ebb2acb729d8b8c9148fb1f/src/unix/linux_like/mod.rs#L97) are outdated. I'm not sure if we should rename them, since they are in public API. I simply skip `struct sched_param` from the test now. Here's the diff between musl 1.1.23 and 1.1.24 ``` diff --git a/include/sched.h b/include/sched.h index 05d40b1e..7e470d3a 100644 --- a/include/sched.h +++ b/include/sched.h @@ -18,10 +18,12 @@ extern "C" { struct sched_param { int sched_priority; - int sched_ss_low_priority; - struct timespec sched_ss_repl_period; - struct timespec sched_ss_init_budget; - int sched_ss_max_repl; + int __reserved1; + struct { + time_t __reserved1; + long __reserved2; + } __reserved2[2]; + int __reserved3; }; ```
836d711
to
d211ebf
Compare
Rebased |
Thanks! @bors: r+ |
📌 Commit d211ebf has been approved by |
Provide SYS_statx for more target_arch/target_env Fixes #1545 The syscall `statx` is provided by Linux Kernel, so it should be available on any `target_env`/`target_arch`, not only some arch on `gnu`. Syscall ids are got from [this commit of musl](http://git.etalabs.net/cgit/musl/commit/?id=9864f60e929100e253fc813bd4105d6dd7652787), except for hexagon, which is got from Linux Kernel (`make O=build ARCH=hexagon headers`). **Not tested yet**
☀️ Test successful - checks-cirrus-freebsd-10, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, status-azure |
Try statx for all linux-gnu target. After rust-lang/libc#1577, which is contained in `libc` 0.2.66, provides `SYS_statx` for all Linux platform, so we can try to use `statx` for ~all Linux target~ all linux-gnu targets. Unfortunately, `struct statx` and `fn statx` is not a part of public interface of musl (currently), ~we still need to invoke it through `syscall`~ we does **not** support statx for musl or other libc impls currently. Previous PR: rust-lang#65094 cc @alexcrichton
Fixes #1545
The syscall
statx
is provided by Linux Kernel, so it should be available on anytarget_env
/target_arch
, not only some arch ongnu
.Syscall ids are got from this commit of musl, except for hexagon, which is got from Linux Kernel (
make O=build ARCH=hexagon headers
).Not tested yet