Loading android/bazel.go +3 −8 Original line number Diff line number Diff line Loading @@ -204,16 +204,11 @@ var ( "libBionicBenchmarksUtils", // cc_library_static, fatal error: 'map' file not found, from libcxx "fmtlib", // cc_library_static, fatal error: 'cassert' file not found, from libcxx "fmtlib_ndk", // cc_library_static, fatal error: 'cassert' file not found "liblog", // http://b/186822772: cc_library, 'sys/cdefs.h' file not found "libbase", // Requires liblog. http://b/186826479, cc_library, fatal error: 'memory' file not found, from libcxx. // Also depends on fmtlib. // http://b/186024507: Includes errors because of the system_shared_libs default value. // Missing -isystem bionic/libc/include through the libc/libm/libdl // default dependencies if system_shared_libs is unset. "liblog", // http://b/186822772: cc_library, 'sys/cdefs.h' file not found "libjemalloc5_jet", // cc_library, 'sys/cdefs.h' file not found "libseccomp_policy", // http://b/186476753: cc_library, 'linux/filter.h' not found "note_memtag_heap_async", // http://b/185127353: cc_library_static, error: feature.h not found "note_memtag_heap_sync", // http://b/185127353: cc_library_static, error: feature.h not found "libseccomp_policy", // depends on libbase "gwp_asan_crash_handler", // cc_library, ld.lld: error: undefined symbol: memset Loading android/bazel_paths.go +5 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,11 @@ func BazelLabelForModuleWholeDepsExcludes(ctx BazelConversionPathContext, module func bazelLabelForModuleDeps(ctx BazelConversionPathContext, modules []string, isWholeLibs bool) bazel.LabelList { var labels bazel.LabelList // In some cases, a nil string list is different than an explicitly empty list. if len(modules) == 0 && modules != nil { labels.Includes = []bazel.Label{} return labels } for _, module := range modules { bpText := module if m := SrcIsModule(module); m == "" { Loading bazel/configurability.go +30 −30 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ const ( // This is consistently named "conditions_default" to mirror the Soong // config variable default key in an Android.bp file, although there's no // integration with Soong config variables (yet). conditionsDefault = "conditions_default" ConditionsDefaultConfigKey = "conditions_default" ConditionsDefaultSelectKey = "//conditions:default" Loading @@ -76,7 +76,7 @@ var ( archArm64: "//build/bazel/platforms/arch:arm64", archX86: "//build/bazel/platforms/arch:x86", archX86_64: "//build/bazel/platforms/arch:x86_64", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of as arch select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of as arch select map. } // A map of target operating systems to the Bazel label of the Loading @@ -88,12 +88,12 @@ var ( osLinuxMusl: "//build/bazel/platforms/os:linux_musl", osLinuxBionic: "//build/bazel/platforms/os:linux_bionic", osWindows: "//build/bazel/platforms/os:windows", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of an os select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map. } platformBionicMap = map[string]string{ "bionic": "//build/bazel/platforms/os:bionic", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of an os select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map. } platformOsArchMap = map[string]string{ Loading @@ -110,7 +110,7 @@ var ( osArchLinuxBionicX86_64: "//build/bazel/platforms/os_arch:linux_bionic_x86_64", osArchWindowsX86: "//build/bazel/platforms/os_arch:windows_x86", osArchWindowsX86_64: "//build/bazel/platforms/os_arch:windows_x86_64", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of an os select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map. } ) Loading Loading @@ -181,7 +181,7 @@ func (ct configurationType) SelectKey(config string) string { case bionic: return platformBionicMap[config] case productVariables: if config == conditionsDefault { if config == ConditionsDefaultConfigKey { return ConditionsDefaultSelectKey } return fmt.Sprintf("%s:%s", productVariableBazelPackage, strings.ToLower(config)) Loading bazel/properties.go +29 −2 Original line number Diff line number Diff line Loading @@ -69,6 +69,23 @@ type LabelList struct { Excludes []Label } func (ll *LabelList) Equals(other LabelList) bool { if len(ll.Includes) != len(other.Includes) || len(ll.Excludes) != len(other.Excludes) { return false } for i, _ := range ll.Includes { if ll.Includes[i] != other.Includes[i] { return false } } for i, _ := range ll.Excludes { if ll.Excludes[i] != other.Excludes[i] { return false } } return true } func (ll *LabelList) IsNil() bool { return ll.Includes == nil && ll.Excludes == nil } Loading Loading @@ -446,7 +463,7 @@ func (ll labelListSelectValues) appendSelects(other labelListSelectValues) { // HasConfigurableValues returns whether there are configurable values within this set of selects. func (ll labelListSelectValues) HasConfigurableValues() bool { for _, v := range ll { if len(v.Includes) > 0 { if v.Includes != nil { return true } } Loading @@ -462,6 +479,13 @@ type LabelListAttribute struct { // The configured attribute label list Values. Optional // a map of independent configurability axes ConfigurableValues configurableLabelLists // If true, differentiate between "nil" and "empty" list. nil means that // this attribute should not be specified at all, and "empty" means that // the attribute should be explicitly specified as an empty list. // This mode facilitates use of attribute defaults: an empty list should // override the default. ForceSpecifyEmptyList bool } type configurableLabelLists map[ConfigurationAxis]labelListSelectValues Loading Loading @@ -546,6 +570,9 @@ func (lla *LabelListAttribute) SortedConfigurationAxes() []ConfigurationAxis { // Append all values, including os and arch specific ones, from another // LabelListAttribute to this LabelListAttribute. func (lla *LabelListAttribute) Append(other LabelListAttribute) { if lla.ForceSpecifyEmptyList && !other.Value.IsNil() { lla.Value.Includes = []Label{} } lla.Value.Append(other.Value) if lla.ConfigurableValues == nil { lla.ConfigurableValues = make(configurableLabelLists) Loading Loading @@ -595,7 +622,7 @@ func (lla *LabelListAttribute) ResolveExcludes() { // Now that the Value list is finalized for this axis, compare it with the original // list, and put the difference into the default condition for the axis. lla.ConfigurableValues[axis][conditionsDefault] = SubtractBazelLabelList(baseLabels, lla.Value) lla.ConfigurableValues[axis][ConditionsDefaultConfigKey] = SubtractBazelLabelList(baseLabels, lla.Value) // if everything ends up without includes, just delete the axis if !lla.ConfigurableValues[axis].HasConfigurableValues() { Loading bp2build/cc_library_conversion_test.go +210 −0 Original line number Diff line number Diff line Loading @@ -1454,3 +1454,213 @@ cc_library { )`}, }) } func TestCcLibrary_SystemSharedLibsRootEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty at root", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "root_empty", system_shared_libs: [], } `, expectedBazelTargets: []string{`cc_library( name = "root_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], system_dynamic_deps = [], )`}, }) } func TestCcLibrary_SystemSharedLibsStaticEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for static variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "static_empty", static: { system_shared_libs: [], }, } `, expectedBazelTargets: []string{`cc_library( name = "static_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], static = { "system_dynamic_deps": [], }, )`}, }) } func TestCcLibrary_SystemSharedLibsSharedEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for shared variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "shared_empty", shared: { system_shared_libs: [], }, } `, expectedBazelTargets: []string{`cc_library( name = "shared_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], shared = { "system_dynamic_deps": [], }, )`}, }) } func TestCcLibrary_SystemSharedLibsSharedBionicEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for shared, bionic variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "shared_empty", target: { bionic: { shared: { system_shared_libs: [], } } }, } `, expectedBazelTargets: []string{`cc_library( name = "shared_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], shared = { "system_dynamic_deps": [], }, )`}, }) } func TestCcLibrary_SystemSharedLibsLinuxBionicEmpty(t *testing.T) { // Note that this behavior is technically incorrect (it's a simplification). // The correct behavior would be if bp2build wrote `system_dynamic_deps = []` // only for linux_bionic, but `android` had `["libc", "libdl", "libm"]. // b/195791252 tracks the fix. runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for linux_bionic variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "target_linux_bionic_empty", target: { linux_bionic: { system_shared_libs: [], }, }, } `, expectedBazelTargets: []string{`cc_library( name = "target_linux_bionic_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], system_dynamic_deps = [], )`}, }) } func TestCcLibrary_SystemSharedLibsBionicEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for bionic variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "target_bionic_empty", target: { bionic: { system_shared_libs: [], }, }, } `, expectedBazelTargets: []string{`cc_library( name = "target_bionic_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], system_dynamic_deps = [], )`}, }) } func TestCcLibrary_SystemSharedLibsSharedAndRoot(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs set for shared and root", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library {name: "libc"} cc_library {name: "libm"} cc_library { name: "foo", system_shared_libs: ["libc"], shared: { system_shared_libs: ["libm"], }, } `, expectedBazelTargets: []string{`cc_library( name = "foo", copts = [ "-I.", "-I$(BINDIR)/.", ], shared = { "system_dynamic_deps": [":libm"], }, system_dynamic_deps = [":libc"], )`, `cc_library( name = "libc", copts = [ "-I.", "-I$(BINDIR)/.", ], )`, `cc_library( name = "libm", copts = [ "-I.", "-I$(BINDIR)/.", ], )`}, }) } Loading
android/bazel.go +3 −8 Original line number Diff line number Diff line Loading @@ -204,16 +204,11 @@ var ( "libBionicBenchmarksUtils", // cc_library_static, fatal error: 'map' file not found, from libcxx "fmtlib", // cc_library_static, fatal error: 'cassert' file not found, from libcxx "fmtlib_ndk", // cc_library_static, fatal error: 'cassert' file not found "liblog", // http://b/186822772: cc_library, 'sys/cdefs.h' file not found "libbase", // Requires liblog. http://b/186826479, cc_library, fatal error: 'memory' file not found, from libcxx. // Also depends on fmtlib. // http://b/186024507: Includes errors because of the system_shared_libs default value. // Missing -isystem bionic/libc/include through the libc/libm/libdl // default dependencies if system_shared_libs is unset. "liblog", // http://b/186822772: cc_library, 'sys/cdefs.h' file not found "libjemalloc5_jet", // cc_library, 'sys/cdefs.h' file not found "libseccomp_policy", // http://b/186476753: cc_library, 'linux/filter.h' not found "note_memtag_heap_async", // http://b/185127353: cc_library_static, error: feature.h not found "note_memtag_heap_sync", // http://b/185127353: cc_library_static, error: feature.h not found "libseccomp_policy", // depends on libbase "gwp_asan_crash_handler", // cc_library, ld.lld: error: undefined symbol: memset Loading
android/bazel_paths.go +5 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,11 @@ func BazelLabelForModuleWholeDepsExcludes(ctx BazelConversionPathContext, module func bazelLabelForModuleDeps(ctx BazelConversionPathContext, modules []string, isWholeLibs bool) bazel.LabelList { var labels bazel.LabelList // In some cases, a nil string list is different than an explicitly empty list. if len(modules) == 0 && modules != nil { labels.Includes = []bazel.Label{} return labels } for _, module := range modules { bpText := module if m := SrcIsModule(module); m == "" { Loading
bazel/configurability.go +30 −30 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ const ( // This is consistently named "conditions_default" to mirror the Soong // config variable default key in an Android.bp file, although there's no // integration with Soong config variables (yet). conditionsDefault = "conditions_default" ConditionsDefaultConfigKey = "conditions_default" ConditionsDefaultSelectKey = "//conditions:default" Loading @@ -76,7 +76,7 @@ var ( archArm64: "//build/bazel/platforms/arch:arm64", archX86: "//build/bazel/platforms/arch:x86", archX86_64: "//build/bazel/platforms/arch:x86_64", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of as arch select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of as arch select map. } // A map of target operating systems to the Bazel label of the Loading @@ -88,12 +88,12 @@ var ( osLinuxMusl: "//build/bazel/platforms/os:linux_musl", osLinuxBionic: "//build/bazel/platforms/os:linux_bionic", osWindows: "//build/bazel/platforms/os:windows", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of an os select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map. } platformBionicMap = map[string]string{ "bionic": "//build/bazel/platforms/os:bionic", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of an os select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map. } platformOsArchMap = map[string]string{ Loading @@ -110,7 +110,7 @@ var ( osArchLinuxBionicX86_64: "//build/bazel/platforms/os_arch:linux_bionic_x86_64", osArchWindowsX86: "//build/bazel/platforms/os_arch:windows_x86", osArchWindowsX86_64: "//build/bazel/platforms/os_arch:windows_x86_64", conditionsDefault: ConditionsDefaultSelectKey, // The default condition of an os select map. ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map. } ) Loading Loading @@ -181,7 +181,7 @@ func (ct configurationType) SelectKey(config string) string { case bionic: return platformBionicMap[config] case productVariables: if config == conditionsDefault { if config == ConditionsDefaultConfigKey { return ConditionsDefaultSelectKey } return fmt.Sprintf("%s:%s", productVariableBazelPackage, strings.ToLower(config)) Loading
bazel/properties.go +29 −2 Original line number Diff line number Diff line Loading @@ -69,6 +69,23 @@ type LabelList struct { Excludes []Label } func (ll *LabelList) Equals(other LabelList) bool { if len(ll.Includes) != len(other.Includes) || len(ll.Excludes) != len(other.Excludes) { return false } for i, _ := range ll.Includes { if ll.Includes[i] != other.Includes[i] { return false } } for i, _ := range ll.Excludes { if ll.Excludes[i] != other.Excludes[i] { return false } } return true } func (ll *LabelList) IsNil() bool { return ll.Includes == nil && ll.Excludes == nil } Loading Loading @@ -446,7 +463,7 @@ func (ll labelListSelectValues) appendSelects(other labelListSelectValues) { // HasConfigurableValues returns whether there are configurable values within this set of selects. func (ll labelListSelectValues) HasConfigurableValues() bool { for _, v := range ll { if len(v.Includes) > 0 { if v.Includes != nil { return true } } Loading @@ -462,6 +479,13 @@ type LabelListAttribute struct { // The configured attribute label list Values. Optional // a map of independent configurability axes ConfigurableValues configurableLabelLists // If true, differentiate between "nil" and "empty" list. nil means that // this attribute should not be specified at all, and "empty" means that // the attribute should be explicitly specified as an empty list. // This mode facilitates use of attribute defaults: an empty list should // override the default. ForceSpecifyEmptyList bool } type configurableLabelLists map[ConfigurationAxis]labelListSelectValues Loading Loading @@ -546,6 +570,9 @@ func (lla *LabelListAttribute) SortedConfigurationAxes() []ConfigurationAxis { // Append all values, including os and arch specific ones, from another // LabelListAttribute to this LabelListAttribute. func (lla *LabelListAttribute) Append(other LabelListAttribute) { if lla.ForceSpecifyEmptyList && !other.Value.IsNil() { lla.Value.Includes = []Label{} } lla.Value.Append(other.Value) if lla.ConfigurableValues == nil { lla.ConfigurableValues = make(configurableLabelLists) Loading Loading @@ -595,7 +622,7 @@ func (lla *LabelListAttribute) ResolveExcludes() { // Now that the Value list is finalized for this axis, compare it with the original // list, and put the difference into the default condition for the axis. lla.ConfigurableValues[axis][conditionsDefault] = SubtractBazelLabelList(baseLabels, lla.Value) lla.ConfigurableValues[axis][ConditionsDefaultConfigKey] = SubtractBazelLabelList(baseLabels, lla.Value) // if everything ends up without includes, just delete the axis if !lla.ConfigurableValues[axis].HasConfigurableValues() { Loading
bp2build/cc_library_conversion_test.go +210 −0 Original line number Diff line number Diff line Loading @@ -1454,3 +1454,213 @@ cc_library { )`}, }) } func TestCcLibrary_SystemSharedLibsRootEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty at root", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "root_empty", system_shared_libs: [], } `, expectedBazelTargets: []string{`cc_library( name = "root_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], system_dynamic_deps = [], )`}, }) } func TestCcLibrary_SystemSharedLibsStaticEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for static variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "static_empty", static: { system_shared_libs: [], }, } `, expectedBazelTargets: []string{`cc_library( name = "static_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], static = { "system_dynamic_deps": [], }, )`}, }) } func TestCcLibrary_SystemSharedLibsSharedEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for shared variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "shared_empty", shared: { system_shared_libs: [], }, } `, expectedBazelTargets: []string{`cc_library( name = "shared_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], shared = { "system_dynamic_deps": [], }, )`}, }) } func TestCcLibrary_SystemSharedLibsSharedBionicEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for shared, bionic variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "shared_empty", target: { bionic: { shared: { system_shared_libs: [], } } }, } `, expectedBazelTargets: []string{`cc_library( name = "shared_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], shared = { "system_dynamic_deps": [], }, )`}, }) } func TestCcLibrary_SystemSharedLibsLinuxBionicEmpty(t *testing.T) { // Note that this behavior is technically incorrect (it's a simplification). // The correct behavior would be if bp2build wrote `system_dynamic_deps = []` // only for linux_bionic, but `android` had `["libc", "libdl", "libm"]. // b/195791252 tracks the fix. runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for linux_bionic variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "target_linux_bionic_empty", target: { linux_bionic: { system_shared_libs: [], }, }, } `, expectedBazelTargets: []string{`cc_library( name = "target_linux_bionic_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], system_dynamic_deps = [], )`}, }) } func TestCcLibrary_SystemSharedLibsBionicEmpty(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs empty for bionic variant", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library { name: "target_bionic_empty", target: { bionic: { system_shared_libs: [], }, }, } `, expectedBazelTargets: []string{`cc_library( name = "target_bionic_empty", copts = [ "-I.", "-I$(BINDIR)/.", ], system_dynamic_deps = [], )`}, }) } func TestCcLibrary_SystemSharedLibsSharedAndRoot(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ description: "cc_library system_shared_libs set for shared and root", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build, blueprint: soongCcLibraryPreamble + ` cc_library {name: "libc"} cc_library {name: "libm"} cc_library { name: "foo", system_shared_libs: ["libc"], shared: { system_shared_libs: ["libm"], }, } `, expectedBazelTargets: []string{`cc_library( name = "foo", copts = [ "-I.", "-I$(BINDIR)/.", ], shared = { "system_dynamic_deps": [":libm"], }, system_dynamic_deps = [":libc"], )`, `cc_library( name = "libc", copts = [ "-I.", "-I$(BINDIR)/.", ], )`, `cc_library( name = "libm", copts = [ "-I.", "-I$(BINDIR)/.", ], )`}, }) }