@@ -31,6 +31,8 @@ declare_buf_toolchains(
3131"""
3232
3333_TOOLCHAIN_FILE = """
34+ load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
35+
3436def _buf_toolchain_impl(ctx):
3537 toolchain_info = platform_common.ToolchainInfo(
3638 cli = ctx.executable.cli,
@@ -52,13 +54,15 @@ _buf_toolchain = rule(
5254
5355def declare_buf_toolchains(os, cpu, rules_buf_repo_name):
5456 for cmd in ["buf", "protoc-gen-buf-lint", "protoc-gen-buf-breaking"]:
55- cmd_suffix = ""
5657 if os == "windows":
57- cmd_suffix = ".exe"
58+ native_binary(
59+ name = cmd,
60+ src = ":" + cmd + ".exe",
61+ )
5862 toolchain_impl = cmd + "_toolchain_impl"
5963 _buf_toolchain(
6064 name = toolchain_impl,
61- cli = str(Label("//:"+ cmd + cmd_suffix )),
65+ cli = str(Label("//:"+ cmd)),
6266 )
6367 native.toolchain(
6468 name = cmd + "_toolchain",
@@ -138,6 +142,8 @@ def _buf_download_releases_impl(ctx):
138142 for sha_line in sha_list :
139143 if sha_line .strip (" " ).endswith (".tar.gz" ):
140144 continue
145+ if sha_line .strip (" " ).endswith (".zip" ):
146+ continue
141147 (sum , _ , bin ) = sha_line .partition (" " )
142148 bin = bin .strip (" " )
143149 lower_case_bin = bin .lower ()
0 commit comments