Skip to content

Commit

Permalink
Don't trim go proto deps.
Browse files Browse the repository at this point in the history
This reverts bazelbuild@f2ef902.

After bazelbuild@6d9fd8b, we can no longer rely on the import resolver to dynamically add files to the project as they are resolved. So we have to go back to attaching to every proto library transitively for go proto sources. Will increase initial indexing time as more .pb.go files will be initially present in the external library, whether they are actually used or not.

PiperOrigin-RevId: 310574354
  • Loading branch information
Googler authored and copybara-github committed May 8, 2020
1 parent 81afc2c commit d22d157
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aspect/intellij_info_impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ def _is_language_specific_proto_library(ctx, target):
return True
if CcInfo in target:
return True
if hasattr(target, "aspect_proto_go_api_info"):
return True
return False

def make_target_key(label, aspect_ids):
Expand Down Expand Up @@ -325,8 +327,8 @@ def collect_py_info(target, ctx, semantics, ide_info, ide_info_file, output_grou

def _collect_generated_go_sources(target):
"""Returns a depset of go source files generated by this target."""
if hasattr(target, "proto_go_api_info"):
go_proto_info = target.proto_go_api_info
if hasattr(target, "aspect_proto_go_api_info"):
go_proto_info = target.aspect_proto_go_api_info
files = getattr(go_proto_info, "files_to_build", depset()).to_list()
return [f for f in files if f.basename.endswith(".pb.go")]
elif hasattr(target[OutputGroupInfo], "go_generated_srcs"):
Expand Down Expand Up @@ -1102,5 +1104,5 @@ def make_intellij_info_aspect(aspect_impl, semantics):
attr_aspects = attr_aspects,
fragments = ["cpp"],
implementation = aspect_impl,
required_aspect_providers = [[JavaInfo], [CcInfo], ["dart"]],
required_aspect_providers = [[JavaInfo], [CcInfo], ["dart"], ["aspect_proto_go_api_info"]],
)

0 comments on commit d22d157

Please sign in to comment.