From a3b0bb68faed03c6edd3978b8dd34ca67881f7c7 Mon Sep 17 00:00:00 2001 From: Joseph Ferguson Date: Fri, 12 May 2023 11:54:42 -0700 Subject: [PATCH] Downgrade llvm to 15 to fix jit support --- 11/alpine/Dockerfile | 13 ++++++++++++- 12/alpine/Dockerfile | 13 ++++++++++++- 13/alpine/Dockerfile | 13 ++++++++++++- 14/alpine/Dockerfile | 13 ++++++++++++- 15/alpine/Dockerfile | 13 ++++++++++++- Dockerfile-alpine.template | 21 +++++++++++++-------- Dockerfile-debian.template | 3 --- 7 files changed, 73 insertions(+), 16 deletions(-) diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile index 94dc99cd7e..6dad831545 100644 --- a/11/alpine/Dockerfile +++ b/11/alpine/Dockerfile @@ -26,6 +26,10 @@ ENV PG_MAJOR 11 ENV PG_VERSION 11.20 ENV PG_SHA256 3d7c8882f64a7e98534a044257dfee7abad77a5b7da12508d85d722b98b5acce +ENV DOCKER_PG_LLVM_DEPS \ + llvm15-dev \ + clang15 + RUN set -eux; \ \ wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ @@ -40,10 +44,12 @@ RUN set -eux; \ rm postgresql.tar.bz2; \ \ apk add --no-cache --virtual .build-deps \ + $DOCKER_PG_LLVM_DEPS \ bison \ coreutils \ dpkg-dev dpkg \ flex \ + g++ \ gcc \ krb5-dev \ libc-dev \ @@ -51,7 +57,6 @@ RUN set -eux; \ libxml2-dev \ libxslt-dev \ linux-headers \ - llvm-dev clang g++ \ make \ openldap-dev \ openssl-dev \ @@ -76,6 +81,12 @@ RUN set -eux; \ # explicitly update autoconf config.guess and config.sub so they support more arches/libcs wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ + \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n158 + export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n163 + export CLANG=clang-15; \ + \ # configure options taken from: # https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 ./configure \ diff --git a/12/alpine/Dockerfile b/12/alpine/Dockerfile index 110257f91f..4698d75fc9 100644 --- a/12/alpine/Dockerfile +++ b/12/alpine/Dockerfile @@ -26,6 +26,10 @@ ENV PG_MAJOR 12 ENV PG_VERSION 12.15 ENV PG_SHA256 bb5206e2864c1c4579938b96ea6096d155f22abf2d2cc2aa57571e3c4cb12b36 +ENV DOCKER_PG_LLVM_DEPS \ + llvm15-dev \ + clang15 + RUN set -eux; \ \ wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ @@ -40,10 +44,12 @@ RUN set -eux; \ rm postgresql.tar.bz2; \ \ apk add --no-cache --virtual .build-deps \ + $DOCKER_PG_LLVM_DEPS \ bison \ coreutils \ dpkg-dev dpkg \ flex \ + g++ \ gcc \ krb5-dev \ libc-dev \ @@ -51,7 +57,6 @@ RUN set -eux; \ libxml2-dev \ libxslt-dev \ linux-headers \ - llvm-dev clang g++ \ make \ openldap-dev \ openssl-dev \ @@ -76,6 +81,12 @@ RUN set -eux; \ # explicitly update autoconf config.guess and config.sub so they support more arches/libcs wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ + \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n158 + export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n163 + export CLANG=clang-15; \ + \ # configure options taken from: # https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 ./configure \ diff --git a/13/alpine/Dockerfile b/13/alpine/Dockerfile index c8d8063edf..29262473d4 100644 --- a/13/alpine/Dockerfile +++ b/13/alpine/Dockerfile @@ -26,6 +26,10 @@ ENV PG_MAJOR 13 ENV PG_VERSION 13.11 ENV PG_SHA256 4992ff647203566b670d4e54dc5317499a26856c93576d0ea951bdf6bee50bfb +ENV DOCKER_PG_LLVM_DEPS \ + llvm15-dev \ + clang15 + RUN set -eux; \ \ wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ @@ -40,10 +44,12 @@ RUN set -eux; \ rm postgresql.tar.bz2; \ \ apk add --no-cache --virtual .build-deps \ + $DOCKER_PG_LLVM_DEPS \ bison \ coreutils \ dpkg-dev dpkg \ flex \ + g++ \ gcc \ krb5-dev \ libc-dev \ @@ -51,7 +57,6 @@ RUN set -eux; \ libxml2-dev \ libxslt-dev \ linux-headers \ - llvm-dev clang g++ \ make \ openldap-dev \ openssl-dev \ @@ -76,6 +81,12 @@ RUN set -eux; \ # explicitly update autoconf config.guess and config.sub so they support more arches/libcs wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ + \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n158 + export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n163 + export CLANG=clang-15; \ + \ # configure options taken from: # https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 ./configure \ diff --git a/14/alpine/Dockerfile b/14/alpine/Dockerfile index 0d0dd7f3aa..5c216546ce 100644 --- a/14/alpine/Dockerfile +++ b/14/alpine/Dockerfile @@ -26,6 +26,10 @@ ENV PG_MAJOR 14 ENV PG_VERSION 14.8 ENV PG_SHA256 39d38f0030737ed03835debeefee3b37d335462ce4995e2497bc38d621ebe45a +ENV DOCKER_PG_LLVM_DEPS \ + llvm15-dev \ + clang15 + RUN set -eux; \ \ wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ @@ -40,10 +44,12 @@ RUN set -eux; \ rm postgresql.tar.bz2; \ \ apk add --no-cache --virtual .build-deps \ + $DOCKER_PG_LLVM_DEPS \ bison \ coreutils \ dpkg-dev dpkg \ flex \ + g++ \ gcc \ krb5-dev \ libc-dev \ @@ -51,7 +57,6 @@ RUN set -eux; \ libxml2-dev \ libxslt-dev \ linux-headers \ - llvm-dev clang g++ \ make \ openldap-dev \ openssl-dev \ @@ -78,6 +83,12 @@ RUN set -eux; \ # explicitly update autoconf config.guess and config.sub so they support more arches/libcs wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ + \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n158 + export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n163 + export CLANG=clang-15; \ + \ # configure options taken from: # https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 ./configure \ diff --git a/15/alpine/Dockerfile b/15/alpine/Dockerfile index eaa64bc7ae..ef886cc3ab 100644 --- a/15/alpine/Dockerfile +++ b/15/alpine/Dockerfile @@ -26,6 +26,10 @@ ENV PG_MAJOR 15 ENV PG_VERSION 15.3 ENV PG_SHA256 ffc7d4891f00ffbf5c3f4eab7fbbced8460b8c0ee63c5a5167133b9e6599d932 +ENV DOCKER_PG_LLVM_DEPS \ + llvm15-dev \ + clang15 + RUN set -eux; \ \ wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ @@ -40,10 +44,12 @@ RUN set -eux; \ rm postgresql.tar.bz2; \ \ apk add --no-cache --virtual .build-deps \ + $DOCKER_PG_LLVM_DEPS \ bison \ coreutils \ dpkg-dev dpkg \ flex \ + g++ \ gcc \ krb5-dev \ libc-dev \ @@ -51,7 +57,6 @@ RUN set -eux; \ libxml2-dev \ libxslt-dev \ linux-headers \ - llvm-dev clang g++ \ make \ openldap-dev \ openssl-dev \ @@ -80,6 +85,12 @@ RUN set -eux; \ # explicitly update autoconf config.guess and config.sub so they support more arches/libcs wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ + \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n158 + export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n163 + export CLANG=clang-15; \ + \ # configure options taken from: # https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 ./configure \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 57807bc851..deae2546c1 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -20,6 +20,11 @@ ENV PG_MAJOR {{ env.version }} ENV PG_VERSION {{ .version }} ENV PG_SHA256 {{ .sha256 }} +{{ def llvmver: "15" -}} +ENV DOCKER_PG_LLVM_DEPS \ + llvm{{ llvmver }}-dev \ + clang{{ llvmver }} + RUN set -eux; \ \ wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ @@ -34,10 +39,12 @@ RUN set -eux; \ rm postgresql.tar.bz2; \ \ apk add --no-cache --virtual .build-deps \ + $DOCKER_PG_LLVM_DEPS \ bison \ coreutils \ dpkg-dev dpkg \ flex \ + g++ \ gcc \ krb5-dev \ libc-dev \ @@ -45,9 +52,6 @@ RUN set -eux; \ libxml2-dev \ libxslt-dev \ linux-headers \ -{{ if .major >= 11 then ( -}} - llvm-dev clang g++ \ -{{ ) else "" end -}} make \ openldap-dev \ openssl-dev \ @@ -80,6 +84,12 @@ RUN set -eux; \ # explicitly update autoconf config.guess and config.sub so they support more arches/libcs wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ + \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n158 + export LLVM_CONFIG="/usr/lib/llvm{{ llvmver }}/bin/llvm-config"; \ +# https://git.alpinelinux.org/aports/tree/community/postgresql12/APKBUILD?h=3.18-stable&id=a470294e6d6ca7059e41c54769b7c3c26ec901d4#n163 + export CLANG=clang-{{ llvmver }}; \ + \ # configure options taken from: # https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 ./configure \ @@ -110,9 +120,7 @@ RUN set -eux; \ --with-libxml \ --with-libxslt \ --with-icu \ -{{ if .major >= 11 then ( -}} --with-llvm \ -{{ ) else "" end -}} {{ if .major >= 14 then ( -}} --with-lz4 \ {{ ) else "" end -}} @@ -169,9 +177,6 @@ RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 1777 "$P VOLUME /var/lib/postgresql/data COPY docker-entrypoint.sh /usr/local/bin/ -{{ if .major >= 11 then "" else ( -}} -RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat -{{ ) end -}} ENTRYPOINT ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index dc301a7d13..aeca3d8d32 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -181,9 +181,6 @@ RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PG VOLUME /var/lib/postgresql/data COPY docker-entrypoint.sh /usr/local/bin/ -{{ if .major >= 11 then "" else ( -}} -RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat -{{ ) end -}} ENTRYPOINT ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL