Skip to content

Commit

Permalink
Remove passing lists of args to genrule
Browse files Browse the repository at this point in the history
This is required for this migration bazelbuild/bazel#5903
  • Loading branch information
keith committed Oct 30, 2020
1 parent 2583fa0 commit 066a737
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions lib/apple_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -446,16 +446,6 @@ def _run_shell(
actions = actions,
)

# TODO(b/77637734) remove "workaround" once the bazel issue is resolved.
# Bazel doesn't always get the shell right for a single string `commands`;
# so work around that case by faking it as a list of strings that forces
# the shell correctly.
command = kwargs.get("command")
if command and types.is_string(command):
processed_args = dict(kwargs)
processed_args["command"] = ["/bin/sh", "-c", command]
kwargs = processed_args

if not actions:
actions = ctx.actions

Expand Down
2 changes: 1 addition & 1 deletion rules/apple_genrule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _apple_genrule_impl(ctx):
inputs = resolved_srcs.to_list() + resolved_inputs,
outputs = files_to_build.to_list(),
env = ctx.configuration.default_shell_env,
command = argv,
command = " ".join(argv),
progress_message = "%s %s" % (message, ctx.label),
mnemonic = "Genrule",
input_manifests = runfiles_manifests,
Expand Down
4 changes: 2 additions & 2 deletions test/apple_support_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ def _apple_support_test_impl(ctx):
ctx,
outputs = [run_shell_output],
tools = [test_tool],
command = ["/bin/bash", "-c", "{tool} {output}".format(
command = "{tool} {output}".format(
output = run_shell_output.path,
tool = test_tool.path,
)],
),
)

test_files = [
Expand Down

0 comments on commit 066a737

Please sign in to comment.