diff options
author | 2023-08-15 22:08:18 +0000 | |
---|---|---|
committer | 2023-08-24 19:21:10 +0000 | |
commit | 4ed3d120c94833898b257920de3ff655d14faab5 (patch) | |
tree | 101b4e772aa9b586333586a0b9c6255f99f8c9dd | |
parent | 4e5a194b90d938057cbed154a71421f67d820b11 (diff) |
Handle proto.include_dirs in bp2build for py
Followup to aosp/2711114 which added proto.include_dirs support for cc
Test: go test ./bp2build
Test: Added an integration test in build/bazel/examples
Bug: 285140726
Change-Id: Ic78dacbe46d9ea67e9441948852a3f94dabbb35e
-rw-r--r-- | python/bp2build.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/python/bp2build.go b/python/bp2build.go index 41e9f4974..8bc3d0a3e 100644 --- a/python/bp2build.go +++ b/python/bp2build.go @@ -33,6 +33,12 @@ type bazelPythonLibraryAttributes struct { type bazelPythonProtoLibraryAttributes struct { Deps bazel.LabelListAttribute + + // A list of proto_library targets that the proto_library in `deps` depends on + // This list is overestimation. + // Overestimation is necessary since Soong includes other protos via proto.include_dirs and not + // a specific .proto file module explicitly. + Transitive_deps bazel.LabelListAttribute } type baseAttributes struct { @@ -81,7 +87,8 @@ func (m *PythonLibraryModule) makeArchVariantBaseAttributes(ctx android.TopDownM }, android.CommonAttributes{ Name: pyProtoLibraryName, }, &bazelPythonProtoLibraryAttributes{ - Deps: bazel.MakeLabelListAttribute(protoInfo.Proto_libs), + Deps: bazel.MakeLabelListAttribute(protoInfo.Proto_libs), + Transitive_deps: bazel.MakeLabelListAttribute(protoInfo.Transitive_proto_libs), }) attrs.Deps.Add(bazel.MakeLabelAttribute(":" + pyProtoLibraryName)) |