Skip to content

Commit bf2330d

Browse files
committed
fix: expand_template propagate runfiles (#1171)
Otherwise the data of the expand_template has to be repeated on dependents Fixes https://github.com/r0bobo/rules-py-datafiles-reproducer
1 parent 6083a6d commit bf2330d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/private/expand_template.bzl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,21 @@ def _expand_template_impl(ctx):
6060
)
6161

6262
all_outs = [output]
63-
runfiles = ctx.runfiles(files = all_outs)
64-
return [DefaultInfo(files = depset(all_outs), runfiles = runfiles)]
63+
64+
runfiles = ctx.runfiles(
65+
files = all_outs,
66+
transitive_files = depset(transitive = [
67+
target[DefaultInfo].files
68+
for target in ctx.attr.data
69+
]),
70+
)
71+
return [DefaultInfo(
72+
files = depset(all_outs),
73+
runfiles = runfiles.merge_all([
74+
target[DefaultInfo].default_runfiles
75+
for target in ctx.attr.data
76+
]),
77+
)]
6578

6679
expand_template_lib = struct(
6780
doc = """Template expansion

0 commit comments

Comments
 (0)