Disable ABI tracking for bionic.

This is being done with a path-based filter rather than as a property
of ndk_library because there would be no way to prevent people from
disabling ABI tracking without API council review if it were a
property, since there's no per-module OWNERS.

Bug: http://b/358653811
Test: m ndk
Change-Id: If6af638accc917294eee18cb08551c5df25462ad
This commit is contained in:
Dan Albert
2024-08-09 20:39:39 +00:00
parent c8b6feba4c
commit fbe5780312
2 changed files with 12 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ func (n *ndkAbiDumpSingleton) GenerateBuildActions(ctx android.SingletonContext)
if m, ok := module.(*Module); ok { if m, ok := module.(*Module); ok {
if installer, ok := m.installer.(*stubDecorator); ok { if installer, ok := m.installer.(*stubDecorator); ok {
if canDumpAbi(ctx.Config()) { if canDumpAbi(ctx.Config(), ctx.ModuleDir(module)) {
depPaths = append(depPaths, installer.abiDumpPath) depPaths = append(depPaths, installer.abiDumpPath)
} }
} }

View File

@@ -321,10 +321,19 @@ func (this *stubDecorator) findPrebuiltAbiDump(ctx ModuleContext,
} }
// Feature flag. // Feature flag.
func canDumpAbi(config android.Config) bool { func canDumpAbi(config android.Config, moduleDir string) bool {
if runtime.GOOS == "darwin" { if runtime.GOOS == "darwin" {
return false return false
} }
if strings.HasPrefix(moduleDir, "bionic/") {
// Bionic has enough uncommon implementation details like ifuncs and asm
// code that the ABI tracking here has a ton of false positives. That's
// causing pretty extreme friction for development there, so disabling
// it until the workflow can be improved.
//
// http://b/358653811
return false
}
// http://b/156513478 // http://b/156513478
return config.ReleaseNdkAbiMonitored() return config.ReleaseNdkAbiMonitored()
} }
@@ -460,7 +469,7 @@ func (c *stubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) O
nativeAbiResult := parseNativeAbiDefinition(ctx, symbolFile, c.apiLevel, "") nativeAbiResult := parseNativeAbiDefinition(ctx, symbolFile, c.apiLevel, "")
objs := compileStubLibrary(ctx, flags, nativeAbiResult.stubSrc) objs := compileStubLibrary(ctx, flags, nativeAbiResult.stubSrc)
c.versionScriptPath = nativeAbiResult.versionScript c.versionScriptPath = nativeAbiResult.versionScript
if canDumpAbi(ctx.Config()) { if canDumpAbi(ctx.Config(), ctx.ModuleDir()) {
c.dumpAbi(ctx, nativeAbiResult.symbolList) c.dumpAbi(ctx, nativeAbiResult.symbolList)
if canDiffAbi(ctx.Config()) { if canDiffAbi(ctx.Config()) {
c.diffAbi(ctx) c.diffAbi(ctx)