Add tool runfiles to action (#942)

This commit is contained in:
jheaff1 2022-07-26 09:47:53 +01:00 committed by GitHub
parent 0dafcb29a8
commit 21b0c40493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 4 deletions

View File

@ -463,14 +463,23 @@ def cc_external_rule_impl(ctx, attrs):
# The use of `run_shell` here is intended to ensure bash is correctly setup on windows
# environments. This should not be replaced with `run` until a cross platform implementation
# is found that guarantees bash exists or appropriately errors out.
tool_runfiles = []
for data in data_dependencies:
tool_runfiles += data[DefaultInfo].default_runfiles.files.to_list()
ctx.actions.run_shell(
mnemonic = "Cc" + attrs.configure_name.capitalize() + "MakeRule",
inputs = depset(inputs.declared_inputs),
outputs = rule_outputs + [wrapped_outputs.log_file],
tools = depset(
[wrapped_outputs.script_file, wrapped_outputs.wrapper_script_file] + ctx.files.data + ctx.files.build_data + legacy_tools,
transitive = [cc_toolchain.all_files] + [data[DefaultInfo].default_runfiles.files for data in data_dependencies],
),
tools =
[wrapped_outputs.script_file, wrapped_outputs.wrapper_script_file] +
ctx.files.data +
ctx.files.build_data +
legacy_tools +
cc_toolchain.all_files.to_list() +
tool_runfiles +
[data[DefaultInfo].files_to_run for data in data_dependencies],
command = wrapped_outputs.wrapper_script_file.path,
execution_requirements = execution_requirements,
use_default_shell_env = True,