From 9544f4411ef1ed9379ad42ce0ca124196f20f541 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 2 Apr 2022 18:01:39 -0500
Subject: [PATCH 08/23] cirrus/linux: compile with -fsanitize

One concern about this is that the CompilerWarnings task currently
depends on it, and it seems important to avoid slowing down cfbot by
slowing down the Linux task so much that the Linux+Warnings takes longer
than windows.  Maybe Warnings should depend on Freebsd, which is now the
fastest OS.

ci-os-only: linux
---
 .cirrus.yml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index c5a7f4d8cc4..2cabe6b7ec1 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -211,8 +211,8 @@ task:
         CC="ccache gcc" \
         CXX="ccache g++" \
         CLANG="ccache clang" \
-        CFLAGS="-Og -ggdb" \
-        CXXFLAGS="-Og -ggdb"
+        CFLAGS="-Og -ggdb -fsanitize=undefined,alignment -fno-sanitize-recover=all" \
+        CXXFLAGS="-Og -ggdb -fsanitize=undefined,alignment -fno-sanitize-recover=all"
     EOF
 
   build_script: |
@@ -491,9 +491,13 @@ task:
 task:
   name: CompilerWarnings
 
-  # To limit unnecessary work only run this once the normal linux test succeeds
+  # To limit unnecessary work only run this after success of freebsd
   depends_on:
-    - Linux - Debian Bullseye
+    - FreeBSD - 13
+
+  # task that did not run, count as a success, so we need to recheck freebsd's
+  # condition here; cirus warns if the "only_if" condition doesn't match the task being depended on
+  only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
 
   env:
     CPUS: 4
@@ -506,10 +510,6 @@ task:
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
 
-  # task that did not run, count as a success, so we need to recheck Linux'
-  # condition here ...
-  only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
-
   container:
     image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
     cpu: $CPUS
-- 
2.17.1

