bytecodealliance / bytecodealliance/wit-bindgen
No longer able to generate bindings in submodule
- Vorherrschende Sprache
- Rust
- Sterne
- 1.5k
- Forks
- 288
- Ø Merge
- 6 Std. 32 Min.
- Gemergte PRs (30 T.)
- 19
Beschreibung
The following works in the latest release but not on main:
```wit
package my-ns:my-package;
interface my-interface {
my-func: func();
}
world my-world {
import my-interface;
export my-interface;
}
```
```rust
mod bindings {
wit_bindgen::generate!({
path: "wit",
});
}
use bindings::exports::my_ns::my_package::my_interface::Guest;
bindings::export!(Impl);
struct Impl;
impl Guest for Impl {
fn my_func() {}
}
```
On the main, the following error shows:
```
error[E0433]: failed to resolve: could not find `export` in the crate root
--> src/lib.rs:3:5
|
3 | / wit_bindgen::generate!({
4 | | path: "wit",
5 | | });
| |______^ could not find `export` in the crate root
...
10 | bindings::export!(Impl);
| ----------------------- in this macro invocation
```
Seems we're now assuming something lives at the crate root which we did not assume before.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, den Fehler anhand der WIT- und Rust-Snippets zu reproduzieren, mit Fokus auf src/lib.rs und die Einstiegspunkte wit_bindgen::generate! und bindings::export!. Untersuche den generierten Binding-Pfad und überprüfe, dass das Submodul-Beispiel auf main wie im letzten Release kompiliert, ohne den Exportfehler am Crate-Root.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, wasm
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100