Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove passing lists of args to genrule #975

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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