From: Justin Pryzby Date: Sun, 20 Feb 2022 15:01:59 -0600 Subject: [PATCH 3/7] cirrus/windows: add compiler_warnings_script I'm not sure how to write this test in windows shell; it's also not easy to write it in posix sh, since windows shell is somehow interpretting && and ||... ci-os-only: windows https://cirrus-ci.com/task/6183879907213312 https://cirrus-ci.com/task/4876271443247104 --- .cirrus.yml | 9 ++++++++- src/tools/ci/windows-compiler-warnings | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 src/tools/ci/windows-compiler-warnings diff --git a/.cirrus.yml b/.cirrus.yml index 5179353dc9d..a3af4a0a808 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -366,7 +366,8 @@ task: # ForceNoAlign prevents msbuild from introducing line-breaks for long lines # disable file tracker, we're never going to rebuild, and it slows down the # build - MSBFLAGS: -m -verbosity:minimal "-consoleLoggerParameters:Summary;ForceNoAlign" /p:TrackFileAccess=false -nologo + # -fileLoggerParameters1: write warnings to msbuild.warn.log. + MSBFLAGS: -m -verbosity:minimal "-consoleLoggerParameters:Summary;ForceNoAlign" /p:TrackFileAccess=false -nologo -fileLoggerParameters1:warningsonly;logfile=msbuild.warn.log # If tests hang forever, cirrus eventually times out. In that case log # output etc is not uploaded, making the problem hard to debug. Of course @@ -447,6 +448,12 @@ task: cd src/tools/msvc %T_C% perl vcregress.pl ecpgcheck + # These should be last, so all the important checks are always run + always: + # Success if the file doesn't exist or is empty, else fail + compiler_warnings_script: + - sh src\tools\ci\windows-compiler-warnings msbuild.warn.log + on_failure: <<: *on_failure crashlog_artifacts: diff --git a/src/tools/ci/windows-compiler-warnings b/src/tools/ci/windows-compiler-warnings new file mode 100755 index 00000000000..d6f9a1fc569 --- /dev/null +++ b/src/tools/ci/windows-compiler-warnings @@ -0,0 +1,16 @@ +#! /bin/sh +# Success if the given file doesn't exist or is empty, else fail +# This is a separate file only to avoid dealing with windows shell quoting and escaping. +set -e + +fn=$1 + +if [ -s "$fn" ] +then + # Display the file's content, then exit indicating failure + cat "$fn" + exit 1 +else + # Success + exit 0 +fi -- 2.17.1 --wLAMOaPNJ0fu1fTG Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0004-cirrus-code-coverage.patch"