From 658bb4dad97d1e1fabb51d87d63df9ffed61c50f Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Fri, 30 Jun 2023 23:28:15 +0100 Subject: [PATCH] NDK library: switch abi diffing to STG Bug: 156513478 Change-Id: Ie45cb7daffb9861ed5bc26792f184bffcbe90bdb Signed-off-by: Matthias Maennich --- cc/ndk_library.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cc/ndk_library.go b/cc/ndk_library.go index c91d85078..e10e70def 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -31,9 +31,9 @@ import ( func init() { pctx.HostBinToolVariable("ndkStubGenerator", "ndkstubgen") - pctx.HostBinToolVariable("abidiff", "abidiff") pctx.HostBinToolVariable("abidw", "abidw") pctx.HostBinToolVariable("stg", "stg") + pctx.HostBinToolVariable("stgdiff", "stgdiff") } var ( @@ -58,14 +58,14 @@ var ( CommandDeps: []string{"$stg"}, }) - abidiff = pctx.AndroidStaticRule("abidiff", + stgdiff = pctx.AndroidStaticRule("stgdiff", blueprint.RuleParams{ // Need to create *some* output for ninja. We don't want to use tee // because we don't want to spam the build output with "nothing // changed" messages, so redirect output message to $out, and if // changes were detected print the output and fail. - Command: "$abidiff $args $in > $out || (cat $out && false)", - CommandDeps: []string{"$abidiff"}, + Command: "$stgdiff $args --stg $in -o $out || (cat $out && false)", + CommandDeps: []string{"$stgdiff"}, }, "args") ndkLibrarySuffix = ".ndk" @@ -392,7 +392,7 @@ func findNextApiLevel(ctx ModuleContext, apiLevel android.ApiLevel) *android.Api func (this *stubDecorator) diffAbi(ctx ModuleContext) { // Catch any ABI changes compared to the checked-in definition of this API // level. - abiDiffPath := android.PathForModuleOut(ctx, "abidiff.timestamp") + abiDiffPath := android.PathForModuleOut(ctx, "stgdiff.timestamp") prebuiltAbiDump := this.findPrebuiltAbiDump(ctx, this.apiLevel) missingPrebuiltError := fmt.Sprintf( "Did not find prebuilt ABI dump for %q (%q). Generate with "+ @@ -408,11 +408,14 @@ func (this *stubDecorator) diffAbi(ctx ModuleContext) { }) } else { ctx.Build(pctx, android.BuildParams{ - Rule: abidiff, - Description: fmt.Sprintf("abidiff %s %s", prebuiltAbiDump, + Rule: stgdiff, + Description: fmt.Sprintf("Comparing ABI %s %s", prebuiltAbiDump, this.abiDumpPath), Output: abiDiffPath, Inputs: android.Paths{prebuiltAbiDump.Path(), this.abiDumpPath}, + Args: map[string]string{ + "args": "--format=small", + }, }) } this.abiDiffPaths = append(this.abiDiffPaths, abiDiffPath) @@ -439,13 +442,13 @@ func (this *stubDecorator) diffAbi(ctx ModuleContext) { }) } else { ctx.Build(pctx, android.BuildParams{ - Rule: abidiff, + Rule: stgdiff, Description: fmt.Sprintf("abidiff %s %s", this.abiDumpPath, nextAbiDump), Output: nextAbiDiffPath, Inputs: android.Paths{this.abiDumpPath, nextAbiDump.Path()}, Args: map[string]string{ - "args": "--no-added-syms", + "args": "--format=small --ignore=interface_addition", }, }) }