Skip to content

linux_like: Expose statx on all musl versions - #5448

Merged
tgross35 merged 3 commits into
rust-lang:mainfrom
Gelbpunkt:musl-statx-always
Aug 31, 2026
Merged

linux_like: Expose statx on all musl versions#5448
tgross35 merged 3 commits into
rust-lang:mainfrom
Gelbpunkt:musl-statx-always

Conversation

@Gelbpunkt

Copy link
Copy Markdown
Contributor

Exposing the constants and the method in itself is not a breaking change, users are responsible for knowing whether they can call the method without running into linker errors, just like on glibc.

Exposing the constants and the method in itself is not a breaking
change, users are responsible for knowing whether they can call the
method without running into linker errors, just like on glibc.
@tgross35

Copy link
Copy Markdown
Member

I think you'll need to update the test build.rs to skip these if old_musl, but the changes here LGTM assuming CI passes

@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

I'm slightly confused why this passes tests in CI...

@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

Ah: we unconditionally skip statx no matter the version...

@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

Found a few issues with statx on musl in the process of this, will enable the checks and fix them in this PR

@rustbot rustbot added the O-musl label Aug 30, 2026
musl uses different types for the statx fields than the Linux kernel
headers, most notably its own uint64_t which is an unsigned long rather
than an unsigned long long, so the __u64 definitions would be
incompatible from ctest's perspective.
With this, we now actually test e.g. statx in libc-test on newer musl
versions.
@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

For renameat2 testing, we'd have to disable linking the self contained musl, which in theory should work but it's a bit more involved on powerpc64. I'll leave that out of here and maybe look into it later

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 31, 2026

@tgross35 tgross35 left a comment

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.

@tgross35
tgross35 added this pull request to the merge queue Aug 31, 2026
Merged via the queue into rust-lang:main with commit bd63612 Aug 31, 2026
58 checks passed
@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

@rustbot label +stable-nominated

@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

oh nevermind, you already took care of that :)

tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
Exposing the constants and the method in itself is not a breaking
change, users are responsible for knowing whether they can call the
method without running into linker errors, just like on glibc.

(backport <rust-lang#5448>)
(cherry picked from commit 823b37f)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
musl uses different types for the statx fields than the Linux kernel
headers, most notably its own uint64_t which is an unsigned long rather
than an unsigned long long, so the __u64 definitions would be
incompatible from ctest's perspective.

(backport <rust-lang#5448>)
(cherry picked from commit d2b8ca1)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
With this, we now actually test e.g. statx in libc-test on newer musl
versions.

(backport <rust-lang#5448>)
(cherry picked from commit bd63612)
@tgross35 tgross35 mentioned this pull request Sep 4, 2026
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-linux O-linux-like O-musl O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants