[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: Tue, 1 Jun 2021 09:22:29 +0000 (UTC)
commit 13914aeb1d23c22ccd9055a416d687c4b8b13eca
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon May 31 22:02:08 2021 +0300
ci: check ABI
.gitlab-ci.yml | 23 +++++++++++++++++++
check-abi | 55 ++++++++++++++++++++++++++++++++++++++++++++++
libgnome-panel/gp-applet.h | 4 ++--
3 files changed, 80 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 39f7c3927..b455e2ea9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,6 +4,7 @@ stages:
variables:
DEBIAN_FRONTEND: noninteractive
+ LAST_ABI_BREAK: 841fe4e32ff97b7725694dc60828048fa187f758
.install-ubuntu-dependencies: &install-ubuntu-dependencies
apt-get install -q -y --no-install-recommends
@@ -51,6 +52,28 @@ 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
+ universal-ctags
+ variables:
+ CFLAGS: "-g -Og"
+ script:
+ - ./check-abi ${LAST_ABI_BREAK} $(git rev-parse 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..acb4cdf6a
--- /dev/null
+++ b/check-abi
@@ -0,0 +1,55 @@
+#!/usr/bin/python3
+
+import argparse
+import os
+import subprocess
+import sys
+
+def dump_abi(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')
+
+ 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)
+
+ subprocess.check_call([
+ 'abi-dumper',
+ os.path.join(install_dir, 'lib', 'libgnome-panel.so'),
+ '-public-headers', os.path.join(install_dir, 'include'),
+ '-o', revision + '.dump',
+ '-all'
+ ])
+
+ return revision + '.dump'
+
+parser = argparse.ArgumentParser()
+parser.add_argument('old')
+parser.add_argument('new')
+args = parser.parse_args()
+
+if args.old == args.new:
+ sys.exit(0)
+
+try:
+ new_abi = dump_abi(args.new)
+ old_abi = dump_abi(args.old)
+
+ subprocess.check_call([
+ 'abi-compliance-checker',
+ '-check-private-abi',
+ '-show-retval',
+ '-force',
+ '-l', 'libgnome-panel',
+ '-old', old_abi,
+ '-new', new_abi
+ ])
+except subprocess.CalledProcessError as e:
+ sys.exit(e.returncode)
diff --git a/libgnome-panel/gp-applet.h b/libgnome-panel/gp-applet.h
index fa4d94046..df7895a46 100644
--- a/libgnome-panel/gp-applet.h
+++ b/libgnome-panel/gp-applet.h
@@ -72,6 +72,8 @@ struct _GpAppletClass
{
GtkEventBoxClass parent_class;
+ void (* remove_from_panel) (GpApplet *self);
+
gboolean (* initial_setup) (GpApplet *self,
GVariant *initial_settings,
GError **error);
@@ -80,8 +82,6 @@ struct _GpAppletClass
GtkOrientation orientation,
GtkPositionType position);
- void (* remove_from_panel) (GpApplet *self);
-
/*< private >*/
gpointer padding[9];
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]