]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
ci: Add missing "set -e" to scripts run by su.
authorThomas Munro <tmunro@postgresql.org>
Thu, 6 Nov 2025 00:24:30 +0000 (13:24 +1300)
committerThomas Munro <tmunro@postgresql.org>
Thu, 6 Nov 2025 01:23:08 +0000 (14:23 +1300)
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 <tristan@partin.io> (earlier version)
Discussion: https://postgr.es/m/DDZP25P4VZ48.3LWMZBGA1K9RH%40partin.io
Backpatch-through: 15

.cirrus.tasks.yml

index 50dad5ca93093e327990f30177cd99484b39cf2c..81ad6a164c6f51f08bdd1b5dc09fce6fdee3b64f 100644 (file)
@@ -76,6 +76,7 @@ task:
   # freebsd already takes longer than other platforms except for windows.
   configure_script: |
     su postgres <<-EOF
+      set -e
       ./configure \
         --enable-cassert --enable-debug --enable-tap-tests \
         --enable-nls \
@@ -181,6 +182,7 @@ task:
 
   configure_script: |
     su postgres <<-EOF
+      set -e
       ./configure \
         --enable-cassert --enable-debug --enable-tap-tests \
         --enable-nls \
@@ -198,6 +200,7 @@ task:
 
   test_world_script: |
     su postgres <<-EOF
+      set -e
       ulimit -c unlimited # default is 0
       make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
     EOF