[gnome-panel/wip/muktupavels/api-break] ci: check ABI
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/muktupavels/api-break] ci: check ABI
- Date: Mon, 31 May 2021 22:33:54 +0000 (UTC)
commit c19cebb8670d7822c6f393dd54824e585c921c12
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon May 31 22:02:08 2021 +0300
ci: check ABI
.gitlab-ci.yml | 22 ++++++++++++++++++++++
check-abi | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 39f7c3927..f1972a904 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,6 +4,7 @@ stages:
variables:
DEBIAN_FRONTEND: noninteractive
+ LAST_ABI_BREAK: 841fe4e32ff9
.install-ubuntu-dependencies: &install-ubuntu-dependencies
apt-get install -q -y --no-install-recommends
@@ -51,6 +52,27 @@ ubuntu:
- make
- make distcheck
+check-abi:
+ image: ubuntu:devel
+ stage: build
+ except:
+ - tags
+ before_script:
+ - apt-get update
+ - *install-ubuntu-dependencies
+ - apt-get install -q -y --no-install-recommends
+ abi-compliance-checker
+ abi-dumper
+ git
+ variables:
+ CFLAGS: "-g -Og"
+ script:
+ - ./check-abi ${LAST_ABI_BREAK} $(git rev-parse --short=12 HEAD)
+ artifacts:
+ paths:
+ - compat_reports/libgnome-panel/
+ when: always
+
coverity:
image: ubuntu:devel
stage: analysis
diff --git a/check-abi b/check-abi
new file mode 100755
index 000000000..d2ed3ea5a
--- /dev/null
+++ b/check-abi
@@ -0,0 +1,57 @@
+#!/usr/bin/python3
+
+import argparse
+import os
+import subprocess
+import sys
+
+def build_install(revision):
+ install_dir = os.path.normpath(os.path.join(os.getcwd(), 'install', revision))
+ build_dir = os.path.normpath(os.path.join(os.getcwd(), 'build', revision))
+ lib_dir = os.path.join(build_dir, 'libgnome-panel')
+
+ print(f'# Building and installing {revision} in {install_dir}', flush=True)
+
+ os.makedirs(build_dir)
+ subprocess.check_call(['git', 'checkout', '-q', revision])
+ subprocess.check_call([
+ '../../autogen.sh',
+ '--prefix=' + install_dir,
+ '--enable-debug=no'
+ ], cwd=build_dir)
+ subprocess.check_call(['make'], cwd=lib_dir)
+ subprocess.check_call(['make', 'install'], cwd=lib_dir)
+
+ return install_dir
+
+def compare(old_install, new_install):
+ print('# Comparing the two ABIs', flush=True)
+
+ old_lib = os.path.join(old_install, 'lib', 'libgnome-panel.so')
+ subprocess.check_call(['abi-dumper', old_lib, '-o', 'old.dump'])
+
+ new_lib = os.path.join(new_install, 'lib', 'libgnome-panel.so')
+ subprocess.check_call(['abi-dumper', new_lib, '-o', 'new.dump'])
+
+ subprocess.check_call([
+ 'abi-compliance-checker',
+ '-l', 'libgnome-panel',
+ '-old', 'old.dump',
+ '-new', 'new.dump'
+ ])
+
+parser = argparse.ArgumentParser()
+parser.add_argument('old')
+parser.add_argument('new')
+args = parser.parse_args()
+
+if args.old == args.new:
+ sys.exit(0)
+
+old_tree = build_install(args.old)
+new_tree = build_install(args.new)
+
+try:
+ compare(old_tree, new_tree)
+except subprocess.CalledProcessError as e:
+ sys.exit(e.returncode)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]