From 9d10bdfd0d90d6ea6a31bbd89243f3b23ff51e8d Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 28 Jun 2017 08:59:36 -0700 Subject: [PATCH] ci: unconditionally turn on -Werror Closes: #971 Approved by: cgwalters --- .papr.yml | 2 +- ci/build-check.sh | 6 +++--- ci/build.sh | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.papr.yml b/.papr.yml index be4c4f04..ac7c3278 100644 --- a/.papr.yml +++ b/.papr.yml @@ -14,7 +14,7 @@ packages: env: # Enable all the sanitizers for this primary build. # We only use -Werror=maybe-uninitialized here with a "fixed" toolchain - CFLAGS: '-fsanitize=undefined -fsanitize-undefined-trap-on-error -fsanitize=address -O2 -Wp,-D_FORTIFY_SOURCE=2 -Werror=maybe-uninitialized' + CFLAGS: '-fsanitize=undefined -fsanitize-undefined-trap-on-error -fsanitize=address -O2 -Wp,-D_FORTIFY_SOURCE=2' # Only for CI with a known g-ir-scanner GI_SCANNERFLAGS: '--warn-error' ASAN_OPTIONS: 'detect_leaks=0' # Right now we're not fully clean, but this gets us use-after-free etc diff --git a/ci/build-check.sh b/ci/build-check.sh index da03f3cc..677515b3 100755 --- a/ci/build-check.sh +++ b/ci/build-check.sh @@ -16,9 +16,9 @@ fi if test -x /usr/bin/clang; then git clean -dfx && git submodule foreach git clean -dfx - # And now a clang build to find unused variables; perhaps - # in the future these could parallelize + # And now a clang build to find unused variables because it does a better + # job than gcc for vars with cleanups; perhaps in the future these could + # parallelize export CC=clang - export CFLAGS='-Werror=unused-variable' build fi diff --git a/ci/build.sh b/ci/build.sh index eefb7c3c..a9a8ac3f 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -12,6 +12,9 @@ pkg_install sudo which attr fuse \ elfutils pkg_install_if_os fedora gjs gnome-desktop-testing parallel coccinelle clang +# always fail on warnings; https://github.com/ostreedev/ostree/pull/971 +export CFLAGS="-Werror ${CFLAGS:-}" + DETECTED_CONFIGOPTS= if test -x /usr/bin/gnome-desktop-testing-runner; then DETECTED_CONFIGOPTS="${DETECTED_CONFIGOPTS} --enable-installed-tests=exclusive"