bytecodealliance / bytecodealliance/wit-bindgen

No longer able to generate bindings in submodule

Open
#973 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.5k
Forks
286
Avg merge
6h 32m
Merged PRs (30d)
19

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.