From bf6d01598ff9e6d3ebd621d5f286e046d00920c4 Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Thu, 17 Feb 2022 07:36:14 -0800 Subject: [PATCH] feat(CI): Run AddressSanitizer on Fedora build Keep disabled for jobs that produce artifacts to not affect user performance. Keep disabled for other distros that don't produce artifacts as well since other versions of Qt fail themselves in e.g. TestSmileyPack's QGuiApplication usage. Don't enable thread sanitizer yet due to many Qt internal errors. This should still give us a significant increase in qTox coverage, even if we have low platform coverage. --- .ci-scripts/build-qtox-linux.sh | 12 ++++++++++-- .github/workflows/build-test-deploy.yaml | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.ci-scripts/build-qtox-linux.sh b/.ci-scripts/build-qtox-linux.sh index e49b0bc4a..73e936ce7 100755 --- a/.ci-scripts/build-qtox-linux.sh +++ b/.ci-scripts/build-qtox-linux.sh @@ -27,6 +27,7 @@ while (( $# > 0 )); do case $1 in --minimal) MINIMAL=1 ; shift ;; --full) MINIMAL=0; shift ;; + --sanitize) SANITIZE=1; shift ;; --build-type) BUILD_TYPE=$2; shift 2 ;; --help|-h) usage; exit 1 ;; *) echo "Unexpected argument $1"; usage; exit 1 ;; @@ -45,6 +46,11 @@ if [ -z "${BUILD_TYPE+x}" ]; then exit 1 fi +SANITIZE_ARGS="" +if [ ! -z ${SANITIZE+x} ]; then + SANITIZE_ARGS="-DASAN=ON" +fi + SRCDIR=/qtox export CTEST_OUTPUT_ON_FAILURE=1 @@ -53,14 +59,16 @@ if [ $MINIMAL -eq 1 ]; then -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DSMILEYS=DISABLED \ -DSTRICT_OPTIONS=ON \ - -DSPELL_CHECK=OFF + -DSPELL_CHECK=OFF \ + $SANITIZE_ARGS else cmake "$SRCDIR" \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DUPDATE_CHECK=ON \ -DSTRICT_OPTIONS=ON \ -DCODE_COVERAGE=ON \ - -DDESKTOP_NOTIFICATIONS=ON + -DDESKTOP_NOTIFICATIONS=ON \ + $SANITIZE_ARGS fi cmake --build . -- -j $(nproc) diff --git a/.github/workflows/build-test-deploy.yaml b/.github/workflows/build-test-deploy.yaml index b6e7665c0..8098ab66f 100644 --- a/.github/workflows/build-test-deploy.yaml +++ b/.github/workflows/build-test-deploy.yaml @@ -109,7 +109,7 @@ jobs: - name: Run build run: docker-compose run --rm almalinux ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} build-fedora: - name: Fedora + name: Fedora with ASAN runs-on: ubuntu-latest needs: build-fedora-docker strategy: @@ -123,7 +123,7 @@ jobs: with: docker_image_name: fedora - name: Run build - run: docker-compose run --rm fedora ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} + run: docker-compose run --rm fedora ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} --sanitize build-opensuse: name: Opensuse runs-on: ubuntu-latest