Update statx constants and types (Linux 6.8-6.14)#4401
Update statx constants and types (Linux 6.8-6.14)#4401rusty-snake wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
No idea why CI is failing. |
cb2a8ae to
229b7af
Compare
tgross35
left a comment
There was a problem hiding this comment.
LGTM as long as CI passes
1cb7f9b to
82fecbd
Compare
tgross35
left a comment
There was a problem hiding this comment.
Looks like some of this may not be available on arm32 Android, can you check this against the bionic headers? https://cs.android.com/android/platform/superproject/main, cc @maurer
|
I'm not familiar with bionic/their source tree or how to check. Do we know it works on non-arm32 android (e.g. armv8)? Because the CI skipping it's sometimes hard to tell whether it broken because of architecture or libc or both. I can |
There was a problem hiding this comment.
tl;dr:
- Remove support for
statx_dio_read_alignon Android; it won't arrive for at least a year. - Bump the NDK version to 28, and the rest of your stuff should work.
This is going to be compatible from the Android PoV - only STATX_DIO_READ_ALIGN is not yet present in bionic, and that's likely because the latest kernel version Android uses is 6.12 right now.
The reason you're getting an error from offsetof for stx_subvol is not because of the architecture, it's because NDK 27 (current LTS NDK) does not yet have that field. NDK 28 (stable and released, but not LTS) does.
Probably (subject to @tgross35 agreement) we should switch to NDK 28b in this PR.
Support in bionic for statx_dio_read_align is probably more than a year out, because Android needs to release a kernel >= 6.14, and then needs to have an NDK release. I don't anticipate any differences between our support and anyone else's, but no Android device will exist that supports it for at least a year, so it'd be a mistake to try to use it. I'd suggest configuring out statx_dio_read_align both field and constant.
| pub const STATX_MNT_ID_UNIQUE: c_uint = 0x4000; | ||
| pub const STATX_SUBVOL: c_uint = 0x_0000_8000; | ||
| pub const STATX_WRITE_ATOMIC: c_uint = 0x_0001_0000; | ||
| pub const STATX_DIO_READ_ALIGN: c_uint = 0x_0002_0000; |
There was a problem hiding this comment.
This constant is not yet present in bionic, likely because it was introduced to Linux in 6.14, and the latest Android kernel is 6.12.
I have no objections to bumping the version. Is there any chance you, or anyone else from the android team / more familiar, might be able to do it in a separate PR? We have been having some pretty consistent intermittent failures (#4297), it would be good for somebody more familiar with the platform to double check that the way we are setting up and testing actually makes sense. |
|
@rusty-snake would you be able to rebase this? If there are still Android CI failures, it would be fine to move the constants to |
Head branch was pushed to by a user without write access
82fecbd to
0008319
Compare
This comment has been minimized.
This comment has been minimized.
| // linux 5.17 min | ||
| "PR_SET_VMA" | "PR_SET_VMA_ANON_NAME" => true, | ||
|
|
||
| // present in recent kernels only | ||
| "PR_SCHED_CORE" | "PR_SCHED_CORE_CREATE" | "PR_SCHED_CORE_GET" | "PR_SCHED_CORE_MAX" | "PR_SCHED_CORE_SCOPE_PROCESS_GROUP" | "PR_SCHED_CORE_SCOPE_THREAD" | "PR_SCHED_CORE_SCOPE_THREAD_GROUP" | "PR_SCHED_CORE_SHARE_FROM" | "PR_SCHED_CORE_SHARE_TO" => true, | ||
|
|
||
| // present in recent kernels only >= 5.13 | ||
| "PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true, | ||
| // present in recent kernels only >= 5.19 | ||
| "PR_SME_SET_VL" | "PR_SME_GET_VL" | "PR_SME_VL_LEN_MAX" | "PR_SME_SET_VL_INHERIT" | "PR_SME_SET_VL_ONE_EXEC" => true, | ||
|
|
||
| // Added in Linux 5.14 | ||
| "FUTEX_LOCK_PI2" => true, | ||
|
|
||
| // Added in linux 6.1 | ||
| "STATX_DIOALIGN" | ||
| | "CAN_RAW_XL_FRAMES" | ||
| | "CANXL_HDR_SIZE" | ||
| | "CANXL_MAX_DLC" | ||
| | "CANXL_MAX_DLC_MASK" | ||
| | "CANXL_MAX_DLEN" | ||
| | "CANXL_MAX_MTU" | ||
| | "CANXL_MIN_DLC" | ||
| | "CANXL_MIN_DLEN" | ||
| | "CANXL_MIN_MTU" | ||
| | "CANXL_MTU" | ||
| | "CANXL_PRIO_BITS" | ||
| | "CANXL_PRIO_MASK" | ||
| | "CANXL_SEC" | ||
| | "CANXL_XLF" | ||
| => true, | ||
|
|
||
| "STATX_MNT_ID_UNIQUE" // Added in Linux 6.8 | ||
| | "STATX_SUBVOL" // Added in Linux 6.10 | ||
| | "STATX_WRITE_ATOMIC" // Added in Linux 6.11 | ||
| | "STATX_ATTR_WRITE_ATOMIC" // Added in Linux 6.11 | ||
| | "STATX_DIO_READ_ALIGN" // Added in Linux 6.14 | ||
| => true, | ||
|
|
||
| // FIXME(linux): Parts of netfilter/nfnetlink*.h require more recent kernel headers: | ||
| | "RTNLGRP_MCTP_IFADDR" // linux v5.17+ | ||
| | "RTNLGRP_TUNNEL" // linux v5.18+ | ||
| | "RTNLGRP_STATS" // linux v5.18+ | ||
| => true, |
There was a problem hiding this comment.
Did this come through the rebase? Most of these constants are unrelated to what is added here
0008319 to
316f859
Compare
This comment has been minimized.
This comment has been minimized.
|
Reminder, once the PR becomes ready for a review, use |
dfb35a9 to
2057d65
Compare
|
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 ready |
| STATX_ATTR_WRITE_ATOMIC | ||
| STATX_BASIC_STATS | ||
| STATX_BLOCKS | ||
| STATX_BTIME | ||
| STATX_CTIME | ||
| STATX_DIOALIGN | ||
| STATX_DIO_READ_ALIGN | ||
| STATX_GID | ||
| STATX_INO | ||
| STATX_MNT_ID | ||
| STATX_MNT_ID_UNIQUE | ||
| STATX_MODE | ||
| STATX_MTIME | ||
| STATX_NLINK | ||
| STATX_SIZE | ||
| STATX_SUBVOL | ||
| STATX_TYPE | ||
| STATX_UID | ||
| STATX_WRITE_ATOMIC |
There was a problem hiding this comment.
These are added to linux-gnu, but should be possible to have in linux-like
|
@rustbot author CI still isn't passing here, you'll also need to skip the struct fields with |
| "PR_SME_VL_LEN_MAX" | "PR_SME_SET_VL_INHERIT" | "PR_SME_SET_VL_ONE_EXEC" if gnu => true, | ||
|
|
||
| "STATX_DIOALIGN" // Added in linux 6.1 | ||
| | "STATX_MNT_ID_UNIQUE" // Added in Linux 6.8 | ||
| | "STATX_SUBVOL" // Added in Linux 6.10 | ||
| | "STATX_WRITE_ATOMIC" // Added in Linux 6.11 | ||
| | "STATX_ATTR_WRITE_ATOMIC" // Added in Linux 6.11 | ||
| | "STATX_DIO_READ_ALIGN" // Added in Linux 6.14 | ||
| => true, |
There was a problem hiding this comment.
Add if gnu and something like // FIXME(ci): pinned glibc tests so we can clean these up once CI is resolved
Description
This PR updates statx constants and types for features added in Linux 6.8 to 6.14.
Sources
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated