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 762e327 commit 910179d
Show file tree
Hide file tree
Showing 4 changed files with 7 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
10 changes: 0 additions & 10 deletions apple/internal/utils/legacy_actions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,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
7 changes: 3 additions & 4 deletions apple/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ def apple_rules_dependencies(ignore_version_differences = False):
_maybe(
http_archive,
name = "build_bazel_apple_support",
sha256 = "36d60bce680446ab534b141c47f2aef6b9c598267ef3450b7d74b9d81e1fd6bd",
urls = [
"https://github.com/bazelbuild/apple_support/releases/download/0.9.0/apple_support.0.9.0.tar.gz",
],
ignore_version_differences = ignore_version_differences,
sha256 = "c5f232e8fe0cfc375eecf93f2d31f45fb7cf6a5060270563b1ed5ffad6f65c26",
strip_prefix = "apple_support-b7047faee98aae74b76618d618beadc28cbdb10e",
url = "https://github.com/bazelbuild/apple_support/archive/b7047faee98aae74b76618d618beadc28cbdb10e.tar.gz",
)

_maybe(
Expand Down

0 comments on commit 910179d

Please sign in to comment.