[libvirt PATCH 3/7] gitlab: fold sanitizer jobs into regular ubuntu jobs

Daniel P. Berrangé berrange at redhat.com
Fri Sep 10 08:56:22 UTC 2021


The sanitizer jobs run in ubuntu 20.04 containers and thus overlap with
testing already done for the regular ubuntu 20.04 build job. Fold the
sanitizer run for GCC into the regular build job and add a second
ubuntu 20.04 build job for CLang sanitizers.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 .gitlab-ci.yml | 53 ++++++++++++++------------------------------------
 1 file changed, 15 insertions(+), 38 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 24feb48c99..567ff91c82 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -61,7 +61,7 @@ stages:
   before_script:
     - *script_variables
   script:
-    - meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
+    - meson setup build --werror $MESON_ARGS || (cat build/meson-logs/meson-log.txt && exit 1)
     - meson dist -C build --no-tests
     - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
       then
@@ -71,27 +71,6 @@ stages:
         meson test -C build --no-suite syntax-check --print-errorlogs;
       fi
 
-.sanitizer_build_job:
-  stage: builds
-  image: $CI_REGISTRY_IMAGE/ci-ubuntu-2004:latest
-  needs:
-    - x64-ubuntu-2004-container
-  rules:
-    - if: "$TEMPORARILY_DISABLED"
-      allow_failure: true
-    - when: on_success
-  cache:
-    paths:
-      - ccache/
-    key: "$CI_JOB_NAME"
-  before_script:
-    - *script_variables
-  script:
-    - meson build --werror -Ddocs=disabled -Db_lundef=false -Db_sanitize="$SANITIZER"
-    - ninja -C build;
-    - ninja -C build test;
-  variables:
-    UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
 
 # Jobs that we delegate to Cirrus CI because they require an operating
 # system other than Linux. These jobs will only run if the required
@@ -418,6 +397,20 @@ x64-ubuntu-2004:
     - x64-ubuntu-2004-container
   variables:
     NAME: ubuntu-2004
+    ASAN_OPTIONS: verify_asan_link_order=0
+    MESON_ARGS: -Db_lundef=false -Db_sanitize=address,undefined
+    UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
+
+x64-ubuntu-2004-clang:
+  extends: .native_build_job
+  needs:
+    - x64-ubuntu-2004-container
+  variables:
+    NAME: ubuntu-2004
+    CC: clang
+    MESON_ARGS: -Db_lundef=false -Db_sanitize=address,undefined
+    UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
+
 
 x64-freebsd-12-build:
   extends: .cirrus_build_job
@@ -545,22 +538,6 @@ mingw64-fedora-rawhide:
     NAME: fedora-rawhide
     CROSS: mingw64
 
-# Sanitizers
-
-sanitize-gcc:
-  extends: .sanitizer_build_job
-  variables:
-    ASAN_OPTIONS: verify_asan_link_order=0
-    CC: gcc
-    SANITIZER: address,undefined
-
-sanitize-clang:
-  extends: .sanitizer_build_job
-  variables:
-    CC: clang
-    SANITIZER: address,undefined
-
-
 # This artifact published by this job is downloaded by libvirt.org to
 # be deployed to the web root:
 #    https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?job=website
-- 
2.31.1




More information about the libvir-list mailing list