From 2c751341b6454412f2048de021a1f185212939de Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 30 Sep 2025 11:37:33 -0700 Subject: [PATCH] Add liburing support to 18+ This is a bit complicated to use in Docker (because `io_uring` has a long and storied security story), but it is a new feature of 18+ that we should probably explicitly support for users who want to jump through the hoops to use it despite the security risk. Additionally, this re-alphabetizes our `--with-xxx` flags. --- 13/alpine3.21/Dockerfile | 16 ++++++++-------- 13/alpine3.22/Dockerfile | 16 ++++++++-------- 14/alpine3.21/Dockerfile | 16 ++++++++-------- 14/alpine3.22/Dockerfile | 16 ++++++++-------- 15/alpine3.21/Dockerfile | 16 ++++++++-------- 15/alpine3.22/Dockerfile | 16 ++++++++-------- 16/alpine3.21/Dockerfile | 16 ++++++++-------- 16/alpine3.22/Dockerfile | 16 ++++++++-------- 17/alpine3.21/Dockerfile | 16 ++++++++-------- 17/alpine3.22/Dockerfile | 16 ++++++++-------- 18/alpine3.21/Dockerfile | 20 ++++++++++++-------- 18/alpine3.22/Dockerfile | 20 ++++++++++++-------- Dockerfile-alpine.template | 24 ++++++++++++++++-------- 13 files changed, 120 insertions(+), 104 deletions(-) diff --git a/13/alpine3.21/Dockerfile b/13/alpine3.21/Dockerfile index 74b000f98e..defa164bb2 100644 --- a/13/alpine3.21/Dockerfile +++ b/13/alpine3.21/Dockerfile @@ -114,8 +114,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -135,16 +135,16 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ ; \ make -j "$(nproc)" world-bin; \ make install-world-bin; \ diff --git a/13/alpine3.22/Dockerfile b/13/alpine3.22/Dockerfile index 2da86b6e76..0e953db702 100644 --- a/13/alpine3.22/Dockerfile +++ b/13/alpine3.22/Dockerfile @@ -114,8 +114,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -135,16 +135,16 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ ; \ make -j "$(nproc)" world-bin; \ make install-world-bin; \ diff --git a/14/alpine3.21/Dockerfile b/14/alpine3.21/Dockerfile index 231e4dc543..0d8986b365 100644 --- a/14/alpine3.21/Dockerfile +++ b/14/alpine3.21/Dockerfile @@ -116,8 +116,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -137,17 +137,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ ; \ make -j "$(nproc)" world-bin; \ make install-world-bin; \ diff --git a/14/alpine3.22/Dockerfile b/14/alpine3.22/Dockerfile index 70a074c621..b1d48c2cfa 100644 --- a/14/alpine3.22/Dockerfile +++ b/14/alpine3.22/Dockerfile @@ -116,8 +116,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -137,17 +137,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ ; \ make -j "$(nproc)" world-bin; \ make install-world-bin; \ diff --git a/15/alpine3.21/Dockerfile b/15/alpine3.21/Dockerfile index 16238ea55d..47e572917b 100644 --- a/15/alpine3.21/Dockerfile +++ b/15/alpine3.21/Dockerfile @@ -118,8 +118,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -139,17 +139,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/15/alpine3.22/Dockerfile b/15/alpine3.22/Dockerfile index 5419b7e2ff..3980d174d2 100644 --- a/15/alpine3.22/Dockerfile +++ b/15/alpine3.22/Dockerfile @@ -118,8 +118,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -139,17 +139,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/16/alpine3.21/Dockerfile b/16/alpine3.21/Dockerfile index 08dd7f7132..df3f61afc2 100644 --- a/16/alpine3.21/Dockerfile +++ b/16/alpine3.21/Dockerfile @@ -118,8 +118,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -138,17 +138,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/16/alpine3.22/Dockerfile b/16/alpine3.22/Dockerfile index cea5ed9930..2dc86fa037 100644 --- a/16/alpine3.22/Dockerfile +++ b/16/alpine3.22/Dockerfile @@ -118,8 +118,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -138,17 +138,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/17/alpine3.21/Dockerfile b/17/alpine3.21/Dockerfile index c081f8a5b5..fc44e67d02 100644 --- a/17/alpine3.21/Dockerfile +++ b/17/alpine3.21/Dockerfile @@ -117,8 +117,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -136,17 +136,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/17/alpine3.22/Dockerfile b/17/alpine3.22/Dockerfile index 475b7da08b..833aee0669 100644 --- a/17/alpine3.22/Dockerfile +++ b/17/alpine3.22/Dockerfile @@ -117,8 +117,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -136,17 +136,17 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/18/alpine3.21/Dockerfile b/18/alpine3.21/Dockerfile index e6d6b47242..269019ecb8 100644 --- a/18/alpine3.21/Dockerfile +++ b/18/alpine3.21/Dockerfile @@ -102,6 +102,9 @@ RUN set -eux; \ lz4-dev \ # https://www.postgresql.org/docs/15/release-15.html "--with-zstd to enable Zstandard builds" zstd-dev \ +# https://salsa.debian.org/postgresql/postgresql-common/-/commit/89c384273f4c4092483598c292b1b1b188816cce +# https://www.postgresql.org/docs/18/install-make.html#CONFIGURE-OPTION-WITH-LIBURING + liburing-dev \ ; \ \ cd /usr/src/postgresql; \ @@ -117,8 +120,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -136,17 +139,18 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ + --with-liburing \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/18/alpine3.22/Dockerfile b/18/alpine3.22/Dockerfile index ac95f127df..491a63e020 100644 --- a/18/alpine3.22/Dockerfile +++ b/18/alpine3.22/Dockerfile @@ -102,6 +102,9 @@ RUN set -eux; \ lz4-dev \ # https://www.postgresql.org/docs/15/release-15.html "--with-zstd to enable Zstandard builds" zstd-dev \ +# https://salsa.debian.org/postgresql/postgresql-common/-/commit/89c384273f4c4092483598c292b1b1b188816cce +# https://www.postgresql.org/docs/18/install-make.html#CONFIGURE-OPTION-WITH-LIBURING + liburing-dev \ ; \ \ cd /usr/src/postgresql; \ @@ -117,8 +120,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-19; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -136,17 +139,18 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ + --with-liburing \ --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ --with-lz4 \ + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ --with-zstd \ ; \ make -j "$(nproc)" world-bin; \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 45fe59e833..0f7575d3ab 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -110,6 +110,11 @@ RUN set -eux; \ {{ if .major >= 15 then ( -}} # https://www.postgresql.org/docs/15/release-15.html "--with-zstd to enable Zstandard builds" zstd-dev \ +{{ ) else "" end -}} +{{ if .major >= 18 then ( -}} +# https://salsa.debian.org/postgresql/postgresql-common/-/commit/89c384273f4c4092483598c292b1b1b188816cce +# https://www.postgresql.org/docs/18/install-make.html#CONFIGURE-OPTION-WITH-LIBURING + liburing-dev \ {{ ) else "" end -}} ; \ \ @@ -126,8 +131,8 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/community/postgresql15/APKBUILD?h=3.22-stable#n180 ("older clang versions don't have a 'clang' exe anymore.") export CLANG=clang-{{ llvmver }}; \ \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5 +# configure options mostly copying Debian: +# https://salsa.debian.org/postgresql/postgresql-common/-/blob/6e26b5107295170cc8731a3acbf13228ea15941e/server/postgresql.mk#L32 ./configure \ --enable-option-checking=fatal \ --build="$gnuArch" \ @@ -154,19 +159,22 @@ RUN set -eux; \ --with-includes=/usr/local/include \ --with-libraries=/usr/local/lib \ --with-gssapi \ + --with-icu \ --with-ldap \ - --with-tcl \ - --with-perl \ - --with-python \ -# --with-pam \ - --with-openssl \ +{{ if .major >= 18 then ( -}} + --with-liburing \ +{{ ) else "" end -}} --with-libxml \ --with-libxslt \ - --with-icu \ --with-llvm \ {{ if .major >= 14 then ( -}} --with-lz4 \ {{ ) else "" end -}} + --with-openssl \ +# --with-pam \ + --with-perl \ + --with-python \ + --with-tcl \ {{ if .major >= 15 then ( -}} --with-zstd \ {{ ) else "" end -}}