Skip to content

Commit a243bbe

Browse files
committed
fix: revert wit_deps_check to use run_shell for output redirection
Fix analysis failure in wit_deps_check rule caused by using unsupported stdout parameter in ctx.actions.run(). The stdout parameter is not supported in ctx.actions.run(), so revert to using ctx.actions.run_shell() for output redirection. This resolves build failures in: - //test/integration:validate_consumer_deps - //test_wit_deps/consumer:check_deps The run_shell approach is appropriate here since it's a simple tool invocation with output redirection, which is a legitimate shell use case.
1 parent 061b791 commit a243bbe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

wit/wit_deps_check.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ def _wit_deps_check_impl(ctx):
2222
# Run dependency analysis
2323
output_file = ctx.actions.declare_file(ctx.label.name + "_analysis.json")
2424

25-
# Run dependency analysis using ctx.actions.run instead of shell
26-
ctx.actions.run(
27-
executable = ctx.executable._wit_dependency_analyzer,
28-
arguments = [config_file.path],
25+
# Run dependency analysis using ctx.actions.run_shell for output redirection
26+
ctx.actions.run_shell(
27+
command = "$1 $2 > $3",
28+
arguments = [ctx.executable._wit_dependency_analyzer.path, config_file.path, output_file.path],
2929
inputs = [config_file, ctx.file.wit_file],
3030
outputs = [output_file],
31-
stdout = output_file,
31+
tools = [ctx.executable._wit_dependency_analyzer],
3232
mnemonic = "CheckWitDependencies",
3333
progress_message = "Checking WIT dependencies in %s" % ctx.file.wit_file.short_path,
3434
)

0 commit comments

Comments
 (0)