Skip to content

Commit

Permalink
Add all protos to tool_files
Browse files Browse the repository at this point in the history
This is a followup to aosp/2776434 that added a proto dep to one of the
genrules. `libperfetto_client_experimental` depends on several other
generated headers, so we need to identify the implicit deps of the other
genrules as well.

Implementation details
- Create a "root" filegroup for every proto_library. The srcs to this
  will be the .proto files
- Replace the srcs of the cpp and h generating genrules with the "root"
  filegroup
- For the cpp and h generating genrules, add the "root" filegroup of
  target.proto_deps and target.transitive_proto_deps to `srcs`.
  This ensures that these transitive .proto dependencies get copied to
  the execution sandbox when these modules are built with sandboxing
  turned on in Soong. `srcs` was chosen instead of `tool_files` because
  the latter requires a --proto_path specific to Soong's sandbox impl.
  `outs` will ensure that extraneous generated files do not get
  propagated to rdeps.

Bug: 305049201
Bug: 304495403

Test: tools/gen_android_bp
Test: mmma external/perfetto (Soong)
Test: GENRULE_SANDBOXING=true m libperfetto_client_experimental (Soong
with sandboxing turned on).
Test: b clean --expunge && b build
//external/perfetto:libperfetto_client_experimental --config=android
(Bazel)

Change-Id: I88b420a98a6e72d14d2fe426d0d90f1481cdf9bf
  • Loading branch information
dasspandan committed Oct 18, 2023
1 parent d20d938 commit 34f1b98
Show file tree
Hide file tree
Showing 2 changed files with 1,998 additions and 1,086 deletions.
Loading

0 comments on commit 34f1b98

Please sign in to comment.