Fix bazel out directory when using external repo

pull/23633/head
James Fish 4 years ago
parent fe6034fec8
commit 7ad26947c9
  1. 7
      bazel/protobuf.bzl

@ -230,7 +230,12 @@ def get_out_dir(protos, context):
path = out_dir,
import_path = out_dir[out_dir.find(_VIRTUAL_IMPORTS) + 1:],
)
return struct(path = context.genfiles_dir.path, import_path = None)
out_dir = context.genfiles_dir.path
ws_root = context.label.workspace_root
if ws_root:
out_dir = out_dir + "/" + ws_root
return struct(path = out_dir, import_path = None)
def is_in_virtual_imports(source_file, virtual_folder = _VIRTUAL_IMPORTS):
"""Determines if source_file is virtual (is placed in _virtual_imports

Loading…
Cancel
Save