Skip to content

Commit 36f8f6e

Browse files
committed
fix(windows): use .exe extension for all WASM tool binaries on Windows
1 parent 5a2e21b commit 36f8f6e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

toolchains/wasm_toolchain.bzl

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,8 @@ toolchain(
647647
"""
648648
else:
649649
# For download strategy, use local downloaded files
650+
# Windows binaries need .exe extension
651+
exe_suffix = ".exe" if platform == "windows_amd64" else ""
650652
build_content = """
651653
load("@rules_wasm_component//toolchains:wasm_toolchain.bzl", "wasm_tools_toolchain")
652654
@@ -655,31 +657,31 @@ package(default_visibility = ["//visibility:public"])
655657
# File targets for executables
656658
filegroup(
657659
name = "wasm_tools_binary",
658-
srcs = ["wasm-tools"],
660+
srcs = ["{wasm_tools_bin}"],
659661
visibility = ["//visibility:public"],
660662
)
661663
662664
filegroup(
663665
name = "wac_binary",
664-
srcs = ["wac"],
666+
srcs = ["{wac_bin}"],
665667
visibility = ["//visibility:public"],
666668
)
667669
668670
filegroup(
669671
name = "wit_bindgen_binary",
670-
srcs = ["wit-bindgen"],
672+
srcs = ["{wit_bindgen_bin}"],
671673
visibility = ["//visibility:public"],
672674
)
673675
674676
filegroup(
675677
name = "wrpc_binary",
676-
srcs = ["wrpc"],
678+
srcs = ["{wrpc_bin}"],
677679
visibility = ["//visibility:public"],
678680
)
679681
680682
filegroup(
681683
name = "wasmsign2_binary",
682-
srcs = ["wasmsign2"],
684+
srcs = ["{wasmsign2_bin}"],
683685
visibility = ["//visibility:public"],
684686
)
685687
@@ -706,7 +708,13 @@ toolchain(
706708
# Use the direct target name for explicit, clear toolchain registration
707709
# Note: Other aliases removed to prevent dependency cycles
708710
# Use the _binary targets directly: wasm_tools_binary, wac_binary, wit_bindgen_binary
709-
"""
711+
""".format(
712+
wasm_tools_bin = "wasm-tools{}".format(exe_suffix),
713+
wac_bin = "wac{}".format(exe_suffix),
714+
wit_bindgen_bin = "wit-bindgen{}".format(exe_suffix),
715+
wrpc_bin = "wrpc{}".format(exe_suffix),
716+
wasmsign2_bin = "wasmsign2{}".format(exe_suffix),
717+
)
710718

711719
# Create main BUILD file with strategy-specific content
712720
repository_ctx.file("BUILD.bazel", build_content)

0 commit comments

Comments
 (0)