diff --git a/helpers/create-abi-dump.py b/helpers/create-abi-dump.py --- a/helpers/create-abi-dump.py +++ b/helpers/create-abi-dump.py @@ -6,6 +6,7 @@ import argparse import tempfile import subprocess +import sys from collections import defaultdict from typing import Dict, List, Union @@ -288,23 +289,35 @@ if not scmRevision: scmRevision = subprocess.check_output(["git", "log", "--format=%H", "-n 1", "HEAD"]).strip().decode() +# Check every libraries ABI and do not fail, if one is not fine. +# Safe the overall retval state +retval = 0 + # Now we generate the ABI dumps for every library we have found for library in foundLibraries: - # Create the ABI Dump for this library - library.createABIDump( runtimeEnvironment=buildEnvironment ) - - # Determine where the ABI Dump archive is located - # This location is controlled by abi-compliance-checker, but follows a predictable pattern - fileName = "abi_dumps/{name}/{version}/ABI.dump".format(name=library.name,version=library.version) - - extraMetadata = { - "SONAME": max([t['SONAME'] for t in library.targets.values()]), # use max because there may be more than one lib inside - "version": library.version, - "libname": library.name, - "targets": list(library.targets), - "project": arguments.project, - "branchGroup": arguments.branchGroup, - "platform": arguments.platform, - } - packageName = "{name}_{scmRevision}_{platform}".format(name=library.name, scmRevision=scmRevision) - ourArchive.storePackage(packageName, fileName, scmRevision, extraMetadata) + try: + # Create the ABI Dump for this library + library.createABIDump( runtimeEnvironment=buildEnvironment ) + + # Determine where the ABI Dump archive is located + # This location is controlled by abi-compliance-checker, but follows a predictable pattern + fileName = "abi_dumps/{name}/{version}/ABI.dump".format(name=library.name,version=library.version) + + extraMetadata = { + "SONAME": max([t['SONAME'] for t in library.targets.values()]), # use max because there may be more than one lib inside + "version": library.version, + "libname": library.name, + "targets": list(library.targets), + "project": arguments.project, + "branchGroup": arguments.branchGroup, + "platform": arguments.platform, + } + packageName = "{name}_{scmRevision}_{platform}".format(name=library.name, scmRevision=scmRevision) + ourArchive.storePackage(packageName, fileName, scmRevision, extraMetadata) + except subprocess.CalledProcessError as e: + retval = e.returncode + logging.error("abi-complience-checker exited with {retval}".format(retval=retval)) + +# We had an issue with one of the ABIs +if retval != 0: + sys.exit(retval)