From 4da1f66fae836c4579ea38fe6d1d8fa2e6e9faf2 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Thu, 6 Nov 2025 13:24:30 +1300 Subject: [PATCH] ci: Add missing "set -e" to scripts run by su. If any shell command fails, the whole script should fail. To avoid future omissions, add this even for single-command scripts that use su with heredoc syntax, as they might be extended or copied-and-pasted. Extracted from a larger patch that wanted to use #error during compilation, leading to the diagnosis of this problem. Reviewed-by: Tristan Partin (earlier version) Discussion: https://postgr.es/m/DDZP25P4VZ48.3LWMZBGA1K9RH%40partin.io Backpatch-through: 15 --- .cirrus.tasks.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml index 7dac2983a3d..f670caace1f 100644 --- a/.cirrus.tasks.yml +++ b/.cirrus.tasks.yml @@ -94,6 +94,7 @@ task: configure_script: | su postgres <<-EOF + set -e meson setup \ --buildtype=debug \ --auto-features=disabled \ @@ -102,6 +103,7 @@ task: EOF build_script: | su postgres <<-EOF + set -e ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET} EOF upload_caches: ccache @@ -111,6 +113,7 @@ task: # tap test that exercises both a frontend binary and the backend. test_minimal_script: | su postgres <<-EOF + set -e ulimit -c unlimited meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \ tmp_install cube/regress pg_ctl/001_start_stop @@ -172,6 +175,7 @@ task: # already takes longer than other platforms except for windows. configure_script: | su postgres <<-EOF + set -e meson setup \ --buildtype=debug \ -Dcassert=true -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \ @@ -184,6 +188,7 @@ task: test_world_script: | su postgres <<-EOF + set -e ulimit -c unlimited meson test $MTEST_ARGS --num-processes ${TEST_JOBS} EOF @@ -208,6 +213,7 @@ task: # during upload, as it doesn't expect artifacts to change size stop_running_script: | su postgres <<-EOF + set -e build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true EOF <<: *on_failure_meson @@ -328,6 +334,7 @@ task: # that. configure_script: | su postgres <<-EOF + set -e ./configure \ --enable-cassert --enable-debug --enable-tap-tests \ --enable-nls \ @@ -342,6 +349,7 @@ task: test_world_script: | su postgres <<-EOF + set -e ulimit -c unlimited # default is 0 make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS} EOF @@ -357,6 +365,7 @@ task: configure_script: | su postgres <<-EOF + set -e meson setup \ --buildtype=debug \ -Dcassert=true \ @@ -369,6 +378,7 @@ task: # locally. configure_32_script: | su postgres <<-EOF + set -e export CC='ccache gcc -m32' meson setup \ --buildtype=debug \ @@ -388,6 +398,7 @@ task: test_world_script: | su postgres <<-EOF + set -e ulimit -c unlimited meson test $MTEST_ARGS --num-processes ${TEST_JOBS} EOF @@ -400,6 +411,7 @@ task: # from C, prevent that with PYTHONCOERCECLOCALE. test_world_32_script: | su postgres <<-EOF + set -e ulimit -c unlimited PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS} EOF -- 2.47.3