Commit 8df9edb
committed
fix(windows): detect Windows host in transition and set linker to wasm-component-ld.exe
The previous select() approach didn't work because it evaluated in the target
platform context (wasm32-wasip2) rather than the execution platform context
(Windows). Transitions have access to both platforms through the settings
parameter, so we can detect the Windows host platform and conditionally set
the linker in the transition itself.
This approach:
- Reads the host_platform from transition settings
- Detects 'windows' in the platform string
- Adds '-C linker=wasm-component-ld.exe' to extra_rustc_flags on Windows
- Works because transitions can modify build configuration based on exec platform
The transition now explicitly handles the @rules_rust//:extra_rustc_flags
output, preserving existing flags and adding Windows-specific ones when needed.1 parent b6b1b15 commit 8df9edb
2 files changed
+19
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | 314 | | |
324 | 315 | | |
325 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
| 35 | + | |
23 | 36 | | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
27 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
28 | 44 | | |
29 | 45 | | |
| 46 | + | |
30 | 47 | | |
31 | 48 | | |
32 | 49 | | |
| |||
0 commit comments