Fix m ndk.

Apparently treehugger doesn't cover this, and autosubmit fired before
I had a chance to upload the second PS.

Bug: None
Test: m ndk
Change-Id: I292f7349b98d5f9132ea41729933c1462e100a69
This commit is contained in:
Dan Albert
2024-09-18 20:45:44 +00:00
parent 3249ac6d3f
commit 9c8e0c4e64

View File

@@ -429,41 +429,45 @@ func (this *stubDecorator) diffAbi(ctx ModuleContext) {
// Also ensure that the ABI of the next API level (if there is one) matches // Also ensure that the ABI of the next API level (if there is one) matches
// this API level. *New* ABI is allowed, but any changes to APIs that exist // this API level. *New* ABI is allowed, but any changes to APIs that exist
// in this API level are disallowed. // in this API level are disallowed.
if !this.apiLevel.IsCurrent() && prebuiltAbiDump.Valid() { if prebuiltAbiDump.Valid() {
nextApiLevel := findNextApiLevel(ctx, this.apiLevel) nextApiLevel := findNextApiLevel(ctx, this.apiLevel)
if nextApiLevel == nil { if nextApiLevel == nil {
panic(fmt.Errorf("could not determine which API level follows "+ panic(fmt.Errorf("could not determine which API level follows "+
"non-current API level %s", this.apiLevel)) "non-current API level %s", this.apiLevel))
} }
nextAbiDiffPath := android.PathForModuleOut(ctx,
"abidiff_next.timestamp") // "current" ABI is not tracked.
nextAbiDump := this.findPrebuiltAbiDump(ctx, *nextApiLevel) if !nextApiLevel.IsCurrent() {
missingNextPrebuiltError := fmt.Sprintf( nextAbiDiffPath := android.PathForModuleOut(ctx,
missingPrebuiltErrorTemplate, this.libraryName(ctx), "abidiff_next.timestamp")
nextAbiDump.InvalidReason()) nextAbiDump := this.findPrebuiltAbiDump(ctx, *nextApiLevel)
if !nextAbiDump.Valid() { missingNextPrebuiltError := fmt.Sprintf(
ctx.Build(pctx, android.BuildParams{ missingPrebuiltErrorTemplate, this.libraryName(ctx),
Rule: android.ErrorRule, nextAbiDump.InvalidReason())
Output: nextAbiDiffPath, if !nextAbiDump.Valid() {
Args: map[string]string{ ctx.Build(pctx, android.BuildParams{
"error": missingNextPrebuiltError, Rule: android.ErrorRule,
}, Output: nextAbiDiffPath,
}) Args: map[string]string{
} else { "error": missingNextPrebuiltError,
ctx.Build(pctx, android.BuildParams{ },
Rule: stgdiff, })
Description: fmt.Sprintf( } else {
"Comparing ABI to the next API level %s %s", ctx.Build(pctx, android.BuildParams{
prebuiltAbiDump, nextAbiDump), Rule: stgdiff,
Output: nextAbiDiffPath, Description: fmt.Sprintf(
Inputs: android.Paths{ "Comparing ABI to the next API level %s %s",
prebuiltAbiDump.Path(), nextAbiDump.Path()}, prebuiltAbiDump, nextAbiDump),
Args: map[string]string{ Output: nextAbiDiffPath,
"args": "--format=small --ignore=interface_addition", Inputs: android.Paths{
}, prebuiltAbiDump.Path(), nextAbiDump.Path()},
}) Args: map[string]string{
"args": "--format=small --ignore=interface_addition",
},
})
}
this.abiDiffPaths = append(this.abiDiffPaths, nextAbiDiffPath)
} }
this.abiDiffPaths = append(this.abiDiffPaths, nextAbiDiffPath)
} }
} }