From 46e8474a6e8ac8460416ac62afcbdf59cfeb6366 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 9 Jun 2025 14:23:06 -0700 Subject: [PATCH] Only install 18+ JIT package on architectures where it's supported See: - https://salsa.debian.org/postgresql/postgresql/-/commit/eaa9529d8ecb0beaeebeb5b09362dbdf4ce34c0c "Make LLVM architectures a inclusion list so it works in the Architecture field." (which removes i386, notably) - https://salsa.debian.org/postgresql/postgresql/-/commit/1d6f624592d18d0cb0d694675037984f0d44b5ae "Disable JIT on loong64 and riscv64 again, still segfaulting." --- 18/bookworm/Dockerfile | 6 ++++-- 18/bullseye/Dockerfile | 6 ++++-- Dockerfile-debian.template | 8 +++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/18/bookworm/Dockerfile b/18/bookworm/Dockerfile index 88e36344e0..0cf4c0fb08 100644 --- a/18/bookworm/Dockerfile +++ b/18/bookworm/Dockerfile @@ -156,9 +156,11 @@ RUN set -ex; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ -# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+) - "postgresql-$PG_MAJOR-jit=$PG_VERSION" \ ; \ +# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+, but only supported for a subset of architectures) + if apt-get install -s "postgresql-$PG_MAJOR-jit" > /dev/null 2>&1; then \ + apt-get install -y --no-install-recommends "postgresql-$PG_MAJOR-jit=$PG_VERSION"; \ + fi; \ \ rm -rf /var/lib/apt/lists/*; \ \ diff --git a/18/bullseye/Dockerfile b/18/bullseye/Dockerfile index b2ec63d5b9..2a4b74b9ff 100644 --- a/18/bullseye/Dockerfile +++ b/18/bullseye/Dockerfile @@ -156,9 +156,11 @@ RUN set -ex; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ -# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+) - "postgresql-$PG_MAJOR-jit=$PG_VERSION" \ ; \ +# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+, but only supported for a subset of architectures) + if apt-get install -s "postgresql-$PG_MAJOR-jit" > /dev/null 2>&1; then \ + apt-get install -y --no-install-recommends "postgresql-$PG_MAJOR-jit=$PG_VERSION"; \ + fi; \ \ rm -rf /var/lib/apt/lists/*; \ \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index de0ea03974..81a6a0a0c5 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -154,11 +154,13 @@ RUN set -ex; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ + ; \ {{ if .major >= 18 then ( -}} -# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+) - "postgresql-$PG_MAJOR-jit=$PG_VERSION" \ +# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+, but only supported for a subset of architectures) + if apt-get install -s "postgresql-$PG_MAJOR-jit" > /dev/null 2>&1; then \ + apt-get install -y --no-install-recommends "postgresql-$PG_MAJOR-jit=$PG_VERSION"; \ + fi; \ {{ ) else "" end -}} - ; \ \ rm -rf /var/lib/apt/lists/*; \ \