Page MenuHomePhabricator

[CI] Enable -Werror where possible
ClosedPublic

Authored by Fabien on Jun 1 2020, 15:00.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCc88c96fd554a: [CI] Enable -Werror where possible
Summary

The CI build-werror plan turns some warnings into error according to
what is defined by the cmake ENABLE_WERROR option, and only applies to
the default target built with Clang.
This diffs turns that build plan into a clang-10 build plan instead, and makes
the CI use the -Werror flag over all the regular builds. This will allow for preventing
warnings to get introduced for clang-8, clang-10 and gcc-8, with various flag
configurations.

Test Plan

Run all the "regular" CI build plans.

Event Timeline

Fabien requested review of this revision.Jun 1 2020, 15:00
Fabien retitled this revision from [CI] Actually make build-werror build with -Werror to [CI] Enable -Werror where possible.Jun 2 2020, 09:59
Fabien edited the summary of this revision. (Show Details)
Fabien edited the test plan for this revision. (Show Details)

Use -Werror for all regular builds

Fabien planned changes to this revision.Jun 2 2020, 11:58

Snippet of first build failure:

[11:59:22]W:	 [Step 1/2] + : build-diff
[11:59:22]W:	 [Step 1/2] + '[' -z build-diff ']'
[11:59:22]W:	 [Step 1/2] + echo 'Running build configuration '\''build-diff'\''...'
[11:59:22]W:	 [Step 1/2] ++ git rev-parse --show-toplevel
[11:59:22]W:	 [Step 1/2] + TOPLEVEL=/work
[11:59:22]W:	 [Step 1/2] + export TOPLEVEL
[11:59:22]W:	 [Step 1/2] + trap print_sanitizers_log ERR
[11:59:22]W:	 [Step 1/2] +++ dirname ./contrib/teamcity/build-configurations.sh
[11:59:22]W:	 [Step 1/2] ++ cd ./contrib/teamcity
[11:59:22]W:	 [Step 1/2] ++ pwd
[11:59:22]W:	 [Step 1/2] + CI_SCRIPTS_DIR=/work/contrib/teamcity
[11:59:22]W:	 [Step 1/2] + DEVTOOLS_DIR=/work/contrib/devtools
[11:59:22]W:	 [Step 1/2] + setup
[11:59:22]W:	 [Step 1/2] + : /work/build
[11:59:22]W:	 [Step 1/2] + mkdir -p /work/build
[11:59:22]W:	 [Step 1/2] ++ cd /work/build
[11:59:22]W:	 [Step 1/2] ++ pwd
[11:59:22]W:	 [Step 1/2] + BUILD_DIR=/work/build
[11:59:22]W:	 [Step 1/2] + export BUILD_DIR
[11:59:22]W:	 [Step 1/2] + cd /work/build
[11:59:22]W:	 [Step 1/2] ++ nproc
[11:59:22]W:	 [Step 1/2] + THREADS=12
[11:59:22]W:	 [Step 1/2] + export THREADS
[11:59:22]W:	 [Step 1/2] + CMAKE_PLATFORMS_DIR=/work/cmake/platforms
[11:59:22]W:	 [Step 1/2] + SAN_SUPP_DIR=/work/test/sanitizer_suppressions
[11:59:22]W:	 [Step 1/2] + SAN_LOG_DIR=/tmp/sanitizer_logs
[11:59:22]W:	 [Step 1/2] + mkdir -p /tmp/sanitizer_logs
[11:59:22]W:	 [Step 1/2] + rm -rf '/tmp/sanitizer_logs/*'
[11:59:22]W:	 [Step 1/2] + export ASAN_OPTIONS=log_path=/tmp/sanitizer_logs/asan.log
[11:59:22]W:	 [Step 1/2] + ASAN_OPTIONS=log_path=/tmp/sanitizer_logs/asan.log
[11:59:22]W:	 [Step 1/2] + export LSAN_OPTIONS=log_path=/tmp/sanitizer_logs/lsan.log
[11:59:22]W:	 [Step 1/2] + LSAN_OPTIONS=log_path=/tmp/sanitizer_logs/lsan.log
[11:59:22]W:	 [Step 1/2] + export TSAN_OPTIONS=log_path=/tmp/sanitizer_logs/tsan.log
[11:59:22]W:	 [Step 1/2] + TSAN_OPTIONS=log_path=/tmp/sanitizer_logs/tsan.log
[11:59:22]W:	 [Step 1/2] + export UBSAN_OPTIONS=log_path=/tmp/sanitizer_logs/ubsan.log
[11:59:22]W:	 [Step 1/2] + UBSAN_OPTIONS=log_path=/tmp/sanitizer_logs/ubsan.log
[11:59:22]W:	 [Step 1/2] + UNIT_TESTS_JUNIT_LOG_LEVEL=message
[11:59:22]W:	 [Step 1/2] + case "$ABC_BUILD_NAME" in
[11:59:22]W:	 [Step 1/2] + /work/contrib/devtools/build_cmake.sh --Werror
[11:59:22]W:	 [Step 1/2] + : /work
[11:59:22]W:	 [Step 1/2] + : /work/build
[11:59:22]W:	 [Step 1/2] + : '()'
[11:59:22]W:	 [Step 1/2] + mkdir -p /work/build
[11:59:22]W:	 [Step 1/2] + cd /work/build
[11:59:22]W:	 [Step 1/2] + git clean -xffd
[11:59:22]W:	 [Step 1/2] + case "$1" in
[11:59:22]W:	 [Step 1/2] + CMAKE_FLAGS+=("-DCMAKE_C_FLAGS=-Werror" "-DCMAKE_CXX_FLAGS=-Werror")
[11:59:22]W:	 [Step 1/2] + read -a CMAKE_FLAGS
[11:59:22]W:	 [Step 1/2] + cmake -GNinja .. '()'
[11:59:22]W:	 [Step 1/2] CMake Error: The source directory "/work/build/()" does not exist.
[11:59:22]W:	 [Step 1/2] Specify --help for usage, or press the help button on the CMake GUI.
[11:59:22]W:	 [Step 1/2] ++ print_sanitizers_log
[11:59:22]W:	 [Step 1/2] ++ for log in "${SAN_LOG_DIR}"/*.log.*
[11:59:22]W:	 [Step 1/2] ++ echo '*** Output of /tmp/sanitizer_logs/*.log.* ***'
[11:59:22]W:	 [Step 1/2] ++ cat '/tmp/sanitizer_logs/*.log.*'
[11:59:22] :	 [Step 1/2] *** Output of /tmp/sanitizer_logs/*.log.* ***
[11:59:22]W:	 [Step 1/2] cat: '/tmp/sanitizer_logs/*.log.*': No such file or directory
[11:59:22]W:	 [Step 1/2] cp: cannot stat '/work/ibd/debug.log': No such file or directory
[11:59:26]W:	 [Step 1/2] Process exited with code 1
[11:59:26]E:	 [Step 1/2] Process exited with code 1 (Step: Command Line)

Snippet of first build failure:

[11:51:51] :			 [Update checkout directory (/home/teamcity/buildAgent/work/jailed-build/bitcoin-abc)] /usr/bin/git clean -f -d -x
[11:51:51] : Build preparation done
[11:51:51]E: Step 1/2: Command Line (7m:36s)
[11:51:51] :	 [Step 1/2] Ant JUnit report watcher
[11:51:51] :		 [Ant JUnit report watcher] Watching paths:
[11:51:51] :		 [Ant JUnit report watcher] +:results/test_bitcoin.xml
[11:51:51] :		 [Ant JUnit report watcher] +:results/**/junit_results*.xml
[11:51:51] :	 [Step 1/2] Starting: /home/teamcity/buildAgent/temp/agentTmp/custom_script3038792778423787210
[11:51:51] :	 [Step 1/2] in directory: /home/teamcity/buildAgent/work/jailed-build
[11:51:51] :	 [Step 1/2] ~/buildAgent/work/jailed-build/bitcoin-abc ~/buildAgent/work/jailed-build
[11:51:51] :	 [Step 1/2] ~/buildAgent/work/jailed-build
[11:51:51] :	 [Step 1/2] Building base image for: fe75499d6...
[11:51:51] :	 [Step 1/2] ~/buildAgent/work/jailed-build/bitcoin-abc ~/buildAgent/work/jailed-build
[11:51:53] :	 [Step 1/2] ~/buildAgent/work/jailed-build
[11:51:53] :	 [Step 1/2] Tag name: abc-base-image-fe75499d6
[11:59:24]W:	 [Step 1/2] + : build-werror
[11:59:24] :	 [Step 1/2] Running build configuration 'build-werror'...
[11:59:24]W:	 [Step 1/2] + '[' -z build-werror ']'
[11:59:24]W:	 [Step 1/2] + echo 'Running build configuration '\''build-werror'\''...'
[11:59:24]W:	 [Step 1/2] ++ git rev-parse --show-toplevel
[11:59:24]W:	 [Step 1/2] + TOPLEVEL=/work
[11:59:24]W:	 [Step 1/2] + export TOPLEVEL
[11:59:24]W:	 [Step 1/2] + trap print_sanitizers_log ERR
[11:59:24]W:	 [Step 1/2] +++ dirname ./contrib/teamcity/build-configurations.sh
[11:59:24]W:	 [Step 1/2] ++ cd ./contrib/teamcity
[11:59:24]W:	 [Step 1/2] ++ pwd
[11:59:24]W:	 [Step 1/2] + CI_SCRIPTS_DIR=/work/contrib/teamcity
[11:59:24]W:	 [Step 1/2] + DEVTOOLS_DIR=/work/contrib/devtools
[11:59:24]W:	 [Step 1/2] + setup
[11:59:24]W:	 [Step 1/2] + : /work/build
[11:59:24]W:	 [Step 1/2] + mkdir -p /work/build
[11:59:24]W:	 [Step 1/2] ++ cd /work/build
[11:59:24]W:	 [Step 1/2] ++ pwd
[11:59:24]W:	 [Step 1/2] + BUILD_DIR=/work/build
[11:59:24]W:	 [Step 1/2] + export BUILD_DIR
[11:59:24]W:	 [Step 1/2] + cd /work/build
[11:59:24]W:	 [Step 1/2] ++ nproc
[11:59:24]W:	 [Step 1/2] + THREADS=12
[11:59:24]W:	 [Step 1/2] + export THREADS
[11:59:24]W:	 [Step 1/2] + CMAKE_PLATFORMS_DIR=/work/cmake/platforms
[11:59:24]W:	 [Step 1/2] + SAN_SUPP_DIR=/work/test/sanitizer_suppressions
[11:59:24]W:	 [Step 1/2] + SAN_LOG_DIR=/tmp/sanitizer_logs
[11:59:24]W:	 [Step 1/2] + mkdir -p /tmp/sanitizer_logs
[11:59:24]W:	 [Step 1/2] + rm -rf '/tmp/sanitizer_logs/*'
[11:59:24]W:	 [Step 1/2] + export ASAN_OPTIONS=log_path=/tmp/sanitizer_logs/asan.log
[11:59:24]W:	 [Step 1/2] + ASAN_OPTIONS=log_path=/tmp/sanitizer_logs/asan.log
[11:59:24]W:	 [Step 1/2] + export LSAN_OPTIONS=log_path=/tmp/sanitizer_logs/lsan.log
[11:59:24]W:	 [Step 1/2] + LSAN_OPTIONS=log_path=/tmp/sanitizer_logs/lsan.log
[11:59:24]W:	 [Step 1/2] + export TSAN_OPTIONS=log_path=/tmp/sanitizer_logs/tsan.log
[11:59:24]W:	 [Step 1/2] + TSAN_OPTIONS=log_path=/tmp/sanitizer_logs/tsan.log
[11:59:24]W:	 [Step 1/2] + export UBSAN_OPTIONS=log_path=/tmp/sanitizer_logs/ubsan.log
[11:59:24]W:	 [Step 1/2] + UBSAN_OPTIONS=log_path=/tmp/sanitizer_logs/ubsan.log
[11:59:24]W:	 [Step 1/2] + UNIT_TESTS_JUNIT_LOG_LEVEL=message
[11:59:24] :	 [Step 1/2] Error: Invalid build name 'build-werror'
[11:59:24]W:	 [Step 1/2] + case "$ABC_BUILD_NAME" in
[11:59:24]W:	 [Step 1/2] + echo 'Error: Invalid build name '\''build-werror'\'''
[11:59:24]W:	 [Step 1/2] + exit 2
[11:59:24]W:	 [Step 1/2] cp: cannot stat '/work/ibd/debug.log': No such file or directory
[11:59:28]W:	 [Step 1/2] Process exited with code 2
[11:59:28]E:	 [Step 1/2] Process exited with code 2 (Step: Command Line)

Snippet of first build failure:

[11:58:26] :			 [Update checkout directory (/home/teamcity/buildAgent/work/jailed-build/bitcoin-abc)] /usr/bin/git clean -f -d -x
[11:58:26] : Build preparation done
[11:58:26]E: Step 1/2: Command Line (7m:36s)
[11:58:26] :	 [Step 1/2] Ant JUnit report watcher
[11:58:26] :		 [Ant JUnit report watcher] Watching paths:
[11:58:26] :		 [Ant JUnit report watcher] +:results/test_bitcoin.xml
[11:58:26] :		 [Ant JUnit report watcher] +:results/**/junit_results*.xml
[11:58:26] :	 [Step 1/2] Starting: /home/teamcity/buildAgent/temp/agentTmp/custom_script1842429255337785482
[11:58:26] :	 [Step 1/2] in directory: /home/teamcity/buildAgent/work/jailed-build
[11:58:26] :	 [Step 1/2] ~/buildAgent/work/jailed-build/bitcoin-abc ~/buildAgent/work/jailed-build
[11:58:26] :	 [Step 1/2] ~/buildAgent/work/jailed-build
[11:58:26] :	 [Step 1/2] Building base image for: 68475c6bc...
[11:58:26] :	 [Step 1/2] ~/buildAgent/work/jailed-build/bitcoin-abc ~/buildAgent/work/jailed-build
[11:58:28] :	 [Step 1/2] ~/buildAgent/work/jailed-build
[11:58:28] :	 [Step 1/2] Tag name: abc-base-image-68475c6bc
[12:06:02] :	 [Step 1/2] Running build configuration 'build-werror'...
[12:06:02]W:	 [Step 1/2] + : build-werror
[12:06:02]W:	 [Step 1/2] + '[' -z build-werror ']'
[12:06:02]W:	 [Step 1/2] + echo 'Running build configuration '\''build-werror'\''...'
[12:06:02]W:	 [Step 1/2] ++ git rev-parse --show-toplevel
[12:06:02]W:	 [Step 1/2] + TOPLEVEL=/work
[12:06:02]W:	 [Step 1/2] + export TOPLEVEL
[12:06:02]W:	 [Step 1/2] + trap print_sanitizers_log ERR
[12:06:02]W:	 [Step 1/2] +++ dirname ./contrib/teamcity/build-configurations.sh
[12:06:02]W:	 [Step 1/2] ++ cd ./contrib/teamcity
[12:06:02]W:	 [Step 1/2] ++ pwd
[12:06:02]W:	 [Step 1/2] + CI_SCRIPTS_DIR=/work/contrib/teamcity
[12:06:02]W:	 [Step 1/2] + DEVTOOLS_DIR=/work/contrib/devtools
[12:06:02]W:	 [Step 1/2] + setup
[12:06:02]W:	 [Step 1/2] + : /work/build
[12:06:02]W:	 [Step 1/2] + mkdir -p /work/build
[12:06:02]W:	 [Step 1/2] ++ cd /work/build
[12:06:02]W:	 [Step 1/2] ++ pwd
[12:06:02]W:	 [Step 1/2] + BUILD_DIR=/work/build
[12:06:02]W:	 [Step 1/2] + export BUILD_DIR
[12:06:02]W:	 [Step 1/2] + cd /work/build
[12:06:02]W:	 [Step 1/2] ++ nproc
[12:06:02]W:	 [Step 1/2] + THREADS=12
[12:06:02]W:	 [Step 1/2] + export THREADS
[12:06:02]W:	 [Step 1/2] + CMAKE_PLATFORMS_DIR=/work/cmake/platforms
[12:06:02]W:	 [Step 1/2] + SAN_SUPP_DIR=/work/test/sanitizer_suppressions
[12:06:02]W:	 [Step 1/2] + SAN_LOG_DIR=/tmp/sanitizer_logs
[12:06:02]W:	 [Step 1/2] + mkdir -p /tmp/sanitizer_logs
[12:06:02]W:	 [Step 1/2] + rm -rf '/tmp/sanitizer_logs/*'
[12:06:02]W:	 [Step 1/2] + export ASAN_OPTIONS=log_path=/tmp/sanitizer_logs/asan.log
[12:06:02]W:	 [Step 1/2] + ASAN_OPTIONS=log_path=/tmp/sanitizer_logs/asan.log
[12:06:02]W:	 [Step 1/2] + export LSAN_OPTIONS=log_path=/tmp/sanitizer_logs/lsan.log
[12:06:02]W:	 [Step 1/2] + LSAN_OPTIONS=log_path=/tmp/sanitizer_logs/lsan.log
[12:06:02]W:	 [Step 1/2] + export TSAN_OPTIONS=log_path=/tmp/sanitizer_logs/tsan.log
[12:06:02]W:	 [Step 1/2] + TSAN_OPTIONS=log_path=/tmp/sanitizer_logs/tsan.log
[12:06:02]W:	 [Step 1/2] + export UBSAN_OPTIONS=log_path=/tmp/sanitizer_logs/ubsan.log
[12:06:02]W:	 [Step 1/2] + UBSAN_OPTIONS=log_path=/tmp/sanitizer_logs/ubsan.log
[12:06:02]W:	 [Step 1/2] + UNIT_TESTS_JUNIT_LOG_LEVEL=message
[12:06:02] :	 [Step 1/2] Error: Invalid build name 'build-werror'
[12:06:02]W:	 [Step 1/2] + case "$ABC_BUILD_NAME" in
[12:06:02]W:	 [Step 1/2] + echo 'Error: Invalid build name '\''build-werror'\'''
[12:06:02]W:	 [Step 1/2] + exit 2
[12:06:02]W:	 [Step 1/2] cp: cannot stat '/work/ibd/debug.log': No such file or directory
[12:06:02]W:	 [Step 1/2] Process exited with code 2
[12:06:02]E:	 [Step 1/2] Process exited with code 2 (Step: Command Line)
Fabien requested review of this revision.Jun 2 2020, 12:45
This revision is now accepted and ready to land.Jun 2 2020, 14:08
This revision was landed with ongoing or failed builds.Jun 2 2020, 14:48
This revision was automatically updated to reflect the committed changes.