From f8888ca4c2980b6b2ad626824dd52ca339a374ae Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Apr 2023 17:29:25 +0200 Subject: [PATCH 1/4] Run ODBC build in Ubuntu 18.04 container Ubuntu 18.04 runner is not available any more, so put this build into a container instead. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae5e2562f..e7cef2231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ on: jobs: build: runs-on: ${{ matrix.runner || 'ubuntu-22.04' }} + container: ${{ matrix.container }} name: ${{ matrix.name }} strategy: fail-fast: false @@ -40,7 +41,7 @@ jobs: name: Valgrind - backend: odbc # There are many leak reports under Ubuntu 22.04, see #1008. - runner: ubuntu-18.04 + container: ubuntu:18.04 name: ODBC - backend: firebird name: Firebird From d9b499a992a2e4ded551dfcb2601e183a4926e7e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Apr 2023 18:10:31 +0200 Subject: [PATCH 2/4] Don't install recommended packages Try to speed up the installation process a bit by installing fewer packages. --- scripts/ci/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/common.sh b/scripts/ci/common.sh index c1864ea28..6ec566586 100644 --- a/scripts/ci/common.sh +++ b/scripts/ci/common.sh @@ -83,7 +83,7 @@ tmstamp() run_apt() { # Disable some (but not all) output. - sudo apt-get -q -y -o=Dpkg::Use-Pty=0 "$@" + sudo apt-get -q -y -o=Dpkg::Use-Pty=0 --no-install-recommends "$@" } run_make() From 193ef4ddf89e6feaac4fc18dc9a95df912d94f4c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Apr 2023 18:10:53 +0200 Subject: [PATCH 3/4] Install PostgreSQL server in ODBC install script It is needed and is not guaranteed to be already installed when running inside a container. --- scripts/ci/install_odbc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/install_odbc.sh b/scripts/ci/install_odbc.sh index 1c11505d1..b76ccacc9 100755 --- a/scripts/ci/install_odbc.sh +++ b/scripts/ci/install_odbc.sh @@ -14,7 +14,7 @@ run_apt remove \ run_apt install \ tar bzip2 \ unixodbc unixodbc-dbgsym unixodbc-dev \ - odbc-postgresql odbc-postgresql-dbgsym + odbc-postgresql odbc-postgresql-dbgsym postgresql # Use full path to the driver library to avoid errors like # [01000][unixODBC][Driver Manager]Can't open lib 'psqlodbca.so' : file not found From 249d1a4704d4f3bb5aa4f507b85f3194050f5e8d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Apr 2023 17:44:55 +0200 Subject: [PATCH 4/4] Fix CI install script to work on bare OS install too Don't assume that sudo and lsb-release are always available, this is not the case when using a Docker container image, for example. --- scripts/ci/common.sh | 4 +++- scripts/ci/install.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/ci/common.sh b/scripts/ci/common.sh index 6ec566586..30ffb787f 100644 --- a/scripts/ci/common.sh +++ b/scripts/ci/common.sh @@ -80,10 +80,12 @@ tmstamp() echo -n "[$(date '+%H:%M:%S')]" ; } +SOCI_APT_OPTIONS='-q -y -o=Dpkg::Use-Pty=0 --no-install-recommends' + run_apt() { # Disable some (but not all) output. - sudo apt-get -q -y -o=Dpkg::Use-Pty=0 --no-install-recommends "$@" + sudo apt-get $SOCI_APT_OPTIONS "$@" } run_make() diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index 47bb4860a..86286dd3f 100755 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -9,6 +9,15 @@ case "$(uname)" in Linux) + # Install the bare minimum for the rest to work if we're running on a + # minimum system. + if ! command -v lsb_release > /dev/null; then + # We can't use run_apt here because it uses sudo which may also be + # not available yet. + apt-get $SOCI_APT_OPTIONS update + apt-get $SOCI_APT_OPTIONS install build-essential lsb-release sudo + fi + packages_to_install="cmake libc6-dbg" if [ "${WITH_BOOST}" != OFF ]; then packages_to_install="$packages_to_install libboost-dev libboost-date-time-dev"