]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
ci: build dbus with clang as well
authorEvgeny Vereshchagin <evvers@ya.ru>
Mon, 10 Oct 2022 06:17:38 +0000 (06:17 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Thu, 13 Oct 2022 03:20:07 +0000 (03:20 +0000)
It should make it possible to catch issues like
like https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/357

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
.gitlab-ci.yml
tools/ci-build.sh
tools/ci-install.sh

index eef23778e7988e873f85ae9156aea9c61e2bf4cc..2fd5a04e834903c85ad00aabb735ab55a5cbc57d 100644 (file)
@@ -196,6 +196,15 @@ debian meson:
   variables:
     ci_buildsys: "meson-dist"
 
+debian meson clang debug:
+  extends:
+    - .meson-common
+    - .debian-build
+  variables:
+    ci_buildsys: "meson-dist"
+    ci_compiler: "clang"
+    ci_variant: "debug"
+
 debian mingw32 autotools debug:
   extends: .debian-build
   variables:
index 0e72b2d9ccc35a4a8d8992e956f9fc4da235d933..6420cdcb17a278139e83a26e2c79b37f6b34580d 100755 (executable)
@@ -77,6 +77,10 @@ init_wine() {
 # Build system under test: autotools or cmake
 : "${ci_buildsys:=autotools}"
 
+# ci_compiler:
+# Compiler used to build dbus: gcc or clang
+: "${ci_compiler:=gcc}"
+
 # ci_distro:
 # OS distribution in which we are testing
 # Typical values: auto (detect at runtime), ubuntu, debian; maybe fedora in future
@@ -522,6 +526,12 @@ case "$ci_buildsys" in
                         ;;
                     (*)
                         set -- -Db_sanitize=address,undefined "$@"
+
+                        # https://github.com/mesonbuild/meson/issues/764
+                        if [ "$ci_compiler" = "clang" ]; then
+                            set -- -Db_lundef=false "$@"
+                        fi
+
                         set -- -Db_pie=true "$@"
                         set -- -Duser_session=true "$@"
                         ;;
@@ -531,6 +541,14 @@ case "$ci_buildsys" in
                 ;;
         esac
 
+        case "$ci_compiler" in
+            (clang)
+                export CC=clang
+                ;;
+            (*)
+                ;;
+        esac
+
         # Debian doesn't have similar convenience wrappers, but we can use
         # a cross-file
         if [ -z "$meson_setup" ] || ! command -v "$meson_setup" >/dev/null; then
@@ -548,7 +566,7 @@ case "$ci_buildsys" in
 
         $meson_setup "$@" "$srcdir"
         meson compile -v
-        [ "$ci_test" = no ] || meson test
+        [ "$ci_test" = no ] || meson test --print-errorlogs
         DESTDIR=DESTDIR meson install
         ( cd DESTDIR && find . -ls)
         ;;
index c53ede9bb745f3107dd888d73aac593acd020af5..b259a58ec4a076218bf10e7745df61e29db4c32f 100755 (executable)
@@ -148,6 +148,7 @@ case "$ci_distro" in
             autotools-dev
             ca-certificates
             ccache
+            clang
             cmake
             debhelper
             dh-autoreconf
@@ -169,6 +170,7 @@ case "$ci_distro" in
             libselinux1-dev
             libsystemd-dev
             libx11-dev
+            llvm
             meson
             ninja-build
             sudo