You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve export! macro visibility issue in rust_wasm_component_bindgen
- Add --pub-export-macro flag to wit_bindgen.bzl to make export macro public
- Simplify wrapper generation in rust_wasm_component_bindgen.bzl
- Add comprehensive test suite for export macro visibility
- Update CI workflow to use actions/cache@v4
The export! macro is now accessible from separate crates, allowing proper
component implementation as reported in the GitHub issue.
The `export!` macro generated by wit-bindgen is marked as `pub(crate)`, making it inaccessible when the bindings are compiled as a separate crate in `rust_wasm_component_bindgen`.
6
+
7
+
## Root Cause
8
+
9
+
wit-bindgen generates:
10
+
```rust
11
+
pub(crate) use __export_impl as export;
12
+
```
13
+
14
+
This is only visible within the crate, but `rust_wasm_component_bindgen` creates the bindings as a separate crate.
15
+
16
+
## Workaround
17
+
18
+
Until wit-bindgen is updated to generate public export macros, use the standard `rust_wasm_component` rule instead, which includes the bindings directly in your crate:
0 commit comments