Skip to content

Commit dc5d3e1

Browse files
authored
Fix merging of runfiles library runfiles (#557)
Runfiles should not be merged as files, unless promoting data dependencies. Fixes #556
1 parent 8f6c207 commit dc5d3e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rules/runfiles/complex_tool.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ sub_tool = rule(
5353
)
5454

5555
def _complex_tool_impl(ctx):
56-
my_runfiles = ctx.runfiles(files = [ctx.files._data[0], ctx.files._runfiles_lib[0]])
56+
my_runfiles = ctx.runfiles(files = ctx.files._data)
5757

5858
# Use runfiles.merge to merge the runfiles of both tools. All runfiles will
5959
# be rooted under the runfiles directory owned by this rule, however.
6060
my_runfiles = my_runfiles.merge(ctx.attr._subtool[DefaultInfo].default_runfiles)
61+
my_runfiles = my_runfiles.merge(ctx.attr._runfiles_lib[DefaultInfo].default_runfiles)
6162

6263
# Thus the example directory structure is:
6364
# runfiles/complex_tool (executable)
@@ -102,7 +103,6 @@ complex_tool = rule(
102103
default = ":complex_tool_data.txt",
103104
),
104105
"_runfiles_lib": attr.label(
105-
allow_single_file = True,
106106
default = "@bazel_tools//tools/bash/runfiles",
107107
),
108108
},

0 commit comments

Comments
 (0)