[v2] devtools: give some hints for ABI errors

Message ID 20200715121505.3949-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] devtools: give some hints for ABI errors |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

David Marchand July 15, 2020, 12:15 p.m. UTC
  abidiff can provide some more information about the ABI difference it
detected.
In all cases, a discussion on the mailing must happen but we can give
some hints to know if this is a problem with the script calling abidiff,
a potential ABI breakage or an unambiguous ABI breakage.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
---
Changes since v1:
- used arithmetic test,
- updated error message for generic errors,

---
 devtools/check-abi.sh | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
  

Comments

Aaron Conole July 15, 2020, 12:48 p.m. UTC | #1
David Marchand <david.marchand@redhat.com> writes:

> abidiff can provide some more information about the ABI difference it
> detected.
> In all cases, a discussion on the mailing must happen but we can give
> some hints to know if this is a problem with the script calling abidiff,
> a potential ABI breakage or an unambiguous ABI breakage.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Ray Kinsella <mdr@ashroe.eu>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
> ---
> Changes since v1:
> - used arithmetic test,
> - updated error message for generic errors,
>

Acked-by: Aaron Conole <aconole@redhat.com>
  
David Marchand July 16, 2020, 7:29 a.m. UTC | #2
On Wed, Jul 15, 2020 at 2:49 PM Aaron Conole <aconole@redhat.com> wrote:
> David Marchand <david.marchand@redhat.com> writes:
>
> > abidiff can provide some more information about the ABI difference it
> > detected.
> > In all cases, a discussion on the mailing must happen but we can give
> > some hints to know if this is a problem with the script calling abidiff,
> > a potential ABI breakage or an unambiguous ABI breakage.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > Acked-by: Ray Kinsella <mdr@ashroe.eu>
> > Acked-by: Neil Horman <nhorman@tuxdriver.com>
> Acked-by: Aaron Conole <aconole@redhat.com>

Applied.
  

Patch

diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh
index e17fedbd9f..172e934382 100755
--- a/devtools/check-abi.sh
+++ b/devtools/check-abi.sh
@@ -50,10 +50,22 @@  for dump in $(find $refdir -name "*.dump"); do
 		error=1
 		continue
 	fi
-	if ! abidiff $ABIDIFF_OPTIONS $dump $dump2; then
+	abidiff $ABIDIFF_OPTIONS $dump $dump2 || {
+		abiret=$?
 		echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $dump $dump2'"
 		error=1
-	fi
+		echo
+		if [ $(($abiret & 3)) -ne 0 ]; then
+			echo "ABIDIFF_ERROR|ABIDIFF_USAGE_ERROR, this could be a script or environment issue."
+		fi
+		if [ $(($abiret & 4)) -ne 0 ]; then
+			echo "ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged this as a potential issue)."
+		fi
+		if [ $(($abiret & 8)) -ne 0 ]; then
+			echo "ABIDIFF_ABI_INCOMPATIBLE_CHANGE, this change breaks the ABI."
+		fi
+		echo
+	}
 done
 
 [ -z "$error" ] || [ -n "$warnonly" ]