Skip to content

Commit eafd42c

Browse files
douglas-reidpcj
authored andcommitted
Update genfiles path calculation logic
1 parent 25bfcba commit eafd42c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

protobuf/internal/proto_compile.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ def _build_output_files(run, builder):
186186
for ext in exts:
187187
path = _get_relative_dirname(run, ctx.label.package, file)
188188

189-
if ctx.var["GENDIR"].endswith("/".join(path)):
190-
# if the path context is the genfiles directory, ignore relative
191-
# path name calculation
192-
path = []
189+
genpath = ctx.var["GENDIR"].split("/")
190+
lastIndex = len(genpath) - 1
191+
if genpath[lastIndex] in path:
192+
path = []
193193

194194
path.append(base + ext)
195195
pbfile = ctx.new_file("/".join(path))

0 commit comments

Comments
 (0)