From 9c8c5ab3c39e255aaf318ae85215ae05d0ac9c23 Mon Sep 17 00:00:00 2001 From: Aleksei Vetrov Date: Wed, 20 Sep 2023 13:09:25 +0000 Subject: [PATCH] NDK library: fix ABI monitoring error message Error message in case of not valid "nextAbiDump" included wrong "prebuiltAbiDump.InvalidReason()". Refactor error message to include "nextAbiDump.InvalidReason()" instead. Change-Id: I2581734dd16649af2b282b3459f461658abd3d87 Signed-off-by: Aleksei Vetrov --- cc/ndk_library.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cc/ndk_library.go b/cc/ndk_library.go index b3bb2da15..56c57b94c 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -386,9 +386,11 @@ func (this *stubDecorator) diffAbi(ctx ModuleContext) { // level. abiDiffPath := android.PathForModuleOut(ctx, "stgdiff.timestamp") prebuiltAbiDump := this.findPrebuiltAbiDump(ctx, this.apiLevel) + missingPrebuiltErrorTemplate := + "Did not find prebuilt ABI dump for %q (%q). Generate with " + + "//development/tools/ndk/update_ndk_abi.sh." missingPrebuiltError := fmt.Sprintf( - "Did not find prebuilt ABI dump for %q (%q). Generate with "+ - "//development/tools/ndk/update_ndk_abi.sh.", this.libraryName(ctx), + missingPrebuiltErrorTemplate, this.libraryName(ctx), prebuiltAbiDump.InvalidReason()) if !prebuiltAbiDump.Valid() { ctx.Build(pctx, android.BuildParams{ @@ -424,12 +426,15 @@ func (this *stubDecorator) diffAbi(ctx ModuleContext) { nextAbiDiffPath := android.PathForModuleOut(ctx, "abidiff_next.timestamp") nextAbiDump := this.findPrebuiltAbiDump(ctx, *nextApiLevel) + missingNextPrebuiltError := fmt.Sprintf( + missingPrebuiltErrorTemplate, this.libraryName(ctx), + nextAbiDump.InvalidReason()) if !nextAbiDump.Valid() { ctx.Build(pctx, android.BuildParams{ Rule: android.ErrorRule, Output: nextAbiDiffPath, Args: map[string]string{ - "error": missingPrebuiltError, + "error": missingNextPrebuiltError, }, }) } else {