Upgrade Debian CI image from Bookworm to Trixie
Hi,
Debian Trixie CI images are generated now [1]https://github.com/anarazel/pg-vm-images/commit/35a144793f, so the attached patch
uses them with the following changes:
(copying from commit message)
- detect_stack_use_after_return=0 option is added to the ASAN_OPTIONS
because ASAN uses a "shadow stack" to track stack variable lifetimes
and this confuses Postgres' stack depth check [2]/messages/by-id/20240130212304.q66rquj5es4375ab@awork3.anarazel.de.
- Perl is updated to the newer version (perl5.40-i386-linux-gnu).
- LLVM-14 is no longer default installation, no need to force using
LLVM-16.
- Switch MinGW CC/CXX to x86_64-w64-mingw32ucrt-* to fix build failure
from missing _iswctype_l in mingw-w64 v12 headers.
Please note that this patch can be applied to the master only, other
branches have conflicts. I can work on back-patches when the patch is
ready to commit.
Any feedback would be appreciated.
[1]: https://github.com/anarazel/pg-vm-images/commit/35a144793f
[2]: /messages/by-id/20240130212304.q66rquj5es4375ab@awork3.anarazel.de
--
Regards,
Nazir Bilal Yavuz
Microsoft
Attachments:
v1-0001-ci-debian-Switch-to-Debian-Trixie-release.patchtext/x-patch; charset=US-ASCII; name=v1-0001-ci-debian-Switch-to-Debian-Trixie-release.patchDownload
From 3ba0930c9150e81e622c782bd75b2f6b194c9413 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Mon, 13 Oct 2025 11:10:18 +0300
Subject: [PATCH v1] ci: debian: Switch to Debian Trixie release
Debian Trixie CI images are generated now [1], so use them with the
following changes:
- detect_stack_use_after_return=0 option is added to the ASAN_OPTIONS
because ASAN uses a "shadow stack" to track stack variable lifetimes
and this confuses Postgres' stack depth check [2].
- Perl is updated to the newer version (perl5.40-i386-linux-gnu).
- LLVM-14 is no longer default installation, no need to force using
LLVM-16.
- Switch MinGW CC/CXX to x86_64-w64-mingw32ucrt-* to fix build failure
from missing _iswctype_l in mingw-w64 v12 headers.
[1] https://github.com/anarazel/pg-vm-images/commit/35a144793f
[2] https://postgr.es/m/20240130212304.q66rquj5es4375ab%40awork3.anarazel.de
---
.cirrus.tasks.yml | 39 +++++++++++++++++----------------------
1 file changed, 17 insertions(+), 22 deletions(-)
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index eca9d62fc22..7b89711f302 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -103,7 +103,7 @@ task:
CPUS: 4
BUILD_JOBS: 8
TEST_JOBS: 8
- IMAGE_FAMILY: pg-ci-bookworm
+ IMAGE_FAMILY: pg-ci-trixie
CCACHE_DIR: ${CIRRUS_WORKING_DIR}/ccache_dir
# no options enabled, should be small
CCACHE_MAXSIZE: "150M"
@@ -419,7 +419,7 @@ task:
CPUS: 4
BUILD_JOBS: 4
TEST_JOBS: 8 # experimentally derived to be a decent choice
- IMAGE_FAMILY: pg-ci-bookworm
+ IMAGE_FAMILY: pg-ci-trixie
CCACHE_DIR: /tmp/ccache_dir
DEBUGINFOD_URLS: "https://debuginfod.debian.net"
@@ -440,7 +440,7 @@ task:
# print_stacktraces=1,verbosity=2, duh
# detect_leaks=0: too many uninteresting leak errors in short-lived binaries
UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
- ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
+ ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0:detect_stack_use_after_return=0
# SANITIZER_FLAGS is set in the tasks below
CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
@@ -448,8 +448,6 @@ task:
LDFLAGS: $SANITIZER_FLAGS
CC: ccache gcc
CXX: ccache g++
- # GCC emits a warning for llvm-14, so switch to a newer one.
- LLVM_CONFIG: llvm-config-16
LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
LINUX_MESON_FEATURES: >-
@@ -497,7 +495,7 @@ task:
# - Uses address sanitizer, sanitizer failures are typically printed in
# the server log
# - Configures postgres with a small segment size
- - name: Linux - Debian Bookworm - Autoconf
+ - name: Linux - Debian Trixie - Autoconf
env:
SANITIZER_FLAGS: -fsanitize=address
@@ -520,7 +518,7 @@ task:
\
${LINUX_CONFIGURE_FEATURES} \
\
- CLANG="ccache clang-16"
+ CLANG="ccache clang"
EOF
build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
upload_caches: ccache
@@ -540,7 +538,7 @@ task:
# - Test both 64bit and 32 bit builds
# - uses io_method=io_uring
# - Uses meson feature autodetection
- - name: Linux - Debian Bookworm - Meson
+ - name: Linux - Debian Trixie - Meson
env:
CCACHE_MAXSIZE: "400M" # tests two different builds
@@ -566,7 +564,7 @@ task:
${MESON_COMMON_PG_CONFIG_ARGS} \
--buildtype=debug \
--pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
- -DPERL=perl5.36-i386-linux-gnu \
+ -DPERL=perl5.40-i386-linux-gnu \
${LINUX_MESON_FEATURES} -Dlibnuma=disabled \
build-32
EOF
@@ -882,7 +880,7 @@ task:
env:
CPUS: 4
BUILD_JOBS: 4
- IMAGE_FAMILY: pg-ci-bookworm
+ IMAGE_FAMILY: pg-ci-trixie
# Use larger ccache cache, as this task compiles with multiple compilers /
# flag combinations
@@ -891,9 +889,6 @@ task:
LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
- # GCC emits a warning for llvm-14, so switch to a newer one.
- LLVM_CONFIG: llvm-config-16
-
<<: *linux_task_template
sysinfo_script: |
@@ -929,7 +924,7 @@ task:
--cache gcc.cache \
--enable-dtrace \
${LINUX_CONFIGURE_FEATURES} \
- CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang-16"
+ CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
make -s -j${BUILD_JOBS} clean
time make -s -j${BUILD_JOBS} world-bin
@@ -940,7 +935,7 @@ task:
--cache gcc.cache \
--enable-cassert \
${LINUX_CONFIGURE_FEATURES} \
- CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang-16"
+ CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
make -s -j${BUILD_JOBS} clean
time make -s -j${BUILD_JOBS} world-bin
@@ -950,7 +945,7 @@ task:
time ./configure \
--cache clang.cache \
${LINUX_CONFIGURE_FEATURES} \
- CC="ccache clang" CXX="ccache clang++-16" CLANG="ccache clang-16"
+ CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
make -s -j${BUILD_JOBS} clean
time make -s -j${BUILD_JOBS} world-bin
@@ -962,7 +957,7 @@ task:
--enable-cassert \
--enable-dtrace \
${LINUX_CONFIGURE_FEATURES} \
- CC="ccache clang" CXX="ccache clang++-16" CLANG="ccache clang-16"
+ CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
make -s -j${BUILD_JOBS} clean
time make -s -j${BUILD_JOBS} world-bin
@@ -970,11 +965,11 @@ task:
always:
mingw_cross_warning_script: |
time ./configure \
- --host=x86_64-w64-mingw32 \
+ --host=x86_64-w64-mingw32ucrt \
--enable-cassert \
--without-icu \
- CC="ccache x86_64-w64-mingw32-gcc" \
- CXX="ccache x86_64-w64-mingw32-g++"
+ CC="ccache x86_64-w64-mingw32ucrt-gcc" \
+ CXX="ccache x86_64-w64-mingw32ucrt-g++"
make -s -j${BUILD_JOBS} clean
time make -s -j${BUILD_JOBS} world-bin
@@ -986,7 +981,7 @@ task:
docs_build_script: |
time ./configure \
--cache gcc.cache \
- CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang-16"
+ CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
make -s -j${BUILD_JOBS} clean
time make -s -j${BUILD_JOBS} -C doc
@@ -1002,7 +997,7 @@ task:
time ./configure \
${LINUX_CONFIGURE_FEATURES} \
--quiet \
- CC="gcc" CXX"=g++" CLANG="clang-16"
+ CC="gcc" CXX"=g++" CLANG="clang"
make -s -j${BUILD_JOBS} clean
time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
headers_cpluspluscheck_script: |
--
2.51.0
Hi,
On 2025-10-13 15:49:01 +0300, Nazir Bilal Yavuz wrote:
Debian Trixie CI images are generated now [1], so the attached patch
uses them with the following changes:(copying from commit message)
- detect_stack_use_after_return=0 option is added to the ASAN_OPTIONS
because ASAN uses a "shadow stack" to track stack variable lifetimes
and this confuses Postgres' stack depth check [2].- Perl is updated to the newer version (perl5.40-i386-linux-gnu).
- LLVM-14 is no longer default installation, no need to force using
LLVM-16.- Switch MinGW CC/CXX to x86_64-w64-mingw32ucrt-* to fix build failure
from missing _iswctype_l in mingw-w64 v12 headers.Please note that this patch can be applied to the master only, other
branches have conflicts. I can work on back-patches when the patch is
ready to commit.Any feedback would be appreciated.
[1] https://github.com/anarazel/pg-vm-images/commit/35a144793f
[2] /messages/by-id/20240130212304.q66rquj5es4375ab@awork3.anarazel.de
As noted in [1]/messages/by-id/o5yadhhmyjo53svzwvaocww6zkrp63i4f32cw3treuh46pxtza@hyqio5b2tkt6 applying this to the backbranches required backpatching
7bc9a8bdd2d, or the CompilerWarnings task would fail with:
[21:08:42.818] In file included from ../../../src/include/c.h:60,
[21:08:42.818] from ../../../src/include/postgres.h:45,
[21:08:42.818] from postmaster.c:66:
[21:08:42.818] postmaster.c: In function ‘PostmasterMain’:
[21:08:42.818] postmaster.c:862:31: error: ‘__p__environ’ redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
[21:08:42.818] 862 | extern char **environ;
[21:08:42.818] | ^~~~~~~
[21:08:42.818] cc1: all warnings being treated as errors
I now pushed the backpatch and the upgrade to trixie. Let's hope that neither
buildfarm nor CI finds issues...
Greetings,
Andres Freund
[1]: /messages/by-id/o5yadhhmyjo53svzwvaocww6zkrp63i4f32cw3treuh46pxtza@hyqio5b2tkt6
[2]: https://cirrus-ci.com/task/6526575971139584