[gnome-build-meta/jjardon/abi-check: 7/8] Add ABI checker from freedesktop-sdk



commit a0e65fa0e699697a5e3fa98958c00d0087633e16
Author: Thomas Coldrick <othko97 gmail com>
Date:   Sun Aug 25 09:18:44 2019 +0300

    Add ABI checker from freedesktop-sdk
    
    Adds the ABI checker as it currently stands in freedesktop-sdk. An ABI
    check is also added to the CI in the `reports` stage. In order for this
    to actually be run the variable $STABLE_ABI needs to be set, as we don't
    want this to fail on master.
    
    The ABI check is run on `abi/abi-image.bst`, which is an image
    constructed from the platform and the headers of the SDK. This is how
    things are done in freedesktop-sdk also.
    
    There is also `abidiff-suppressions.ini`, which allows for configuration
    of the ABI checker to ignore some libraries or symbols. This is copied
    from freedesktop-sdk also, as otherwise we would get failures from
    breakages allowed in freedesktop-sdk.

 .gitlab-ci.yml                 |  14 ++++
 elements/abi/abi-image.bst     |   5 ++
 elements/abi/sdk-headers.bst   |  12 +++
 utils/abidiff-suppressions.ini | 180 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 211 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1cd8f9b9..f3af7d85 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,6 +9,7 @@ variables:
   BST: "bst $BST_STRICT --config build.conf --log-file logs/build.log --colors"
   DOCKER_IMAGE_ID: '80f4a16af18b8641874fe037710dcaad4710ff50'
   FLATPAK_BRANCH: master
+  STABLE_ABI: false
 
   # Docker Images
   DOCKER_REGISTRY: "registry.gitlab.com/freedesktop-sdk/infrastructure/freedesktop-sdk-docker-images"
@@ -316,3 +317,16 @@ cve_report:
     - cve-reports
   rules:
   - if: $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^gnome-\d-\d\d$/
+
+check_abi:
+  <<: *x86_64
+  stage: reports
+  dependencies: [build]
+  script:
+    - if [ $STABLE_ABI != 'false' ]; then \
+        REFERENCE=$(git merge-base origin/$FLATPAK_BRANCH HEAD) \
+        ./utils/buildstream-abi-checker/check-abi ---suppressions=utils/abidiff-suppressions.ini 
-old=$REFERENCE --new=HEAD abi/abi-image.bst
+      fi
+  only:
+    - master
+    - /^gnome-\d-\d\d$/
diff --git a/elements/abi/abi-image.bst b/elements/abi/abi-image.bst
new file mode 100644
index 00000000..2c16e346
--- /dev/null
+++ b/elements/abi/abi-image.bst
@@ -0,0 +1,5 @@
+kind: stack
+
+depends:
+- filename: flatpak/platform-image.bst
+- filename: abi/sdk-headers.bst
diff --git a/elements/abi/sdk-headers.bst b/elements/abi/sdk-headers.bst
new file mode 100644
index 00000000..aa1ecb25
--- /dev/null
+++ b/elements/abi/sdk-headers.bst
@@ -0,0 +1,12 @@
+kind: manual
+
+description: Extract the library headers from the desktop Sdk.
+
+depends:
+- filename: flatpak/sdk-image.bst
+  type: build
+
+config:
+  install-commands:
+  - mkdir -p %{install-root}%{includedir}
+  - cp -a %{includedir}/* %{install-root}%{includedir}
diff --git a/utils/abidiff-suppressions.ini b/utils/abidiff-suppressions.ini
new file mode 100644
index 00000000..ffc02176
--- /dev/null
+++ b/utils/abidiff-suppressions.ini
@@ -0,0 +1,180 @@
+# -- Begin rules for gdk-pixbuf -----------------------------------------------
+[suppress_file]
+label = gdk-pixbuf loaders are only used by the main gdk-pxbuf library
+file_name_regexp = ^libpixbufloader-.*\\.so.*
+drop = yes
+
+[suppress_function]
+label = Public functions in gdk-pixbuf all are namespaced
+soname_regexp = ^libgdk_pixbuf-2\\.0\\.so\\.0$
+name_not_regexp = ^gdk_(pixbuf|pixdata)_.*
+# -- End rules for gdk-pixbuf -------------------------------------------------
+
+# -- Begin rules for glib -----------------------------------------------------
+
+[suppress_function]
+label = Debug function in glib that was never supposed to be present in ABI
+soname_regexp = ^libglib-2.0.so.0$
+name_regexp = ^g_slice_debug_tree_statistics*
+
+# -- End rules for glib -------------------------------------------------------
+
+# -- Begin rules for harfbuzz -------------------------------------------------
+[suppress_file]
+label = Experimental library, its API changes regularly
+file_name_regexp = ^libharfbuzz-subset\\.so.*
+# -- End rules for harfbuzz ---------------------------------------------------
+
+
+# -- Begin rules for ibus -----------------------------------------------------
+[suppress_type]
+label = APIs used on the host, not inside Flatpak
+soname_regexp = ^libibus-1\\.0\\.so\\.5$
+name_regexp = IBus(Component|Config|Engine|LookupTable|PanelService|Registry).*
+drop = yes
+
+[suppress_function]
+label = APIs used on the host, not inside Flatpak
+soname_regexp = ^libibus-1\\.0\\.so\\.5$
+name_regexp = ^ibus_(component|config|engine|lookup_table|panel_service|registry)_.*
+drop = yes
+# -- End rules for ibus -------------------------------------------------------
+
+
+# -- Begin rules for libdrm ---------------------------------------------------
+[suppress_file]
+label = This is really only used by drivers
+file_name_regexp = ^libdrm_(amdgpu|etnaviv|freedreno|intel|nouveau|omap|radeon|tegra)\\.so.*
+# -- End rules for libdrm -----------------------------------------------------
+
+
+# -- Begin rules for libglvnd -------------------------------------------------
+[suppress_function]
+# https://github.com/KhronosGroup/OpenGL-Registry/commit/78379073350ef9cf99fe313e3392d19ae6c9744d
+label = Removed on purpose as it was misnamed, no app should have used it
+soname_regexp = libGL\\.so\\.1
+symbol_name = glMultiDrawElementsBaseVertexOES
+change_kind = deleted-function
+drop = yes
+# -- End rules for libglvnd ---------------------------------------------------
+
+
+# -- Begin rules for Mesa -----------------------------------------------------
+[suppress_function]
+label = Vulkan drivers export a lot of functions which are not actually part of ABI
+soname_regexp = ^libvulkan_.*\\.so$
+symbol_name_not_regexp = ^vk_.*
+change_kind = deleted-function
+drop = yes
+
+[suppress_file]
+label = lib*_mesa.so are not to be linked directly but to be used with dispatchers
+file_name_regexp = ^lib(EGL|GLX)_mesa\\.so.*$
+
+[suppress_file]
+label = libvulkan_o.so are not to be linked directly but to be used with dispatchers
+file_name_regexp = ^libvulkan_(radeon|intel)\\.so.*$
+
+[suppress_file]
+label = libglapi is a private library to Mesa
+file_name_regexp = ^libglapi\\.so.*$
+
+[suppress_file]
+label = libgallium_dri is a private library to Mesa
+file_name_regexp = ^libgallium_dri\\.so.*$
+# -- End rules for Mesa -------------------------------------------------------
+
+
+# -- Begin rules for Python ---------------------------------------------------
+[suppress_function]
+label = Private functions
+soname_regexp = ^libpython.*\\.so.*$
+symbol_name_regexp = ^(_py|_Py|_PY).*$
+drop = yes
+
+# -- End rules for Python -----------------------------------------------------
+
+
+# -- Begin rules for nss ------------------------------------------------------
+[suppress_type]
+label = Added enum values guarded by sentinel are safe
+type_kind = enum
+soname_regexp = ^libnss3\\.so|libsmime3\\.so|libnssutil3\\.so$
+changed_enumerators = SEC_OID_TOTAL
+# -- End rules for nss --------------------------------------------------------
+
+# -- Begin rules for seccomp --------------------------------------------------
+[suppress_type]
+label = Added enum values guarded by sentinel are safe
+type_kind = enum
+name = scmp_filter_attr
+soname_regexp = ^libseccomp\\.so\\.\\d+$
+changed_enumerators = _SCMP_FLTATR_MAX
+# -- End rules for seccomp ----------------------------------------------------
+
+
+# -- Begin rules for libcurl  -------------------------------------------------
+[suppress_type]
+label = Added enum values guarded by sentinel are safe
+type_kind = enum
+soname_regexp = ^libcurl\\.so\\.4$
+changed_enumerators = CURLOPT_LASTENTRY
+# -- End rules for nss --------------------------------------------------------
+
+
+# -- Begin rules for glibc ----------------------------------------------------
+[suppress_function]
+# https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=67c0579669ba1fc265d770252fab31babf887329
+label = Ignore functions symbols incorrectly exposed by glibc
+symbol_name_regexp = ^_fini|_init$
+change_kind = deleted-function
+# -- End rules for glibc ------------------------------------------------------
+
+
+# -- Begin rules for libabigail issues ----------------------------------------
+[suppress_file]
+# https://sourceware.org/bugzilla/show_bug.cgi?id=23596
+label = This takes more RAM than we have
+file_name_regexp = ^libLLVM-.*\\.so.*
+
+[suppress_file]
+# https://sourceware.org/bugzilla/show_bug.cgi?id=23596
+label = This takes more RAM than we have
+file_name_regexp = ^libclang\\.so.*
+
+[suppress_function]
+# https://sourceware.org/bugzilla/show_bug.cgi?id=23795
+label = Ignore libstdc++ symbols incorrectly exported by in other libraries
+soname_not_regexp = ^libstdc\\+\\+\\.so.*
+name_regexp = ^(__gnu_cxx|std\\:\\:__cxx11)\\:\\:.*
+# -- End rules for libabigail issues ------------------------------------------
+
+# -- Begin rules for libavcodec.so --------------------------------------------
+[suppress_function]
+label = av1_* symbols are libaom.so symbols not libavcodec.so
+soname_regexp = libavcodec\\.so\\.58
+symbol_name_regexp = ^av1_
+change_kind = deleted-function
+drop = yes
+
+[suppress_variable]
+label = av1_* symbols are libaom.so symbols not libavcodec.so
+soname_regexp = libavcodec\\.so\\.58
+symbol_name_regexp = ^av1_
+change_kind = deleted-variable
+drop = yes
+# -- End rules for libavcodec.so ----------------------------------------------
+
+# -- Begin rules for gnutls ---------------------------------------------------
+[suppress_function]
+# https://gitlab.com/gnutls/gnutls/issues/749#note_158170265
+label = Ignore functions with _gnutls prefix which are internal ones for unit testing
+soname_regexp = ^libgnutls\\.so\\.*
+symbol_name_regexp = ^_gnutls_*
+# -- End rules for gnutls  ----------------------------------------------------
+
+# -- Begin rules for pulseaudio -----------------------------------------------
+[suppress_file]
+label = Private library for pulseaudio
+file_name_regexp = ^libpulsecommon-.*\\.so
+# -- End rules for pulseaudio -------------------------------------------------


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]