Skip to content

Commit 0514fb1

Browse files
committed
feat: add per-tool commit parameters to wasm_toolchain extension
Extend the wasm_toolchain module extension to support individual commit specifications for each tool (wasm-tools, wac, wit-bindgen). This enables fine-grained control over tool versions when using build or hybrid strategies. Changes: - Add wasm_tools_commit, wac_commit, wit_bindgen_commit attributes - Update git_commit documentation to clarify it's a fallback - Add "hybrid" strategy support to extension tag class - Pass new parameters through to wasm_toolchain_repository This allows users to specify different commits for different tools, supporting scenarios like testing a forked wit-bindgen while using stable versions of other tools.
1 parent 9bb02b1 commit 0514fb1

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

wasm/extensions.bzl

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def _wasm_toolchain_extension_impl(module_ctx):
2020
strategy = registration.strategy,
2121
version = registration.version,
2222
git_commit = registration.git_commit,
23+
wasm_tools_commit = registration.wasm_tools_commit,
24+
wac_commit = registration.wac_commit,
25+
wit_bindgen_commit = registration.wit_bindgen_commit,
2326
wasm_tools_url = registration.wasm_tools_url,
2427
wac_url = registration.wac_url,
2528
wit_bindgen_url = registration.wit_bindgen_url,
@@ -32,6 +35,9 @@ def _wasm_toolchain_extension_impl(module_ctx):
3235
strategy = "system",
3336
version = "1.235.0",
3437
git_commit = "main",
38+
wasm_tools_commit = "",
39+
wac_commit = "",
40+
wit_bindgen_commit = "",
3541
wasm_tools_url = "",
3642
wac_url = "",
3743
wit_bindgen_url = "",
@@ -48,18 +54,27 @@ wasm_toolchain = module_extension(
4854
default = "wasm_tools",
4955
),
5056
"strategy": attr.string(
51-
doc = "Tool acquisition strategy: 'system', 'download', or 'build'",
57+
doc = "Tool acquisition strategy: 'system', 'download', 'build', or 'hybrid'",
5258
default = "system",
53-
values = ["system", "download", "build"],
59+
values = ["system", "download", "build", "hybrid"],
5460
),
5561
"version": attr.string(
5662
doc = "Version to use (for download/build strategies)",
5763
default = "1.235.0",
5864
),
5965
"git_commit": attr.string(
60-
doc = "Git commit/tag to build from (for build strategy)",
66+
doc = "Git commit/tag to build from (for build strategy) - fallback for all tools",
6167
default = "main",
6268
),
69+
"wasm_tools_commit": attr.string(
70+
doc = "Git commit/tag for wasm-tools (overrides git_commit)",
71+
),
72+
"wac_commit": attr.string(
73+
doc = "Git commit/tag for wac (overrides git_commit)",
74+
),
75+
"wit_bindgen_commit": attr.string(
76+
doc = "Git commit/tag for wit-bindgen (overrides git_commit)",
77+
),
6378
"wasm_tools_url": attr.string(
6479
doc = "Custom download URL for wasm-tools (optional)",
6580
),

0 commit comments

Comments
 (0)