Skip to content

Commit ac2d9aa

Browse files
committed
fix: extract executable from wasm tools component target
Resolve BCR build failure where wasm_tools_component was being passed as Target instead of FilesToRunProvider. The toolchain returns a Target but ctx.actions.run() requires the executable to be extracted. Error: parameter 'executable' got value of type 'Target', want 'File, string, or FilesToRunProvider'
1 parent 6865ad0 commit ac2d9aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/bazel_helpers/wasm_tools_actions.bzl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ def wasm_tools_action(ctx, operation, **kwargs):
2626
# Get the WASM tools component from toolchain
2727
wasm_tools_toolchain = ctx.toolchains["@rules_wasm_component//toolchains:wasm_tools_component_toolchain_type"]
2828
wasm_tools_info = wasm_tools_toolchain.wasm_tools_info
29-
wasm_tools_component = wasm_tools_info.wasm_tools_component
29+
wasm_tools_component_target = wasm_tools_info.wasm_tools_component
3030

31-
if not wasm_tools_component:
31+
if not wasm_tools_component_target:
3232
fail("WASM Tools Integration Component not available in toolchain")
33+
34+
# Extract executable from target
35+
wasm_tools_component = wasm_tools_component_target.files_to_run
3336

3437
if operation == "validate":
3538
return _validate_action(ctx, wasm_tools_component, **kwargs)

0 commit comments

Comments
 (0)