bytecodealliance / bytecodealliance/rustix

Broken builds on loongarch64 with libc 0.2.175

Open
#1,496 10 comments 4 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.1k
Forks
294
Avg merge
4h 7m
Merged PRs (30d)
2

Description

There is a new failure on loongarch64 with the new release:

```text
error[E0659]: `STATX_TYPE` is ambiguous
--> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.0.8/src/fs/statx.rs:73:25
|
73 | const TYPE = c::STATX_TYPE;
| ^^^^^^^^^^ ambiguous name
|
= note: ambiguous because of multiple glob imports of a name in the same module
note: `STATX_TYPE` could refer to the constant imported here
--> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.0.8/src/backend/libc/c.rs:7:16
|
7 | pub(crate) use libc::*;
| ^^^^^^^
= help: consider adding an explicit import of `STATX_TYPE` to disambiguate
note: `STATX_TYPE` could also refer to the constant imported here
--> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.0.8/src/backend/libc/c.rs:512:16
|
512 | pub(crate) use statx_flags::*;
| ^^^^^^^^^^^^^^
= help: consider adding an explicit import of `STATX_TYPE` to disambiguate
```

(stumbled across this in CI)

I think rustix is assuming that `libc`'s musl version is stuck at a pre-1.2 version. This is a pretty safe assumption, but we have a config that enables 1.2+ API on targets that never supported anything less https://github.com/rust-lang/libc/blob/bbafd450b7b03f0a0248efbae99b563b04bdb10a/build.rs#L91-L97. loongarch is in that boat and the most recent release contained https://github.com/rust-lang/libc/pull/3976, hence this issue.

Unfortunately I don't really have a better suggestion that to use the same logic as our build script to decide whether or not you need the polyfills, or to replace the glob imports.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.