diff --git a/android/filegroup.go b/android/filegroup.go index e5eec87cf..6b1117230 100644 --- a/android/filegroup.go +++ b/android/filegroup.go @@ -120,9 +120,13 @@ func (fg *fileGroup) ConvertWithBp2build(ctx TopDownMutatorContext) { ctx.CreateBazelTargetModule(props, CommonAttributes{Name: fg.Name()}, attrs) } else { if fg.ShouldConvertToProtoLibrary(ctx) { + // TODO(b/246997908): we can remove this tag if we could figure out a + // solution for this bug. + tags := []string{"manual"} attrs := &ProtoAttrs{ Srcs: srcs, Strip_import_prefix: fg.properties.Path, + Tags: tags, } ctx.CreateBazelTargetModule( diff --git a/android/proto.go b/android/proto.go index 3a5d4da5c..3cac9a185 100644 --- a/android/proto.go +++ b/android/proto.go @@ -164,6 +164,7 @@ type ProtoAttrs struct { Srcs bazel.LabelListAttribute Strip_import_prefix *string Deps bazel.LabelListAttribute + Tags []string } // For each package in the include_dirs property a proto_library target should @@ -203,6 +204,7 @@ func Bp2buildProtoProperties(ctx Bp2buildMutatorContext, m *ModuleBase, srcs baz attrs := ProtoAttrs{ Srcs: bazel.MakeLabelListAttribute(directProtoSrcs), } + attrs.Deps.Append(bazel.MakeLabelListAttribute(protoLibraries)) for axis, configToProps := range m.GetArchVariantProperties(ctx, &ProtoProperties{}) { for _, rawProps := range configToProps { diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go index ba7af0945..12cffc304 100644 --- a/bp2build/cc_library_conversion_test.go +++ b/bp2build/cc_library_conversion_test.go @@ -2284,6 +2284,7 @@ cc_library { }`, ExpectedBazelTargets: []string{ MakeBazelTarget("proto_library", "a_proto", AttrNameToString{ + "deps": `[":a_fg_proto_bp2build_converted"]`, "srcs": `["a.proto"]`, }), MakeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{ "deps": `[ @@ -2298,6 +2299,7 @@ cc_library { "whole_archive_deps": `[":a_cc_proto_lite"]`, }), MakeBazelTargetNoRestrictions("proto_library", "a_fg_proto_bp2build_converted", AttrNameToString{ "srcs": `["a_fg.proto"]`, + "tags": `["manual"]`, }), MakeBazelTargetNoRestrictions("filegroup", "a_fg_proto", AttrNameToString{ "srcs": `["a_fg.proto"]`, }), @@ -2336,6 +2338,7 @@ cc_library { "whole_archive_deps": `[":a_cc_proto_lite"]`, }), MakeBazelTargetNoRestrictions("proto_library", "a_fg_proto_bp2build_converted", AttrNameToString{ "srcs": `["a_fg.proto"]`, + "tags": `["manual"]`, }), MakeBazelTargetNoRestrictions("filegroup", "a_fg_proto", AttrNameToString{ "srcs": `["a_fg.proto"]`, }), @@ -2368,6 +2371,7 @@ cc_library { }`, ExpectedBazelTargets: []string{ MakeBazelTarget("proto_library", "a_proto", AttrNameToString{ + "deps": `["//path/to/A:a_fg_proto_bp2build_converted"]`, "srcs": `["a.proto"]`, }), MakeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{ "deps": `[ diff --git a/bp2build/filegroup_conversion_test.go b/bp2build/filegroup_conversion_test.go index d84d4b374..e978fb319 100644 --- a/bp2build/filegroup_conversion_test.go +++ b/bp2build/filegroup_conversion_test.go @@ -135,7 +135,8 @@ filegroup { ExpectedBazelTargets: []string{ MakeBazelTargetNoRestrictions("proto_library", "foo_bp2build_converted", AttrNameToString{ "srcs": `["proto/foo.proto"]`, - "strip_import_prefix": `"proto"`}), + "strip_import_prefix": `"proto"`, + "tags": `["manual"]`}), MakeBazelTargetNoRestrictions("filegroup", "foo", AttrNameToString{ "srcs": `["proto/foo.proto"]`}), }})