Skip to content

Commit

Permalink
Enable thrift generated code indexing
Browse files Browse the repository at this point in the history
Summary:
Before: ~13.5k targets to index
After: ~17.5k targets to index

Reviewed By: phlalx, echistyakov

Differential Revision: D68777712

fbshipit-source-id: 67e35c08f9f3f09c99ffc5cbfd4e2e236e1bbb13
  • Loading branch information
podtserkovskiy authored and facebook-github-bot committed Jan 29, 2025
1 parent 1487c09 commit 65dbcf7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions glean/lang/go/targets.bxl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ def _impl_discover(ctx: bxl.Context):
uquery = ctx.uquery()

# gets all targets
go_targets = uquery.kind("go_binary|go_library|go_test|go_exported_library", ctx.cli_args.scope)
print("Go targets (total):", len(go_targets)) # buildifier: disable=print
all_go_targets = uquery.kind("go_binary|go_library|go_test|go_exported_library", ctx.cli_args.scope)
print("Go targets (total):", len(all_go_targets)) # buildifier: disable=print

# exclude generated: mocks, fastcli, thrift, etc
go_targets = go_targets - uquery.attrfilter("labels", "generated", go_targets)
go_targets = all_go_targets - uquery.attrfilter("labels", "generated", all_go_targets)
print("Go targets (non-generated):", len(go_targets)) # buildifier: disable=print

go_targets = go_targets + uquery.attrfilter("labels", "go_thrift_library", all_go_targets)
print("Go targets (non-generated+thrift):", len(go_targets)) # buildifier: disable=print

# exclude broken and incompatible with current platform
conf_results = ctx.lazy.join_all([ctx.lazy.configured_target_node(t).catch() for t in go_targets]).resolve()
valid_targets = []
Expand Down

0 comments on commit 65dbcf7

Please sign in to comment.