From 9e8f7b973a14c4bc3bb37c521c259c5322bbde37 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 16 Mar 2021 10:38:35 +0100 Subject: [PATCH 1/2] scripts: Fix pgbouncer install script not reporting errors The install-pgbouncer script is not currently reporting any build errors to the caller, except if the final `rm -rf` fails. Fix the issue by executing `set -xeuo pipefail` to properly report errors of any unchecked commands and chaining commands with `&&`'s. While the latter shouldn't be necessary anymore because of changed options, it's easy enough to do for this script. With this change, we now properly notice that building pgbouncer fails currently because of a missing libevent dependency. This failure is fixed in a subsequent commit. --- scripts/install-pgbouncer | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/install-pgbouncer b/scripts/install-pgbouncer index be00920..9c7c35f 100755 --- a/scripts/install-pgbouncer +++ b/scripts/install-pgbouncer @@ -1,19 +1,18 @@ #!/bin/bash +set -xeuo pipefail + PGBOUNCER_VERSION=${1} PGBOUNCER_DOWNLOAD_SHA256=${2} - PGBOUNCER_DOWNLOAD_URL="https://pgbouncer.github.io/downloads/files/$PGBOUNCER_VERSION/pgbouncer-$PGBOUNCER_VERSION.tar.gz" -curl -o pgbouncer.tar.gz -fsSL $PGBOUNCER_DOWNLOAD_URL -echo "${PGBOUNCER_DOWNLOAD_SHA256} pgbouncer.tar.gz" | sha256sum -c - - -tar xfz pgbouncer.tar.gz -rm -f pgbouncer.tar.gz -cd pgbouncer-${PGBOUNCER_VERSION} -./configure --prefix=/usr/local -make -cp pgbouncer /usr/local/bin - -cd .. -rm -rf pgbouncer-${PGBOUNCER_VERSION} +curl -o pgbouncer.tar.gz -fsSL $PGBOUNCER_DOWNLOAD_URL \ + && echo "${PGBOUNCER_DOWNLOAD_SHA256} pgbouncer.tar.gz" | sha256sum -c - \ + && tar xfz pgbouncer.tar.gz \ + && rm -f pgbouncer.tar.gz \ + && cd pgbouncer-${PGBOUNCER_VERSION} \ + && ./configure --prefix=/usr/local \ + && make \ + && cp pgbouncer /usr/local/bin \ + && cd .. \ + && rm -rf pgbouncer-${PGBOUNCER_VERSION} From 8380f29a2456525c3c5d87128ba47bf8ffda8024 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 16 Mar 2021 10:40:13 +0100 Subject: [PATCH 2/2] scripts: Install libevent-dev dependency to fix pgbouncer build The pgbouncer build is currently broken because of a missing build dependency. This went unnoticed because the build script previously didn't report any build errors. Fix the build by installing the missing libevent-dev dependency. --- scripts/install-essentials | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-essentials b/scripts/install-essentials index 6c1bbe4..d855a32 100755 --- a/scripts/install-essentials +++ b/scripts/install-essentials @@ -22,7 +22,7 @@ then logrotate python-docutils pkg-config cmake nodejs \ libkrb5-dev postgresql-client mysql-client unzip \ libsqlite3-dev libpq-dev libpng-dev libjpeg-dev libzstd-dev \ - libre2-dev gettext rsync git-core + libre2-dev libevent-dev gettext rsync git-core else apt-get install -y \ curl wget build-essential apt-utils locales openssh-client \ @@ -32,7 +32,7 @@ else logrotate python-docutils pkg-config cmake \ libkrb5-dev postgresql-client unzip \ libsqlite3-dev libpq-dev libpng-dev libjpeg-dev libzstd-dev \ - libre2-dev gettext rsync git-core + libre2-dev libevent-dev gettext rsync git-core fi # Set UTF-8