Update build rule to appease deprecation

Before this change, running packetimpact tests produces:

  parameter 'direct' must contain a list of elements, and may no longer
  accept a depset. The deprecated behavior may be temporarily re-enabled
  by setting --incompatible_disable_depset_inputs=false

The positional parameter to depset has been changed to mean `direct`
rather than its previous meaning of `items`. The documentation[0]
explains:

  A positional parameter distinct from other parameters for legacy
  support.

  If --incompatible_disable_depset_items is false, this parameter
  serves as the value of items.

  If --incompatible_disable_depset_items is true, this parameter
  serves as the value of direct.

  See the documentation for these parameters for more details.

[0] https://docs.bazel.build/versions/master/skylark/lib/globals.html

PiperOrigin-RevId: 319555138
This commit is contained in:
Tamir Duberstein
2020-07-03 17:43:09 -07:00
committed by gVisor bot
parent 6c099d8300
commit 418db67e2f
+3 -3
View File
@@ -20,12 +20,12 @@ def _packetimpact_test_impl(ctx):
])
ctx.actions.write(bench, bench_content, is_executable = True)
transitive_files = depset()
transitive_files = []
if hasattr(ctx.attr._test_runner, "data_runfiles"):
transitive_files = depset(ctx.attr._test_runner.data_runfiles.files)
transitive_files.append(ctx.attr._test_runner.data_runfiles.files)
runfiles = ctx.runfiles(
files = [test_runner] + ctx.files.testbench_binary + ctx.files._posix_server_binary,
transitive_files = transitive_files,
transitive_files = depset(transitive = transitive_files),
collect_default = True,
collect_data = True,
)