Skip to content

Commit 1ea2644

Browse files
committed
fix: correct WIT file reference in wac_remote_compose example
Fix analysis failure in wac_remote_compose caused by incorrect WIT file reference. The wit attribute in rust_wasm_component_bindgen should reference a wit_library target, not a direct file path. Changes: - Add proper wit_library target for frontend interfaces - Update rust_wasm_component_bindgen to use wit_library reference - Fix target name to match Rust binding expectations (frontend_bindings) - Update local_components reference in wac_remote_compose This resolves the build error: "source file is misplaced here (expected no files)"
1 parent a243bbe commit 1ea2644

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

examples/wac_remote_compose/BUILD.bazel

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22

33
load("@rules_wasm_component//wac:defs.bzl", "wac_remote_compose")
44
load("@rules_wasm_component//rust:defs.bzl", "rust_wasm_component_bindgen")
5+
load("@rules_wasm_component//wit:defs.bzl", "wit_library")
56

67
package(default_visibility = ["//visibility:public"])
78

9+
# Define WIT interfaces
10+
wit_library(
11+
name = "frontend_interfaces",
12+
package_name = "frontend:app",
13+
srcs = ["wit/frontend.wit"],
14+
world = "frontend",
15+
)
16+
817
# Local component that will be composed with remote components
918
rust_wasm_component_bindgen(
10-
name = "local_frontend",
19+
name = "frontend",
1120
srcs = ["src/lib.rs"],
12-
wit = "wit/frontend.wit",
21+
wit = ":frontend_interfaces",
1322
)
1423

1524
# Compose local component with remote components from registries
@@ -29,7 +38,7 @@ wac_remote_compose(
2938
export frontend as main;
3039
""",
3140
local_components = {
32-
"frontend": ":local_frontend",
41+
"frontend": ":frontend",
3342
},
3443
remote_components = {
3544
# Example remote components (these would need to exist in registries)

0 commit comments

Comments
 (0)