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 Nov 4, 2020
1 parent 2485bbb commit 4aa133a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
5 changes: 0 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ build --nocheck_visibility
# here forever.
build --define=RULES_SWIFT_BUILD_DUMMY_WORKER=1
build --strategy=SwiftCompile=local

# Disable this for now because apple_support currently relies on a workaround
# that needs to be able to pass a sequence of strings to actions.run_shell's
# 'command'.
build --incompatible_run_shell_command_string=false
12 changes: 4 additions & 8 deletions apple/internal/codesigning_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -516,14 +516,10 @@ def _sign_binary_action(ctx, input_binary, output_binary):
ctx,
inputs = [input_binary],
outputs = [output_binary],
command = [
"/bin/bash",
"-c",
"cp {input_binary} {output_binary}".format(
input_binary = input_binary.path,
output_binary = output_binary.path,
) + "\n" + signing_commands,
],
command = "cp {input_binary} {output_binary}".format(
input_binary = input_binary.path,
output_binary = output_binary.path,
) + "\n" + signing_commands,
mnemonic = "SignBinary",
execution_requirements = {
# Added so that the output of this action is not cached remotely, in case multiple
Expand Down
14 changes: 0 additions & 14 deletions apple/internal/utils/legacy_actions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ load(
"@build_bazel_rules_apple//apple/internal:platform_support.bzl",
"platform_support",
)
load(
"@bazel_skylib//lib:types.bzl",
"types",
)

def _add_dicts(*dictionaries):
"""Adds a list of dictionaries into a single dictionary."""
Expand Down Expand Up @@ -144,16 +140,6 @@ def _run_shell(
**kwargs: Arguments to be passed into ctx.actions.run_shell.
"""

# 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

# TODO(b/161370390): Eliminate need to make actions and platform_prerequisites optional when all
# calls to this method with a ctx argument are eliminated.
if not actions:
Expand Down

0 comments on commit 4aa133a

Please sign in to comment.