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
docs: update Windows root cause with specific filegroup pattern issue
After downloading and analyzing the Windows rustc distribution, discovered that
wasm-component-ld.exe exists but is missing from rules_rust's rustc_lib
filegroup patterns in repository_utils.bzl.
Key findings:
- Tool exists: rustc/lib/rustlib/x86_64-pc-windows-msvc/bin/wasm-component-ld.exe (5.1MB)
- Only rust-lld.exe and gcc-ld/* are declared in filegroup patterns
- wasm-component-ld.exe and rust-objcopy.exe are excluded from sandbox
- This prevents rustc from finding the linker during builds
Filed issue: avrabe/rules_rust#8
The fix is simple: add wasm-component-ld{binary_ext} to the filegroup pattern.
When Bazel creates the sandbox, it only copies files declared in filegroups. Since `wasm-component-ld.exe` is missing from the pattern, it's excluded from the sandbox, causing rustc's linker lookup to fail.
50
+
51
+
This is a **rules_rust filegroup pattern issue**, not a Rust toolchain issue.
40
52
41
53
### What We Fixed
42
54
@@ -101,16 +113,32 @@ Track these Rust issues:
101
113
102
114
This will be resolved when:
103
115
1.~~Rust officially distributes `wasm-component-ld.exe` with Windows rustc~~ ✅ Already done!
104
-
2.**rules_rust exposes the rustlib directory properly on Windows** (file issue with bazelbuild/rules_rust)
105
-
3. Or a workaround is implemented to explicitly pass the full path to the linker
116
+
2.**rules_rust adds wasm-component-ld to rustc_lib filegroup patterns** ← **The Fix**
117
+
118
+
### The Required Fix
119
+
120
+
In `rust/private/repository_utils.bzl`, add to the `rustc_lib` filegroup:
**For production use**: Document that Windows Rust wasm32-wasip2 support is experimental/unsupported until the Rust ecosystem provides the required tooling.
182
+
**For production use**: Document that Windows Rust wasm32-wasip2 support is blocked by upstream rules_rust filegroup patterns. All other Windows toolchains work correctly.
155
183
156
-
**For contributors**: All Windows compatibility work is complete on the rules_wasm_component side. The blocker is upstream in Rust's Windows distribution.
184
+
**For contributors**: All Windows compatibility work is complete on the rules_wasm_component side. The blocker is a missing filegroup pattern in rules_rust (issue filed: https://github.com/avrabe/rules_rust/issues/8).
157
185
158
-
**For users**: Use Linux or macOS for Rust WASM component development, or use wasm32-wasip1 (Preview 1) on Windows as a temporary workaround.
186
+
**For users**: Use Linux or macOS for Rust WASM component development, or use wasm32-wasip1 (Preview 1) on Windows as a temporary workaround. Once rules_rust #8 is fixed, Windows wasm32-wasip2 will work without any changes to rules_wasm_component.
0 commit comments