Add a denylist for specifically mixed builds am: bab4d7e3bc am: 2678212a0f

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1677624

Change-Id: I0e794c82bea705124d0b6c9024e9201ead93d6bb
This commit is contained in:
Chris Parsons
2021-04-19 19:33:11 +00:00
committed by Automerger Merge Worker
3 changed files with 27 additions and 7 deletions

View File

@@ -134,7 +134,7 @@ var (
"system/logging/liblog": Bp2BuildDefaultTrueRecursively,
}
// Per-module denylist to always opt modules out.
// Per-module denylist to always opt modules out of both bp2build and mixed builds.
bp2buildModuleDoNotConvertList = []string{
"libBionicBenchmarksUtils", // ruperts@, cc_library_static, 'map' file not found
"libbionic_spawn_benchmark", // ruperts@, cc_library_static, depends on //system/libbase
@@ -170,6 +170,8 @@ var (
"libc_dns", // ruperts@, cc_library_static, 'android/log.h' file not found
"libc_static_dispatch", // eakammer@, cc_library_static, 'private/bionic_asm.h' file not found
"libc_dynamic_dispatch", // eakammer@, cc_library_static, 'private/bionic_ifuncs.h' file not found
"note_memtag_heap_async", // jingwen@, cc_library_static, 'private/bionic_asm.h' file not found (arm64)
"note_memtag_heap_sync", // jingwen@, cc_library_static, 'private/bionic_asm.h' file not found (arm64)
// List of all full_cc_libraries in //bionic, with their immediate failures
"libc", // jingwen@, cc_library, depends on //external/gwp_asan
@@ -179,21 +181,39 @@ var (
"libm", // jingwen@, cc_library, fatal error: 'freebsd-compat.h' file not found
"libseccomp_policy", // jingwen@, cc_library, fatal error: 'seccomp_policy.h' file not found
"libstdc++", // jingwen@, cc_library, depends on //external/gwp_asan
}
// For mixed builds specifically
"note_memtag_heap_async", // jingwen@, cc_library_static, OK for bp2build but features.h includes not found for mixed builds (b/185079815)
"note_memtag_heap_sync", // jingwen@, cc_library_static, OK for bp2build but features.h includes not found for mixed builds (b/185079815)
"libc_gdtoa", // ruperts@, cc_library_static, OK for bp2build but undefined symbol: __strtorQ for mixed builds
// Per-module denylist to opt modules out of mixed builds. Such modules will
// still be generated via bp2build.
mixedBuildsDisabledList = []string{
"libc_gdtoa", // ruperts@, cc_library_static, OK for bp2build but undefined symbol: __strtorQ for mixed builds
}
// Used for quicker lookups
bp2buildModuleDoNotConvert = map[string]bool{}
mixedBuildsDisabled = map[string]bool{}
)
func init() {
for _, moduleName := range bp2buildModuleDoNotConvertList {
bp2buildModuleDoNotConvert[moduleName] = true
}
for _, moduleName := range mixedBuildsDisabledList {
mixedBuildsDisabled[moduleName] = true
}
}
// MixedBuildsEnabled checks that a module is ready to be replaced by a
// converted or handcrafted Bazel target.
func (b *BazelModuleBase) MixedBuildsEnabled(ctx BazelConversionPathContext) bool {
if !ctx.Config().BazelContext.BazelEnabled() {
return false
}
if len(b.GetBazelLabel(ctx, ctx.Module())) == 0 {
return false
}
return !mixedBuildsDisabled[ctx.Module().Name()]
}
// ConvertWithBp2build returns whether the given BazelModuleBase should be converted with bp2build.

View File

@@ -1641,7 +1641,7 @@ func (c *Module) setSubnameProperty(actx android.ModuleContext) {
func (c *Module) maybeGenerateBazelActions(actx android.ModuleContext) bool {
bazelModuleLabel := c.GetBazelLabel(actx, c)
bazelActionsUsed := false
if c.bazelHandler != nil && actx.Config().BazelContext.BazelEnabled() && len(bazelModuleLabel) > 0 {
if c.MixedBuildsEnabled(actx) && c.bazelHandler != nil {
bazelActionsUsed = c.bazelHandler.generateBazelBuildActions(actx, bazelModuleLabel)
}
return bazelActionsUsed

View File

@@ -543,7 +543,7 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
bazelModuleLabel := g.GetBazelLabel(ctx, g)
bazelActionsUsed := false
if ctx.Config().BazelContext.BazelEnabled() && len(bazelModuleLabel) > 0 {
if g.MixedBuildsEnabled(ctx) {
bazelActionsUsed = g.generateBazelBuildActions(ctx, bazelModuleLabel)
}
if !bazelActionsUsed {