bytecodealliance / bytecodealliance/wit-bindgen

Allow user to override component type custom section name (or else generate a random name)

Aperta
#788 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
1.5k
Fork
288
Merge medio
6h 32m
PR unite (30g)
19

Descrizione

Currently, `wit-bindgen` generates the custom section name using the format "component-type:{world_name}". This can lead to issues when linking separately-compiled code together, each containing code built from `wit-bindgen` code using the same world, because `wasm-ld` will concatenate identically-named custom sections together, resulting in something `wit-component` can't parse.

This came up while adding WASI Preview 2 support to `wasi-libc` based on `wit-bindgen`-generated C bindings and then later linking libc.a into a program that also uses `wit-bindgen`-generated bindings targeting the same world. Ideally, `wasi-libc` would use a custom section name with a big random name that's unlikely to conflict with application code.

Alternatively, `wit-bindgen` could just generate a big random name by default.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by tracing where wit-bindgen generates the component-type:{world_name} custom section name. Read how wasm-ld concatenates identically named sections and how wit-component parses them. Done means separately compiled bindings can be linked without producing an unparseable custom section, with either a user-controlled name or a sufficiently unique default.

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

Valutazione

Stack tecnologico
rust, wasm
Ambito
build-system, devtools
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.