bytecodealliance / bytecodealliance/rustix

Broken builds on loongarch64 with libc 0.2.175

Aperta
#1,496 10 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2.1k
Fork
294
Merge medio
6g 22h
PR unite (30g)
4

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia leggendo rustix/src/fs/statx.rs intorno all’uso di STATX_TYPE e rustix/src/backend/libc/c.rs, quindi confronta la logica di rilevamento del target nel build.rs di libc. Riproduci la build di loongarch64 con libc 0.2.175 e verifica che l’ambiguità sia risolta senza compromettere gli altri target.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
build-system, operating-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.