From 4aa133a7ccb640705c73acc46450c5f4e6df1e76 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 4 Nov 2020 10:39:32 -0800 Subject: [PATCH] Remove passing lists of args to genrule This is required for this migration https://github.com/bazelbuild/bazel/issues/5903 --- .bazelrc | 5 ----- apple/internal/codesigning_support.bzl | 12 ++++-------- apple/internal/utils/legacy_actions.bzl | 14 -------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.bazelrc b/.bazelrc index ded509aa9b..546137f45a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/apple/internal/codesigning_support.bzl b/apple/internal/codesigning_support.bzl index 4eecb0b403..a85d62a615 100644 --- a/apple/internal/codesigning_support.bzl +++ b/apple/internal/codesigning_support.bzl @@ -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 diff --git a/apple/internal/utils/legacy_actions.bzl b/apple/internal/utils/legacy_actions.bzl index 6e2f761273..d74498f4a5 100644 --- a/apple/internal/utils/legacy_actions.bzl +++ b/apple/internal/utils/legacy_actions.bzl @@ -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.""" @@ -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: