From 762f6c38d8ffb4b9bb259e40f66cd8f7bfe148be Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sat, 24 Oct 2026 16:48:14 +0200 Subject: [PATCH] Install the server headers of the PostgreSQL the runner image ships The libclang sysroot of provision-meos and of openapi-validate installs the server-dev package of the PostgreSQL the runner image installs under /usr/lib/postgresql, which server-dev-package.sh prints: postgresql-server-dev-16 on ubuntu-24.04, the package those runners install today, and postgresql-server-dev-18 on ubuntu-26.04. The cache key of the action names it. Witness: postgresql-server-dev-16, which both lists named, is no package of Ubuntu 26.04, so on a runner ubuntu-latest gives ubuntu-26.04, apt-get exits with 100 and every consumer of the action fails before it builds; the fork run of MobilityFlink #86 fails so on ubuntu-26.04 while the same commit passes on ubuntu-24.04. postgresql-server-dev-all does not install on the images either: they ship postgresql-common from apt.postgresql.org (293.pgdg24.04+1 on ubuntu-24.04), and the archive's postgresql-server-dev-all requires its own (257build1.1). Measured: the runner images document PostgreSQL 16.15 on ubuntu-24.04 and PostgreSQL 18.6 on ubuntu-26.04 (actions/runner-images Ubuntu2404-Readme.md, Ubuntu2604-Readme.md); in a clean container, Ubuntu 26.04 has no postgresql-server-dev-16. --- .github/actions/provision-meos/action.yml | 7 ++++--- .../provision-meos/server-dev-package.sh | 20 +++++++++++++++++++ .github/workflows/openapi-validate.yml | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100755 .github/actions/provision-meos/server-dev-package.sh diff --git a/.github/actions/provision-meos/action.yml b/.github/actions/provision-meos/action.yml index 5dd8391..c661798 100644 --- a/.github/actions/provision-meos/action.yml +++ b/.github/actions/provision-meos/action.yml @@ -69,12 +69,13 @@ runs: env: PACKAGES: >- clang libclang-dev libjson-c-dev libgsl-dev libproj-dev libgeos-dev - postgresql-server-dev-16 run: | + # The PostgreSQL server headers are those of the PostgreSQL the image ships. + packages="$PACKAGES $(bash "$GITHUB_ACTION_PATH/server-dev-package.sh")" image="${ImageOS:-unknown}-${ImageVersion:-unknown}" - pkg_hash="$(echo "$PACKAGES" | tr -s ' \n' '\n\n' | sort | sha256sum | cut -c1-16)" + pkg_hash="$(echo "$packages" | tr -s ' \n' '\n\n' | sort | sha256sum | cut -c1-16)" { - echo "packages=$PACKAGES" + echo "packages=$packages" echo "deb-prefix=provision-meos-sysroot-debs-${ImageOS:-unknown}-" echo "deb-key=provision-meos-sysroot-debs-$image-$pkg_hash" } >> "$GITHUB_OUTPUT" diff --git a/.github/actions/provision-meos/server-dev-package.sh b/.github/actions/provision-meos/server-dev-package.sh new file mode 100755 index 0000000..536358e --- /dev/null +++ b/.github/actions/provision-meos/server-dev-package.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# server-dev-package.sh — print the package holding the server headers of the PostgreSQL the +# runner image ships: postgresql-server-dev-16 on ubuntu-24.04 (PostgreSQL 16), and +# postgresql-server-dev-18 on ubuntu-26.04 (PostgreSQL 18). The major version is the directory +# the image installs under /usr/lib/postgresql, so the headers libclang reads follow the image +# instead of a version written into the install lists of this action and of this repository's +# workflows. postgresql-server-dev-all cannot stand in for it: the images ship postgresql-common +# from apt.postgresql.org, which the archive's postgresql-server-dev-all does not accept. +# +# Usage: +# apt-get.sh install -y "$(server-dev-package.sh)" +set -euo pipefail + +major="$(find /usr/lib/postgresql -mindepth 1 -maxdepth 1 -type d -printf '%f\n' 2>/dev/null | + grep -E '^[0-9]+$' | sort -n | tail -1 || true)" +if [ -z "$major" ]; then + echo "server-dev-package.sh: the image installs no PostgreSQL under /usr/lib/postgresql" >&2 + exit 1 +fi +echo "postgresql-server-dev-$major" diff --git a/.github/workflows/openapi-validate.yml b/.github/workflows/openapi-validate.yml index e31637b..4877f4c 100644 --- a/.github/workflows/openapi-validate.yml +++ b/.github/workflows/openapi-validate.yml @@ -43,7 +43,7 @@ jobs: bash .github/actions/provision-meos/apt-get.sh install -y --no-install-recommends \ clang libclang-dev \ libjson-c-dev libgsl-dev libproj-dev libgeos-dev \ - postgresql-server-dev-16 + "$(bash .github/actions/provision-meos/server-dev-package.sh)" - name: Clone MobilityDB master (MEOS headers source) run: |