Skip to content

Commit 25bfcba

Browse files
douglas-reidpcj
authored andcommitted
Update output path calculation for generated protos
1 parent ccf1575 commit 25bfcba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

protobuf/internal/proto_compile.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ def _build_output_files(run, builder):
185185
base = _capitalize(base)
186186
for ext in exts:
187187
path = _get_relative_dirname(run, ctx.label.package, file)
188+
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 = []
193+
188194
path.append(base + ext)
189195
pbfile = ctx.new_file("/".join(path))
190196
builder["outputs"] += [pbfile]

0 commit comments

Comments
 (0)