Skip to content

Conversation

heiher
Copy link
Contributor

@heiher heiher commented Sep 1, 2025

libc already defines constants like STATX_TYPE for musl 1.2.3+ 1, so statx_flags is unnecessary in this environment.

Fixes #1502

Footnotes

  1. https://docs.rs/libc/latest/src/libc/unix/linux_like/mod.rs.html#1679

@heiher
Copy link
Contributor Author

heiher commented Sep 1, 2025

Alright, constants like STATX_TYPE are only available in musl starting from v1.2.3 1. Currently, only the LoongArch target or the OHOS environment 2 uses this version.

Footnotes

  1. https://github.com/rust-lang/libc/blob/84e26e6b166a6634d679fbf44e957102846b8a03/src/unix/linux_like/mod.rs#L1673

  2. https://github.com/rust-lang/libc/blob/84e26e6b166a6634d679fbf44e957102846b8a03/build.rs#L95-L101

`libc` already defines constants like `STATX_TYPE` for `musl 1.2.3+` [^1], so
`statx_flags` is unnecessary in this environment.

[^1]: https://docs.rs/libc/latest/src/libc/unix/linux_like/mod.rs.html#1679

Fixes #1502
@heiher heiher force-pushed the no-statx-flags-musl branch from 9d874d2 to d7c1172 Compare September 1, 2025 11:22
@heiher heiher changed the title Do not define statx_flags for target_env = "musl" Do not define statx_flags for LoongArch64 with musl Sep 1, 2025
@sunfishcode
Copy link
Member

Thanks!

@sunfishcode sunfishcode merged commit 3d82541 into bytecodealliance:main Sep 1, 2025
48 of 51 checks passed
@WhyNotHugo
Copy link

Thanks!

Could you tag a new release with this? The issue is blocking downstream packaging of ty.

@sunfishcode
Copy link
Member

This is now released in rustix 1.1.1.

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.

Ambiguous (glob) import on loongarch64

3 participants