diff --git a/helpers/check-abi.py b/helpers/check-abi.py --- a/helpers/check-abi.py +++ b/helpers/check-abi.py @@ -19,6 +19,7 @@ import sys import yaml +from helperslib import CommonUtils, ToolingSettings from helperslib import Packages from helperslib.Version import Version @@ -93,6 +94,12 @@ # Initialize the archive manager ourArchive = Packages.Archive(arguments.environment, 'ABIReference', usingCache = True, contentsSuffix = ".abidump") +# get acc settings +localMetadataPath = os.path.join( CommonUtils.scriptsBaseDirectory(), 'local-metadata', 'abi-compliance-checker.yaml' ) + +accSettings = ToolingSettings.Loader( arguments.project, arguments.platform ) +accSettings.loadSpecificationFile( localMetadataPath ) + # Determine which SCM revision we are storing # This will be embedded into the package metadata which might help someone doing some debugging # GIT_COMMIT is set by Jenkins Git plugin, so we can rely on that for most of our builds @@ -144,6 +151,13 @@ except KeyError: continue +if not libraries: + if accSettings['NoLibrariesFoundFail']: + sys.exit("No libraries found and NoLibrariesFoundFail, so we fail hard.") + else: + logging.info("No libraries found.") + sys.exit(0) + # Find all availabe reference dumps # * same cmakePackage # * same SONAME otherwise we have a ABI bump and than it is safe to break ABI @@ -249,5 +263,5 @@ f.write(yaml.dump(resultsYamlFile, default_flow_style=False)) # We had an issue with one of the ABIs -if retval != 0: - sys.exit(retval) +if retval != 0 and accSettings['checkABIDumpFailHard']: + sys.exit("Errors detected and checkABIDumpFailHard is set, so we fail hard.") diff --git a/local-metadata/abi-compliance-checker.yaml b/local-metadata/abi-compliance-checker.yaml --- a/local-metadata/abi-compliance-checker.yaml +++ b/local-metadata/abi-compliance-checker.yaml @@ -24,6 +24,8 @@ add_include_paths: - /usr/lib64/qt5/mkspecs/linux-g++ createABIDumpFailHard: False + checkABIDumpFailHard: False + NoLibrariesFoundFail: False # "SUSEQt5.10": # special settings for one platform # gcc_options: diff --git a/pipeline-templates/Frameworks/SUSEQt5.11.template b/pipeline-templates/Frameworks/SUSEQt5.11.template --- a/pipeline-templates/Frameworks/SUSEQt5.11.template +++ b/pipeline-templates/Frameworks/SUSEQt5.11.template @@ -131,7 +131,7 @@ // Now perform the ABI Compatibility checks // This tool will produce reports stored at compat_reports/ which we will also need to capture sh """ - python3 -u ci-tooling/helpers/check-abi.py --project ${projectName} --branchGroup ${branchGroup} --platform ${currentPlatform} --environment production || true + python3 -u ci-tooling/helpers/check-abi.py --project ${projectName} --branchGroup ${branchGroup} --platform ${currentPlatform} --environment production """ // Save the ABI Compatibility reports for developers to review if necessary archiveArtifacts artifacts: 'compat_reports/*_compat_report.html', onlyIfSuccessful: false, allowEmptyArchive: true diff --git a/pipeline-templates/SUSEQt5.10.template b/pipeline-templates/SUSEQt5.10.template --- a/pipeline-templates/SUSEQt5.10.template +++ b/pipeline-templates/SUSEQt5.10.template @@ -130,7 +130,7 @@ // Now perform the ABI Compatibility checks // This tool will produce reports stored at compat_reports/ which we will also need to capture sh """ - python3 -u ci-tooling/helpers/check-abi.py --project ${projectName} --branchGroup ${branchGroup} --platform ${currentPlatform} --environment production || true + python3 -u ci-tooling/helpers/check-abi.py --project ${projectName} --branchGroup ${branchGroup} --platform ${currentPlatform} --environment production """ // Save the ABI Compatibility reports for developers to review if necessary archiveArtifacts artifacts: 'compat_reports/*_compat_report.html', onlyIfSuccessful: false, allowEmptyArchive: true