Skip to content

Fix build on alpine with statx change #13562

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

Merged
merged 1 commit into from
Jun 9, 2025
Merged

Conversation

Earlopain
Copy link
Contributor

Since 18a036a (#13474) building on alpine fails because usage of __u32, which is not portable.

file.c: In function 'rb_stat_new':
file.c:546:33: error: '_u32' undeclared (first use in this function)
# define CP_32(m) .stx
## m = (_u32)st->st ## m

Since ruby@18a036a building on alpine fails
because usage of `__u32`, which is not portable.

> file.c: In function 'rb_stat_new':
> file.c:546:33: error: '__u32' undeclared (first use in this function)
>   # define CP_32(m) .stx_ ## m = (__u32)st->st_ ## m
@nobu
Copy link
Member

nobu commented Jun 9, 2025

How struct statx is define on Alpine?

@nobu nobu enabled auto-merge (rebase) June 9, 2025 12:07
@Earlopain
Copy link
Contributor Author

It looks identical, discarding the padding at the end https://git.musl-libc.org/cgit/musl/tree/src/stat/fstatat.c?h=v1.2.5#n10

@nobu nobu merged commit 96fdaf2 into ruby:master Jun 9, 2025
83 checks passed
@nobu
Copy link
Member

nobu commented Jun 9, 2025

The man page statx on Alpine Linux 3.20.3 uses __u16, __u32 and __u64.
Which should fix this mismatch, man or musl-libc?

@Earlopain
Copy link
Contributor Author

If I check https://pkgs.alpinelinux.org/package/v3.22/main/x86/man-pages, kernel.org is provided as the url so you're probably looking at the same docs like usual.

I guess it is fine the way it is, but I do not have much knowledge on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants