Commit 2468f169 authored by Ben Cooksley's avatar Ben Cooksley

check-abi: make it possible to break the build.

Differential Revision: https://phabricator.kde.org/D19375
parent f3093de3
Pipeline #1164 skipped with stage
......@@ -19,6 +19,7 @@ import subprocess
import sys
import yaml
from helperslib import CommonUtils, ToolingSettings
from helperslib import Packages
from helperslib.Version import Version
......@@ -93,6 +94,12 @@ arguments = parser.parse_args()
# 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 @@ for key, entry in ourArchive.serverManifest.items():
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 @@ with open('abi-compatibility-results.yaml', 'w') as f:
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.")
......@@ -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:
......
......@@ -131,7 +131,7 @@ timestamps {
// 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
......
......@@ -130,7 +130,7 @@ timestamps {
// 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment