File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
- 3.9
1
+ 3.12
Original file line number Diff line number Diff line change @@ -327,10 +327,15 @@ def _maybe_file(path):
327
327
def _expand_template_impl (ctx ):
328
328
pkg = ctx .label .package
329
329
update_src = ctx .actions .declare_file (ctx .attr .update_target + ".py" )
330
+
331
+ # Fix the path construction to avoid absolute paths
332
+ # If package is empty (root), don't add a leading slash
333
+ dst = ctx .attr .output if pkg == "" else "{}/{}" .format (pkg , ctx .attr .output )
334
+
330
335
ctx .actions .expand_template (
331
336
template = ctx .files ._template [0 ],
332
337
substitutions = {
333
- "{{dst}}" : "{}/{}" . format ( pkg , ctx . attr . output ) ,
338
+ "{{dst}}" : dst ,
334
339
"{{src}}" : "{}" .format (ctx .files .src [0 ].short_path ),
335
340
"{{update_target}}" : "//{}:{}" .format (pkg , ctx .attr .update_target ),
336
341
},
You can’t perform that action at this time.
0 commit comments