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

Fix repository for compatibility with --incompatible_no_support_tools_in_action_inputs #156

Merged
merged 2 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion rules/private/copy_file_private.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def copy_cmd(ctx, src, dst):

def copy_bash(ctx, src, dst):
ctx.actions.run_shell(
inputs = [src],
tools = [src],
Copy link
Contributor

@laszlocsomor laszlocsomor May 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?
I believe we need target-config here, which I believe inputs is but tools isn't. Maybe I'm missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/116#24ea5562-55a0-41c4-b439-94a288884804

Found tool(s) 'bazel-out/host/bin/tests/run_binary/printargs' in inputs. A tool is an input with executable=True set. All tools should be passed using the 'tools' argument instead of 'inputs' in order to make their runfiles available to the action. This safety check will not be performed once the action is modified to take a 'tools' argument. To temporarily disable this check, set --incompatible_no_support_tools_in_action_inputs=false.

outputs = [dst],
command = "cp -f \"$1\" \"$2\"",
arguments = [src.path, dst.path],
Expand Down
5 changes: 3 additions & 2 deletions rules/run_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ load("//lib:dicts.bzl", "dicts")
def _impl(ctx):
tool_as_list = [ctx.attr.tool]
tool_inputs, tool_input_mfs = ctx.resolve_tools(tools = tool_as_list)
args = [
args = [
# Expand $(location) / $(locations) in args.
#
# To keep the rule simple, do not expand Make Variables (like *_binary.args usually would).
Expand All @@ -44,7 +44,8 @@ def _impl(ctx):
}
ctx.actions.run(
outputs = ctx.outputs.outs,
inputs = depset(direct = ctx.files.srcs, transitive = [tool_inputs]),
inputs = depset(direct = ctx.files.srcs),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can inputs just be ctx.files.srcs or does it have to be wrapped in a depset?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the depset was indeed useless

tools = tool_inputs,
executable = ctx.executable.tool,
arguments = args,
mnemonic = "RunBinary",
Expand Down