Skip to content

Commit

Permalink
Use data from transitive_proto_sources instead of transitive_sources …
Browse files Browse the repository at this point in the history
…in proto_lang_toolchain.

The problem with latter is, that transitive_source can contain "renamed" files (in _virtual_includes subdirectory), which doesn't work for the detection that needs original files (ProtoSource.original_source_file).

PiperOrigin-RevId: 446924924
  • Loading branch information
comius authored and copybara-github committed May 6, 2022
1 parent e2fa1a6 commit 8528661
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ ProtoInfo = _builtins.toplevel.ProtoInfo
proto_common = _builtins.toplevel.proto_common

def _rule_impl(ctx):
provided_proto_sources = []
transitive_files = depset(transitive = [bp[ProtoInfo].transitive_sources for bp in ctx.attr.blacklisted_protos])
for file in transitive_files.to_list():
source_root = file.root.path
provided_proto_sources.append(proto_common.ProtoSource(file, file, source_root))
provided_proto_sources = depset(transitive = [bp[ProtoInfo].transitive_proto_sources() for bp in ctx.attr.blacklisted_protos]).to_list()

flag = ctx.attr.command_line
if flag.find("$(PLUGIN_OUT)") > -1:
Expand Down

0 comments on commit 8528661

Please sign in to comment.