Explicitly enable meson features in CI

Started by Nazir Bilal Yavuz6 months ago28 messages
#1Nazir Bilal Yavuz
byavuz81@gmail.com
1 attachment(s)

Hi,

Right now, many features are set to auto in Meson builds in CI. This
means Meson tries to detect these features automatically but does not
report an error if it fails to find them. Jacob stated [1]/messages/by-id/CAOYmi+kdR218ke2zu74oTJvzYJcqV1MN5=mGAPqZQuc79HMSVA@mail.gmail.com that this
behavior can lead to issues, such as missing problems in the build
system. Additionally, since CI images are updated automatically, an
update could cause a feature to go missing without any warning.
Therefore, Jacob suggested explicitly enabling these features in the
Meson build configuration. The attached patch implements this change.

I manually checked features from the end of the 'meson setup'
command's output in each task and stored these enabled features in the
MESON_FEATURES variable. I think this should be enough but of course
an automated way would be better if there is any.

One thing I’m unsure about the patch is that all these features are
stored in the MESON_FEATURES environment variable in each task. I
wonder if it might be clearer to rename these variables to
${TASK_NAME}_MESON_FEATURES to avoid confusion.

Also, libcurl is disabled in the OpenBSD CI task until the fix in this
thread [1]/messages/by-id/CAOYmi+kdR218ke2zu74oTJvzYJcqV1MN5=mGAPqZQuc79HMSVA@mail.gmail.com is committed.

Any feedback would be appreciated.

[1]: /messages/by-id/CAOYmi+kdR218ke2zu74oTJvzYJcqV1MN5=mGAPqZQuc79HMSVA@mail.gmail.com

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachments:

v1-0001-ci-meson-Explicitly-enable-meson-features.patchtext/x-patch; charset=US-ASCII; name=v1-0001-ci-meson-Explicitly-enable-meson-features.patchDownload
From 081b43e34d5247d8d9b10498473bb6d440f0008c Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 25 Jun 2025 11:14:26 +0300
Subject: [PATCH v1] ci: meson: Explicitly enable meson features

By default, Meson silently disables features it cannot detect, which can
lead to incomplete builds. Explicitly enabling these features causes the
build to fail if they are missing, making such issues visible early.

Please note that, libcurl is disabled for OpenBSD until the fix in the
https://www.postgresql.org/message-id/CAOYmi%2BkdR218ke2zu74oTJvzYJcqV1MN5%3DmGAPqZQuc79HMSVA%40mail.gmail.com
is committed.

Suggested-by: Jacob Champion <jacob.champion@enterprisedb.com>
---
 .cirrus.tasks.yml | 198 +++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 180 insertions(+), 18 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 92057006c93..2413ac77e2e 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -164,6 +164,30 @@ task:
       -c debug_parallel_query=regress
     PG_TEST_PG_UPGRADE_MODE: --link
 
+    MESON_FEATURES: >-
+      -Dauto_features=disabled
+      -Ddocs=enabled
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dicu=enabled
+      -Dldap=enabled
+      -Dlibcurl=enabled
+      -Dlibxml=enabled
+      -Dlibxslt=enabled
+      -Dlz4=enabled
+      -Dnls=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dpam=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+      -Dtcl_version=tcl86
+      -Dpltcl=enabled
+      -Dreadline=enabled
+      -Duuid=bsd
+      -Dzlib=enabled
+      -Dzstd=enabled
+
   <<: *freebsd_task_template
 
   depends_on: SanityCheck
@@ -198,7 +222,7 @@ task:
       meson setup \
         --buildtype=debug \
         -Dcassert=true -Dinjection_points=true \
-        -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
+        ${MESON_FEATURES} \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
         build
     EOF
@@ -267,8 +291,30 @@ task:
         # See https://postgr.es/m/2490325.1734471752%40sss.pgh.pa.us
         LANG: "C"
         LC_ALL: "C"
+
         # -Duuid is not set for the NetBSD, see the comment below, above
         # configure_script, for more information.
+        MESON_FEATURES: >-
+          -Dauto_features=disabled
+          -Ddocs=enabled
+          -Dgssapi=enabled
+          -Dicu=enabled
+          -Dldap=enabled
+          -Dlibcurl=enabled
+          -Dlibxml=enabled
+          -Dlibxslt=enabled
+          -Dlz4=enabled
+          -Dnls=enabled
+          -Dssl=openssl
+          -Dtap_tests=enabled
+          -Dpam=enabled
+          -Dplperl=enabled
+          -Dplpython=enabled
+          -Dpltcl=enabled
+          -Dreadline=enabled
+          -Dzlib=enabled
+          -Dzstd=enabled
+
       setup_additional_packages_script: |
         #pkgin -y install ...
       <<: *netbsd_task_template
@@ -279,8 +325,31 @@ task:
         OS_NAME: openbsd
         IMAGE_FAMILY: pg-ci-openbsd-postgres
         PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
-        UUID: -Duuid=e2fs
-        TCL: -Dtcl_version=tcl86
+
+        # libcurl is disabled until the fix in the
+        # https://www.postgresql.org/message-id/CAOYmi%2BkdR218ke2zu74oTJvzYJcqV1MN5%3DmGAPqZQuc79HMSVA%40mail.gmail.com
+        # is committed.
+        MESON_FEATURES: >-
+          -Dauto_features=disabled
+          -Dbsd_auth=enabled
+          -Ddocs=enabled
+          -Dicu=enabled
+          -Dldap=enabled
+          -Dlibcurl=disabled
+          -Dlibxml=enabled
+          -Dlibxslt=enabled
+          -Dlz4=enabled
+          -Dssl=openssl
+          -Dtap_tests=enabled
+          -Dplperl=enabled
+          -Dplpython=enabled
+          -Dtcl_version=tcl86
+          -Dpltcl=enabled
+          -Dreadline=enabled
+          -Duuid=e2fs
+          -Dzlib=enabled
+          -Dzstd=enabled
+
       setup_additional_packages_script: |
         #pkg_add -I ...
       # Always core dump to ${CORE_DUMP_DIR}
@@ -317,7 +386,7 @@ task:
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
-        -Dssl=openssl ${UUID} ${TCL} \
+        ${MESON_FEATURES} \
         -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
         build
     EOF
@@ -365,10 +434,6 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
   --with-uuid=ossp
   --with-zstd
 
-LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
-  -Dllvm=enabled
-  -Duuid=e2fs
-
 
 # Check SPECIAL in the matrix: below
 task:
@@ -409,7 +474,6 @@ task:
     LLVM_CONFIG: llvm-config-16
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
   <<: *linux_task_template
 
@@ -503,12 +567,66 @@ task:
         PG_TEST_INITDB_EXTRA_OPTS: >-
           -c io_method=io_uring
 
+        LINUX_64_MESON_FEATURES: >-
+          -Dauto_features=disabled
+          -Ddocs=enabled
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dicu=enabled
+          -Dldap=enabled
+          -Dlibcurl=enabled
+          -Dlibnuma=enabled
+          -Dliburing=enabled
+          -Dlibxml=enabled
+          -Dlibxslt=enabled
+          -Dllvm=enabled
+          -Dlz4=enabled
+          -Dnls=enabled
+          -Dssl=openssl
+          -Dtap_tests=enabled
+          -Dpam=enabled
+          -Dplperl=enabled
+          -Dplpython=enabled
+          -Dpltcl=enabled
+          -Dreadline=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+          -Dzlib=enabled
+          -Dzstd=enabled
+
+        LINUX_32_MESON_FEATURES: >-
+          -Dauto_features=disabled
+          -Ddocs=enabled
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dicu=enabled
+          -Dldap=enabled
+          -Dlibcurl=enabled
+          -Dliburing=enabled
+          -Dlibxml=enabled
+          -Dlibxslt=enabled
+          -Dlz4=enabled
+          -Dnls=enabled
+          -Dssl=openssl
+          -Dtap_tests=enabled
+          -Dpam=enabled
+          -Dplperl=enabled
+          -Dplpython=enabled
+          -Dpltcl=enabled
+          -Dreadline=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+          -Dzlib=enabled
+          -Dzstd=enabled
+
       configure_script: |
         su postgres <<-EOF
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
+            ${LINUX_64_MESON_FEATURES} \
             build
         EOF
 
@@ -520,11 +638,9 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
-            -Dllvm=disabled \
+            ${LINUX_32_MESON_FEATURES} \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
-            -Dlibnuma=disabled \
             build-32
         EOF
 
@@ -588,6 +704,29 @@ task:
     CCACHE_DIR: ${HOME}/ccache
     MACPORTS_CACHE: ${HOME}/macports-cache
 
+    MESON_FEATURES: >-
+      -Dauto_features=disabled
+      -Dbonjour=enabled
+      -Ddtrace=enabled
+      -Ddocs=enabled
+      -Dgssapi=enabled
+      -Dicu=enabled
+      -Dldap=enabled
+      -Dlibcurl=enabled
+      -Dlibxml=enabled
+      -Dlibxslt=enabled
+      -Dlz4=enabled
+      -Dnls=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+      -Dpltcl=enabled
+      -Dreadline=enabled
+      -Duuid=e2fs
+      -Dzlib=enabled
+      -Dzstd=enabled
+
     MACOS_PACKAGE_LIST: >-
       ccache
       icu
@@ -661,7 +800,7 @@ task:
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
       -Dcassert=true -Dinjection_points=true \
-      -Duuid=e2fs -Ddtrace=auto \
+      ${MESON_FEATURES} \
       build
 
   build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
@@ -707,6 +846,14 @@ task:
   env:
     TEST_JOBS: 8 # wild guess, data based value welcome
 
+    MESON_FEATURES: >-
+      -Dauto_features=disabled
+      -Dldap=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+
     # Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That
     # prevents crash reporting from working unless binaries do SetErrorMode()
     # themselves. Furthermore, it appears that either python or, more likely,
@@ -733,7 +880,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -777,6 +924,23 @@ task:
     CHERE_INVOKING: 1
     BASH: C:\msys64\usr\bin\bash.exe -l
 
+    MESON_FEATURES: >-
+      -Dauto_features=disabled
+      -Ddocs=enabled
+      -Dicu=enabled
+      -Dldap=enabled
+      -Dlibxml=enabled
+      -Dlibxslt=enabled
+      -Dlz4=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+      -Dpltcl=enabled
+      -Dreadline=enabled
+      -Dzlib=enabled
+      -Dzstd=enabled
+
   <<: *windows_task_template
 
   ccache_cache:
@@ -793,7 +957,7 @@ task:
 
   # disable -Dnls as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
@@ -831,8 +995,6 @@ task:
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
-
     # GCC emits a warning for llvm-14, so switch to a newer one.
     LLVM_CONFIG: llvm-config-16
 
-- 
2.49.0

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Nazir Bilal Yavuz (#1)
Re: Explicitly enable meson features in CI

On 2 Jul 2025, at 09:22, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Right now, many features are set to auto in Meson builds in CI. This
means Meson tries to detect these features automatically but does not
report an error if it fails to find them. Jacob stated [1] that this
behavior can lead to issues, such as missing problems in the build
system. Additionally, since CI images are updated automatically, an
update could cause a feature to go missing without any warning.
Therefore, Jacob suggested explicitly enabling these features in the
Meson build configuration. The attached patch implements this change.

Big +1 on this, thanks for tackling it.

--
Daniel Gustafsson

#3Peter Eisentraut
peter@eisentraut.org
In reply to: Nazir Bilal Yavuz (#1)
Re: Explicitly enable meson features in CI

On 02.07.25 09:22, Nazir Bilal Yavuz wrote:

One thing I’m unsure about the patch is that all these features are
stored in the MESON_FEATURES environment variable in each task. I
wonder if it might be clearer to rename these variables to
${TASK_NAME}_MESON_FEATURES to avoid confusion.

I would hope we could do this without so much repetition. Why not a
global variable and then have each task override as needed?

(It would also be nice to extra the corresponding configure arguments
into a similar variable, so we can easily keep this aligned.)

Here is a sketch of what I mean:

env:
...
PG_TEST_EXTRA: ...
MESON_COMMON_ARGS: -Dauto_features=disabled -Ddocs=enabled ...
CONFIGURE_COMMON_ARGS: --with-gssapi --with-icu --with-ldap ...

...

configure_script: |
su postgres <<-EOF
meson setup \
${MESON_COMMON_ARGS} -Dpltcl=disabled \
--buildtype=debugoptimized \
--pkg-config-path ${PKGCONFIG_PATH} \
-Dcassert=true -Dinjection_points=true \
-Dssl=openssl ${UUID} ${TCL} \
-DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
build
EOF

(There are additional opportunities to refactor this, such as the
-DPG_TEST_EXTRA option that is repeated everywhere.)

#4Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Peter Eisentraut (#3)
3 attachment(s)
Re: Explicitly enable meson features in CI

Hi,

Thank you for looking into this!

On Wed, 2 Jul 2025 at 14:33, Peter Eisentraut <peter@eisentraut.org> wrote:

On 02.07.25 09:22, Nazir Bilal Yavuz wrote:

One thing I’m unsure about the patch is that all these features are
stored in the MESON_FEATURES environment variable in each task. I
wonder if it might be clearer to rename these variables to
${TASK_NAME}_MESON_FEATURES to avoid confusion.

I would hope we could do this without so much repetition. Why not a
global variable and then have each task override as needed?

(It would also be nice to extra the corresponding configure arguments
into a similar variable, so we can easily keep this aligned.)

Common configure arguments are '-Dcassert=true
-Dinjection_points=true', I addressed that in the 0003.

Here is a sketch of what I mean:

env:
...
PG_TEST_EXTRA: ...
MESON_COMMON_ARGS: -Dauto_features=disabled -Ddocs=enabled ...
CONFIGURE_COMMON_ARGS: --with-gssapi --with-icu --with-ldap ...

I agree that this repetition does not look good but my idea was to be
able to see which features are enabled at one glance. I tried to apply
grouping in v2:

1) args that are shared between all meson tasks except SanityCheck
are: auto_features, ldap, ssl=openssl, tap_tests, plperl, plpython
2) args that are shared between all meson tasks except SanityCheck and
Windows VS task are: docs, icu, libxml, libxslt, lz4, pltcl, readline,
zlib, zstd

I stored #1 in the MESON_COMMON_FEATURES variable and #2 in the
MESON_NON_VS_FEATURES variable. Then merged #1 and #2 in the
MESON_COMMON_NON_VS_FEATURES variable. So it is like that:

- All meson tasks excluding the Windows VS and SanityCheck tasks use
MESON_COMMON_NON_VS_FEATURES and overrides it.
- Windows VS task uses MESON_COMMON_FEATURES.

...

configure_script: |
su postgres <<-EOF
meson setup \
${MESON_COMMON_ARGS} -Dpltcl=disabled \
--buildtype=debugoptimized \
--pkg-config-path ${PKGCONFIG_PATH} \
-Dcassert=true -Dinjection_points=true \
-Dssl=openssl ${UUID} ${TCL} \
-DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
build
EOF

(There are additional opportunities to refactor this, such as the
-DPG_TEST_EXTRA option that is repeated everywhere.)

-DPG_TEST_EXTRA option is used only in the NetBSD and OpenBSD tasks
but it is unnecessary. They can use the top level PG_TEST_EXTRA
environment variable. This is fixed in 0001.

To sum up:

0001 is for removing unnecessary PG_TEST_EXTRA from the NetBSD and
OpenBSD tasks.
0002 is the actual patch but this time I tried to address that
repetition problem by storing common meson features in variables.
0003 is storing common configure arguments ('-Dcassert=true
-Dinjection_points=true') in one variable.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachments:

v2-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchtext/x-patch; charset=US-ASCII; name=v2-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchDownload
From b8846511c07c7008e742de42b954b67b25a6194b Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 18:07:51 +0300
Subject: [PATCH v2 1/3] ci: Remove PG_TEST_EXTRA from NetBSD and OpenBSD

PG_TEST_EXTRA environment variable is already set at the top level.
NetBSD and OpenBSD tasks will use this top level PG_TEST_EXTRA as
default.

Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 92057006c93..a7f75c5b59f 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -318,7 +318,6 @@ task:
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
         -Dssl=openssl ${UUID} ${TCL} \
-        -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
         build
     EOF
 
-- 
2.49.0

v2-0002-ci-meson-Explicitly-enable-meson-features.patchtext/x-patch; charset=US-ASCII; name=v2-0002-ci-meson-Explicitly-enable-meson-features.patchDownload
From 89f786fd408179f77b5a94a079cb2826f7dc0c6d Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 25 Jun 2025 11:14:26 +0300
Subject: [PATCH v2 2/3] ci: meson: Explicitly enable meson features

By default, Meson silently disables features it cannot detect, which can
lead to incomplete builds. Explicitly enabling these features causes the
build to fail if they are missing, making such issues visible early.

Please note that, libcurl is disabled for OpenBSD until the fix in the
https://www.postgresql.org/message-id/CAOYmi%2BkdR218ke2zu74oTJvzYJcqV1MN5%3DmGAPqZQuc79HMSVA%40mail.gmail.com
is committed.

Suggested-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 107 ++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 89 insertions(+), 18 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index a7f75c5b59f..ca679025a8f 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,29 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Meson feature flags, shared between all meson tasks except the
+  # 'SanityCheck' task
+  MESON_COMMON_FEATURES: >-
+    -Dauto_features=disabled
+    -Dldap=enabled
+    -Dssl=openssl
+    -Dtap_tests=enabled
+    -Dplperl=enabled
+    -Dplpython=enabled
+
+  # Like 'MESON_COMMON_FEATURES' but not shared with 'Windows - VS' task too
+  MESON_NON_VS_FEATURES: >-
+    -Ddocs=enabled
+    -Dicu=enabled
+    -Dlibxml=enabled
+    -Dlibxslt=enabled
+    -Dlz4=enabled
+    -Dpltcl=enabled
+    -Dreadline=enabled
+    -Dzlib=enabled
+    -Dzstd=enabled
+  MESON_COMMON_NON_VS_FEATURES: "${MESON_COMMON_FEATURES} ${MESON_NON_VS_FEATURES}"
+
 
 # What files to preserve in case tests fail
 on_failure_ac: &on_failure_ac
@@ -164,6 +187,15 @@ task:
       -c debug_parallel_query=regress
     PG_TEST_PG_UPGRADE_MODE: --link
 
+    MESON_FEATURES: >-
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Dpam=enabled
+      -Dtcl_version=tcl86
+      -Duuid=bsd
+
   <<: *freebsd_task_template
 
   depends_on: SanityCheck
@@ -198,8 +230,8 @@ task:
       meson setup \
         --buildtype=debug \
         -Dcassert=true -Dinjection_points=true \
-        -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
+        ${MESON_COMMON_NON_VS_FEATURES} ${MESON_FEATURES} \
         build
     EOF
   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
@@ -267,8 +299,15 @@ task:
         # See https://postgr.es/m/2490325.1734471752%40sss.pgh.pa.us
         LANG: "C"
         LC_ALL: "C"
+
         # -Duuid is not set for the NetBSD, see the comment below, above
         # configure_script, for more information.
+        MESON_FEATURES: >-
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+
       setup_additional_packages_script: |
         #pkgin -y install ...
       <<: *netbsd_task_template
@@ -279,8 +318,16 @@ task:
         OS_NAME: openbsd
         IMAGE_FAMILY: pg-ci-openbsd-postgres
         PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
-        UUID: -Duuid=e2fs
-        TCL: -Dtcl_version=tcl86
+
+        # libcurl is disabled until the fix in the
+        # https://www.postgresql.org/message-id/CAOYmi%2BkdR218ke2zu74oTJvzYJcqV1MN5%3DmGAPqZQuc79HMSVA%40mail.gmail.com
+        # is committed.
+        MESON_FEATURES: >-
+          -Dbsd_auth=enabled
+          -Dlibcurl=disabled
+          -Dtcl_version=tcl86
+          -Duuid=e2fs
+
       setup_additional_packages_script: |
         #pkg_add -I ...
       # Always core dump to ${CORE_DUMP_DIR}
@@ -317,7 +364,7 @@ task:
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
-        -Dssl=openssl ${UUID} ${TCL} \
+        ${MESON_COMMON_NON_VS_FEATURES} ${MESON_FEATURES} \
         build
     EOF
 
@@ -364,10 +411,6 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
   --with-uuid=ossp
   --with-zstd
 
-LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
-  -Dllvm=enabled
-  -Duuid=e2fs
-
 
 # Check SPECIAL in the matrix: below
 task:
@@ -408,7 +451,6 @@ task:
     LLVM_CONFIG: llvm-config-16
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
   <<: *linux_task_template
 
@@ -502,12 +544,37 @@ task:
         PG_TEST_INITDB_EXTRA_OPTS: >-
           -c io_method=io_uring
 
+        LINUX_64_MESON_FEATURES: >-
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dlibnuma=enabled
+          -Dliburing=enabled
+          -Dllvm=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+          -Dplperl=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+
+        LINUX_32_MESON_FEATURES: >-
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dliburing=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+
       configure_script: |
         su postgres <<-EOF
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
+            ${MESON_COMMON_NON_VS_FEATURES} ${LINUX_64_MESON_FEATURES} \
             build
         EOF
 
@@ -519,11 +586,9 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
-            -Dllvm=disabled \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
-            -Dlibnuma=disabled \
+            ${MESON_COMMON_NON_VS_FEATURES} ${LINUX_32_MESON_FEATURES} \
             build-32
         EOF
 
@@ -587,6 +652,14 @@ task:
     CCACHE_DIR: ${HOME}/ccache
     MACPORTS_CACHE: ${HOME}/macports-cache
 
+    MESON_FEATURES: >-
+      -Dbonjour=enabled
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Duuid=e2fs
+
     MACOS_PACKAGE_LIST: >-
       ccache
       icu
@@ -660,7 +733,7 @@ task:
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
       -Dcassert=true -Dinjection_points=true \
-      -Duuid=e2fs -Ddtrace=auto \
+      ${MESON_COMMON_NON_VS_FEATURES} ${MESON_FEATURES} \
       build
 
   build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
@@ -732,7 +805,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_COMMON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -792,7 +865,7 @@ task:
 
   # disable -Dnls as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_NON_VS_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
@@ -830,8 +903,6 @@ task:
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
-
     # GCC emits a warning for llvm-14, so switch to a newer one.
     LLVM_CONFIG: llvm-config-16
 
-- 
2.49.0

v2-0003-ci-meson-Store-common-Postgres-configuration-opti.patchtext/x-patch; charset=US-ASCII; name=v2-0003-ci-meson-Store-common-Postgres-configuration-opti.patchDownload
From 16831a93f5f4e51175ba028ebe65a432606e781c Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 17:30:59 +0300
Subject: [PATCH v2 3/3] ci: meson: Store common Postgres configuration options
 in one variable

This helps to keep things aligned.

Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index ca679025a8f..da1959984f1 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,10 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Postgres config args for the meson builds, shared between all meson tasks
+  # except the 'SanityCheck' task
+  MESON_COMMON_PG_CONFIG_ARGS: -Dcassert=true -Dinjection_points=true
+
   # Meson feature flags, shared between all meson tasks except the
   # 'SanityCheck' task
   MESON_COMMON_FEATURES: >-
@@ -228,8 +232,8 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debug \
-        -Dcassert=true -Dinjection_points=true \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
         ${MESON_COMMON_NON_VS_FEATURES} ${MESON_FEATURES} \
         build
@@ -361,9 +365,9 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
-        -Dcassert=true -Dinjection_points=true \
         ${MESON_COMMON_NON_VS_FEATURES} ${MESON_FEATURES} \
         build
     EOF
@@ -572,8 +576,8 @@ task:
       configure_script: |
         su postgres <<-EOF
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             ${MESON_COMMON_NON_VS_FEATURES} ${LINUX_64_MESON_FEATURES} \
             build
         EOF
@@ -584,8 +588,8 @@ task:
         su postgres <<-EOF
           export CC='ccache gcc -m32'
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
             ${MESON_COMMON_NON_VS_FEATURES} ${LINUX_32_MESON_FEATURES} \
@@ -729,10 +733,10 @@ task:
   configure_script: |
     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
     meson setup \
+      ${MESON_COMMON_PG_CONFIG_ARGS} \
       --buildtype=debug \
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
-      -Dcassert=true -Dinjection_points=true \
       ${MESON_COMMON_NON_VS_FEATURES} ${MESON_FEATURES} \
       build
 
@@ -805,7 +809,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_COMMON_FEATURES% build
+    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_COMMON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -865,7 +869,7 @@ task:
 
   # disable -Dnls as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_NON_VS_FEATURES% -DTAR=%TAR% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_NON_VS_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
-- 
2.49.0

#5Daniel Gustafsson
daniel@yesql.se
In reply to: Nazir Bilal Yavuz (#4)
Re: Explicitly enable meson features in CI

On 3 Jul 2025, at 09:27, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
On Wed, 2 Jul 2025 at 14:33, Peter Eisentraut <peter@eisentraut.org> wrote:

Here is a sketch of what I mean:

env:
...
PG_TEST_EXTRA: ...
MESON_COMMON_ARGS: -Dauto_features=disabled -Ddocs=enabled ...
CONFIGURE_COMMON_ARGS: --with-gssapi --with-icu --with-ldap ...

I agree that this repetition does not look good but my idea was to be
able to see which features are enabled at one glance. I tried to apply
grouping in v2:

FWIW, I didn't mind the repetition in v1 but I won't argue against the current
approach either.

+  # Like 'MESON_COMMON_FEATURES' but not shared with 'Windows - VS' task too
+  MESON_NON_VS_FEATURES: >-

I'm not a fan of this name, it feel a bit unintuitive to describe what it isn't
instead of what it is. How about MESON_LINUX_UNIX_FEATURES or something along
those lines?

   # disable -Dnls as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR
% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_NON_VS_FEATURES% -D
TAR=%TAR% build"

The MinGW build no longer disables nls, or am I missing something?

--
Daniel Gustafsson

#6Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Daniel Gustafsson (#5)
Re: Explicitly enable meson features in CI

Hi,

Thank you for looking into this!

On Thu, 3 Jul 2025 at 16:21, Daniel Gustafsson <daniel@yesql.se> wrote:

On 3 Jul 2025, at 09:27, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
On Wed, 2 Jul 2025 at 14:33, Peter Eisentraut <peter@eisentraut.org> wrote:

Here is a sketch of what I mean:

env:
...
PG_TEST_EXTRA: ...
MESON_COMMON_ARGS: -Dauto_features=disabled -Ddocs=enabled ...
CONFIGURE_COMMON_ARGS: --with-gssapi --with-icu --with-ldap ...

I agree that this repetition does not look good but my idea was to be
able to see which features are enabled at one glance. I tried to apply
grouping in v2:

FWIW, I didn't mind the repetition in v1 but I won't argue against the current
approach either.

I feel the same.

+  # Like 'MESON_COMMON_FEATURES' but not shared with 'Windows - VS' task too
+  MESON_NON_VS_FEATURES: >-

I'm not a fan of this name, it feel a bit unintuitive to describe what it isn't
instead of what it is. How about MESON_LINUX_UNIX_FEATURES or something along
those lines?

I agree that MESON_NON_VS_FEATURES is not intuitive but can MinGW be
considered as LINUX or UNIX?

# disable -Dnls as the number of files it creates cause a noticable slowdown
configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR
% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_NON_VS_FEATURES% -D
TAR=%TAR% build"

The MinGW build no longer disables nls, or am I missing something?

Auto features are already disabled. So, there is no need to disable
nls manually. By saying that, it would be better to remove this
comment now.

--
Regards,
Nazir Bilal Yavuz
Microsoft

#7Daniel Gustafsson
daniel@yesql.se
In reply to: Nazir Bilal Yavuz (#6)
Re: Explicitly enable meson features in CI

On 3 Jul 2025, at 15:50, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
On Thu, 3 Jul 2025 at 16:21, Daniel Gustafsson <daniel@yesql.se> wrote:

+  # Like 'MESON_COMMON_FEATURES' but not shared with 'Windows - VS' task too
+  MESON_NON_VS_FEATURES: >-

I'm not a fan of this name, it feel a bit unintuitive to describe what it isn't
instead of what it is. How about MESON_LINUX_UNIX_FEATURES or something along
those lines?

I agree that MESON_NON_VS_FEATURES is not intuitive but can MinGW be
considered as LINUX or UNIX?

That is an excellent question, according to our fine documentation it is a
"Unix-like build environment".

An alternative approach would be to instead of having opt-in's for non-Windows
have opt-outs for Windows, ie a MESON_WINDOWS_EXCLUDES which does =disabled on
the specific features we dont want on Windows?

The MinGW build no longer disables nls, or am I missing something?

Auto features are already disabled. So, there is no need to disable
nls manually. By saying that, it would be better to remove this
comment now.

Aha, that explains it. Maybe reword the comment to retain the knowledge for
the future without making it sound like something is missing from the command.
How about something like:

-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a
+  # noticable slowdown

--
Daniel Gustafsson

#8Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Daniel Gustafsson (#7)
3 attachment(s)
Re: Explicitly enable meson features in CI

Hi,

On Thu, 3 Jul 2025 at 17:07, Daniel Gustafsson <daniel@yesql.se> wrote:

On 3 Jul 2025, at 15:50, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
On Thu, 3 Jul 2025 at 16:21, Daniel Gustafsson <daniel@yesql.se> wrote:

+  # Like 'MESON_COMMON_FEATURES' but not shared with 'Windows - VS' task too
+  MESON_NON_VS_FEATURES: >-

I'm not a fan of this name, it feel a bit unintuitive to describe what it isn't
instead of what it is. How about MESON_LINUX_UNIX_FEATURES or something along
those lines?

I agree that MESON_NON_VS_FEATURES is not intuitive but can MinGW be
considered as LINUX or UNIX?

That is an excellent question, according to our fine documentation it is a
"Unix-like build environment".

An alternative approach would be to instead of having opt-in's for non-Windows
have opt-outs for Windows, ie a MESON_WINDOWS_EXCLUDES which does =disabled on
the specific features we dont want on Windows?

I think this would make things complicated. Instead, we can set
Windows VS tasks' features in its task, then we can have a one common
feature variable at the top level and have a comment about this
variable not being used in the Windows VS task. Basically the same
with your approach but instead of using a common feature variable and
disabling features from it, we enable them again in the Windows VS
task. I used this approach in the v3-0002.

The MinGW build no longer disables nls, or am I missing something?

Auto features are already disabled. So, there is no need to disable
nls manually. By saying that, it would be better to remove this
comment now.

Aha, that explains it. Maybe reword the comment to retain the knowledge for
the future without making it sound like something is missing from the command.
How about something like:

-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a
+  # noticable slowdown

Yes, I think this is better. Done.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachments:

v3-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchtext/x-patch; charset=US-ASCII; name=v3-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchDownload
From a9158cfcb9c98c4193dea85894e91101ed5c0a0b Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 18:07:51 +0300
Subject: [PATCH v3 1/3] ci: Remove PG_TEST_EXTRA from NetBSD and OpenBSD

PG_TEST_EXTRA environment variable is already set at the top level.
NetBSD and OpenBSD tasks will use this top level PG_TEST_EXTRA as
default.

Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 92057006c93..a7f75c5b59f 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -318,7 +318,6 @@ task:
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
         -Dssl=openssl ${UUID} ${TCL} \
-        -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
         build
     EOF
 
-- 
2.49.0

v3-0002-ci-meson-Explicitly-enable-meson-features.patchtext/x-patch; charset=US-ASCII; name=v3-0002-ci-meson-Explicitly-enable-meson-features.patchDownload
From 5241a9412b430c7bd4dc89664685f038a69104ed Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 25 Jun 2025 11:14:26 +0300
Subject: [PATCH v3 2/3] ci: meson: Explicitly enable meson features

By default, Meson silently disables features it cannot detect, which can
lead to incomplete builds. Explicitly enabling these features causes the
build to fail if they are missing, making such issues visible early.

Please note that, libcurl is disabled for OpenBSD until the fix in the
https://www.postgresql.org/message-id/CAOYmi%2BkdR218ke2zu74oTJvzYJcqV1MN5%3DmGAPqZQuc79HMSVA%40mail.gmail.com
is committed.

Suggested-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 111 ++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 93 insertions(+), 18 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index a7f75c5b59f..e8f166dba2c 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,25 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Meson feature flags, shared between all meson tasks except the
+  # 'SanityCheck' and 'Windows - VS' tasks
+  MESON_COMMON_FEATURES: >-
+    -Dauto_features=disabled
+    -Dldap=enabled
+    -Dssl=openssl
+    -Dtap_tests=enabled
+    -Dplperl=enabled
+    -Dplpython=enabled
+    -Ddocs=enabled
+    -Dicu=enabled
+    -Dlibxml=enabled
+    -Dlibxslt=enabled
+    -Dlz4=enabled
+    -Dpltcl=enabled
+    -Dreadline=enabled
+    -Dzlib=enabled
+    -Dzstd=enabled
+
 
 # What files to preserve in case tests fail
 on_failure_ac: &on_failure_ac
@@ -164,6 +183,15 @@ task:
       -c debug_parallel_query=regress
     PG_TEST_PG_UPGRADE_MODE: --link
 
+    MESON_FEATURES: >-
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Dpam=enabled
+      -Dtcl_version=tcl86
+      -Duuid=bsd
+
   <<: *freebsd_task_template
 
   depends_on: SanityCheck
@@ -198,8 +226,8 @@ task:
       meson setup \
         --buildtype=debug \
         -Dcassert=true -Dinjection_points=true \
-        -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
@@ -269,6 +297,12 @@ task:
         LC_ALL: "C"
         # -Duuid is not set for the NetBSD, see the comment below, above
         # configure_script, for more information.
+        MESON_FEATURES: >-
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+
       setup_additional_packages_script: |
         #pkgin -y install ...
       <<: *netbsd_task_template
@@ -279,8 +313,16 @@ task:
         OS_NAME: openbsd
         IMAGE_FAMILY: pg-ci-openbsd-postgres
         PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
-        UUID: -Duuid=e2fs
-        TCL: -Dtcl_version=tcl86
+
+        # libcurl is disabled until the fix in the
+        # https://www.postgresql.org/message-id/CAOYmi%2BkdR218ke2zu74oTJvzYJcqV1MN5%3DmGAPqZQuc79HMSVA%40mail.gmail.com
+        # is committed.
+        MESON_FEATURES: >-
+          -Dbsd_auth=enabled
+          -Dlibcurl=disabled
+          -Dtcl_version=tcl86
+          -Duuid=e2fs
+
       setup_additional_packages_script: |
         #pkg_add -I ...
       # Always core dump to ${CORE_DUMP_DIR}
@@ -317,7 +359,7 @@ task:
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
-        -Dssl=openssl ${UUID} ${TCL} \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
 
@@ -364,10 +406,6 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
   --with-uuid=ossp
   --with-zstd
 
-LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
-  -Dllvm=enabled
-  -Duuid=e2fs
-
 
 # Check SPECIAL in the matrix: below
 task:
@@ -408,7 +446,6 @@ task:
     LLVM_CONFIG: llvm-config-16
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
   <<: *linux_task_template
 
@@ -502,12 +539,37 @@ task:
         PG_TEST_INITDB_EXTRA_OPTS: >-
           -c io_method=io_uring
 
+        LINUX_64_MESON_FEATURES: >-
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dlibnuma=enabled
+          -Dliburing=enabled
+          -Dllvm=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+          -Dplperl=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+
+        LINUX_32_MESON_FEATURES: >-
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dliburing=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+
       configure_script: |
         su postgres <<-EOF
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
+            ${MESON_COMMON_FEATURES} ${LINUX_64_MESON_FEATURES} \
             build
         EOF
 
@@ -519,11 +581,9 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
-            -Dllvm=disabled \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
-            -Dlibnuma=disabled \
+            ${MESON_COMMON_FEATURES} ${LINUX_32_MESON_FEATURES} \
             build-32
         EOF
 
@@ -587,6 +647,14 @@ task:
     CCACHE_DIR: ${HOME}/ccache
     MACPORTS_CACHE: ${HOME}/macports-cache
 
+    MESON_FEATURES: >-
+      -Dbonjour=enabled
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Duuid=e2fs
+
     MACOS_PACKAGE_LIST: >-
       ccache
       icu
@@ -660,7 +728,7 @@ task:
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
       -Dcassert=true -Dinjection_points=true \
-      -Duuid=e2fs -Ddtrace=auto \
+      ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
   build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
@@ -715,6 +783,14 @@ task:
     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
 
+    MESON_FEATURES:
+      -Dauto_features=disabled
+      -Dldap=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+
   <<: *windows_task_template
 
   depends_on: SanityCheck
@@ -732,7 +808,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -790,9 +866,9 @@ task:
     %BASH% -c "where perl"
     %BASH% -c "perl --version"
 
-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
@@ -830,7 +906,6 @@ task:
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
     # GCC emits a warning for llvm-14, so switch to a newer one.
     LLVM_CONFIG: llvm-config-16
-- 
2.49.0

v3-0003-ci-meson-Store-common-Postgres-configuration-opti.patchtext/x-patch; charset=US-ASCII; name=v3-0003-ci-meson-Store-common-Postgres-configuration-opti.patchDownload
From 3cf48a338cfdf8888828f63fbfd27c0f44b35b71 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 17:30:59 +0300
Subject: [PATCH v3 3/3] ci: meson: Store common Postgres configuration options
 in one variable

This helps to keep things aligned.

Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index e8f166dba2c..e40ccd00e29 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,10 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Postgres config args for the meson builds, shared between all meson tasks
+  # except the 'SanityCheck' task
+  MESON_COMMON_PG_CONFIG_ARGS: -Dcassert=true -Dinjection_points=true
+
   # Meson feature flags, shared between all meson tasks except the
   # 'SanityCheck' and 'Windows - VS' tasks
   MESON_COMMON_FEATURES: >-
@@ -224,8 +228,8 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debug \
-        -Dcassert=true -Dinjection_points=true \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
@@ -356,9 +360,9 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
-        -Dcassert=true -Dinjection_points=true \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
@@ -567,8 +571,8 @@ task:
       configure_script: |
         su postgres <<-EOF
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             ${MESON_COMMON_FEATURES} ${LINUX_64_MESON_FEATURES} \
             build
         EOF
@@ -579,8 +583,8 @@ task:
         su postgres <<-EOF
           export CC='ccache gcc -m32'
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
             ${MESON_COMMON_FEATURES} ${LINUX_32_MESON_FEATURES} \
@@ -724,10 +728,10 @@ task:
   configure_script: |
     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
     meson setup \
+      ${MESON_COMMON_PG_CONFIG_ARGS} \
       --buildtype=debug \
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
-      -Dcassert=true -Dinjection_points=true \
       ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
@@ -808,7 +812,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
+    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -868,7 +872,7 @@ task:
 
   # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
-- 
2.49.0

#9Daniel Gustafsson
daniel@yesql.se
In reply to: Nazir Bilal Yavuz (#8)
Re: Explicitly enable meson features in CI

On 4 Jul 2025, at 09:33, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
On Thu, 3 Jul 2025 at 17:07, Daniel Gustafsson <daniel@yesql.se> wrote:

An alternative approach would be to instead of having opt-in's for non-Windows
have opt-outs for Windows, ie a MESON_WINDOWS_EXCLUDES which does =disabled on
the specific features we dont want on Windows?

I think this would make things complicated.

I think you're right.

Instead, we can set
Windows VS tasks' features in its task, then we can have a one common
feature variable at the top level and have a comment about this
variable not being used in the Windows VS task. Basically the same
with your approach but instead of using a common feature variable and
disabling features from it, we enable them again in the Windows VS
task. I used this approach in the v3-0002.

The proposal in v3 strikes a good balance between avoiding repetition and being
readable.

--
Daniel Gustafsson

#10Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Nazir Bilal Yavuz (#1)
3 attachment(s)
Re: Explicitly enable meson features in CI

Hi,

On Wed, 2 Jul 2025 at 10:22, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Also, libcurl is disabled in the OpenBSD CI task until the fix in this
thread [1] is committed.

This fix is committed in 7376e60854 so libcurl is enabled for OpenBSD in v4.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachments:

v4-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchtext/x-patch; charset=US-ASCII; name=v4-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchDownload
From 4cbdc65f0f473754d425b3824f22c88b86d78492 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 18:07:51 +0300
Subject: [PATCH v4 1/3] ci: Remove PG_TEST_EXTRA from NetBSD and OpenBSD

PG_TEST_EXTRA environment variable is already set at the top level.
NetBSD and OpenBSD tasks will use this top level PG_TEST_EXTRA as
default.

Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 92057006c93..a7f75c5b59f 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -318,7 +318,6 @@ task:
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
         -Dssl=openssl ${UUID} ${TCL} \
-        -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
         build
     EOF
 
-- 
2.49.0

v4-0002-ci-meson-Explicitly-enable-meson-features.patchtext/x-patch; charset=US-ASCII; name=v4-0002-ci-meson-Explicitly-enable-meson-features.patchDownload
From 0e9ee191aab8c5d71569ee00831e9fff6f1225b1 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 25 Jun 2025 11:14:26 +0300
Subject: [PATCH v4 2/3] ci: meson: Explicitly enable meson features

By default, Meson silently disables features it cannot detect, which can
lead to incomplete builds. Explicitly enabling these features causes the
build to fail if they are missing, making such issues visible early.

Suggested-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 108 ++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 90 insertions(+), 18 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index a7f75c5b59f..e8f5fee2627 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,25 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Meson feature flags, shared between all meson tasks except the
+  # 'SanityCheck' and 'Windows - VS' tasks
+  MESON_COMMON_FEATURES: >-
+    -Dauto_features=disabled
+    -Dldap=enabled
+    -Dssl=openssl
+    -Dtap_tests=enabled
+    -Dplperl=enabled
+    -Dplpython=enabled
+    -Ddocs=enabled
+    -Dicu=enabled
+    -Dlibxml=enabled
+    -Dlibxslt=enabled
+    -Dlz4=enabled
+    -Dpltcl=enabled
+    -Dreadline=enabled
+    -Dzlib=enabled
+    -Dzstd=enabled
+
 
 # What files to preserve in case tests fail
 on_failure_ac: &on_failure_ac
@@ -164,6 +183,15 @@ task:
       -c debug_parallel_query=regress
     PG_TEST_PG_UPGRADE_MODE: --link
 
+    MESON_FEATURES: >-
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Dpam=enabled
+      -Dtcl_version=tcl86
+      -Duuid=bsd
+
   <<: *freebsd_task_template
 
   depends_on: SanityCheck
@@ -198,8 +226,8 @@ task:
       meson setup \
         --buildtype=debug \
         -Dcassert=true -Dinjection_points=true \
-        -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
@@ -269,6 +297,12 @@ task:
         LC_ALL: "C"
         # -Duuid is not set for the NetBSD, see the comment below, above
         # configure_script, for more information.
+        MESON_FEATURES: >-
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+
       setup_additional_packages_script: |
         #pkgin -y install ...
       <<: *netbsd_task_template
@@ -279,8 +313,13 @@ task:
         OS_NAME: openbsd
         IMAGE_FAMILY: pg-ci-openbsd-postgres
         PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
-        UUID: -Duuid=e2fs
-        TCL: -Dtcl_version=tcl86
+
+        MESON_FEATURES: >-
+          -Dbsd_auth=enabled
+          -Dlibcurl=enabled
+          -Dtcl_version=tcl86
+          -Duuid=e2fs
+
       setup_additional_packages_script: |
         #pkg_add -I ...
       # Always core dump to ${CORE_DUMP_DIR}
@@ -317,7 +356,7 @@ task:
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
-        -Dssl=openssl ${UUID} ${TCL} \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
 
@@ -364,10 +403,6 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
   --with-uuid=ossp
   --with-zstd
 
-LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
-  -Dllvm=enabled
-  -Duuid=e2fs
-
 
 # Check SPECIAL in the matrix: below
 task:
@@ -408,7 +443,6 @@ task:
     LLVM_CONFIG: llvm-config-16
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
   <<: *linux_task_template
 
@@ -502,12 +536,37 @@ task:
         PG_TEST_INITDB_EXTRA_OPTS: >-
           -c io_method=io_uring
 
+        LINUX_64_MESON_FEATURES: >-
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dlibnuma=enabled
+          -Dliburing=enabled
+          -Dllvm=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+          -Dplperl=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+
+        LINUX_32_MESON_FEATURES: >-
+          -Ddocs_pdf=enabled
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dliburing=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+          -Dselinux=enabled
+          -Dsystemd=enabled
+          -Duuid=e2fs
+
       configure_script: |
         su postgres <<-EOF
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
+            ${MESON_COMMON_FEATURES} ${LINUX_64_MESON_FEATURES} \
             build
         EOF
 
@@ -519,11 +578,9 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
-            -Dllvm=disabled \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
-            -Dlibnuma=disabled \
+            ${MESON_COMMON_FEATURES} ${LINUX_32_MESON_FEATURES} \
             build-32
         EOF
 
@@ -587,6 +644,14 @@ task:
     CCACHE_DIR: ${HOME}/ccache
     MACPORTS_CACHE: ${HOME}/macports-cache
 
+    MESON_FEATURES: >-
+      -Dbonjour=enabled
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Duuid=e2fs
+
     MACOS_PACKAGE_LIST: >-
       ccache
       icu
@@ -660,7 +725,7 @@ task:
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
       -Dcassert=true -Dinjection_points=true \
-      -Duuid=e2fs -Ddtrace=auto \
+      ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
   build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
@@ -715,6 +780,14 @@ task:
     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
 
+    MESON_FEATURES:
+      -Dauto_features=disabled
+      -Dldap=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+
   <<: *windows_task_template
 
   depends_on: SanityCheck
@@ -732,7 +805,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -790,9 +863,9 @@ task:
     %BASH% -c "where perl"
     %BASH% -c "perl --version"
 
-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
@@ -830,7 +903,6 @@ task:
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
     # GCC emits a warning for llvm-14, so switch to a newer one.
     LLVM_CONFIG: llvm-config-16
-- 
2.49.0

v4-0003-ci-meson-Store-common-Postgres-configuration-opti.patchtext/x-patch; charset=US-ASCII; name=v4-0003-ci-meson-Store-common-Postgres-configuration-opti.patchDownload
From f833527b3b465495585faa023e6ffea08f359226 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 17:30:59 +0300
Subject: [PATCH v4 3/3] ci: meson: Store common Postgres configuration options
 in one variable

This helps to keep things aligned.

Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index e8f5fee2627..81609a4dbd9 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,10 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Postgres config args for the meson builds, shared between all meson tasks
+  # except the 'SanityCheck' task
+  MESON_COMMON_PG_CONFIG_ARGS: -Dcassert=true -Dinjection_points=true
+
   # Meson feature flags, shared between all meson tasks except the
   # 'SanityCheck' and 'Windows - VS' tasks
   MESON_COMMON_FEATURES: >-
@@ -224,8 +228,8 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debug \
-        -Dcassert=true -Dinjection_points=true \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
@@ -353,9 +357,9 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
-        -Dcassert=true -Dinjection_points=true \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
@@ -564,8 +568,8 @@ task:
       configure_script: |
         su postgres <<-EOF
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             ${MESON_COMMON_FEATURES} ${LINUX_64_MESON_FEATURES} \
             build
         EOF
@@ -576,8 +580,8 @@ task:
         su postgres <<-EOF
           export CC='ccache gcc -m32'
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
             ${MESON_COMMON_FEATURES} ${LINUX_32_MESON_FEATURES} \
@@ -721,10 +725,10 @@ task:
   configure_script: |
     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
     meson setup \
+      ${MESON_COMMON_PG_CONFIG_ARGS} \
       --buildtype=debug \
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
-      -Dcassert=true -Dinjection_points=true \
       ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
@@ -805,7 +809,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
+    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -865,7 +869,7 @@ task:
 
   # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
-- 
2.49.0

#11Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Nazir Bilal Yavuz (#10)
Re: Explicitly enable meson features in CI

Hi,

On Tue, 8 Jul 2025 at 12:10, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Hi,

On Wed, 2 Jul 2025 at 10:22, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Also, libcurl is disabled in the OpenBSD CI task until the fix in this
thread [1] is committed.

This fix is committed in 7376e60854 so libcurl is enabled for OpenBSD in v4.

Andres off-list mentioned that if we explicitly enable features for
*all* of the tasks, then none of the tasks will be testing the auto
feature option and I agree with Andres. My suggestion is setting
features to auto for Debian - Meson task. I decided on this because I
think it is the most checked CI task so it would be easier to catch if
one of the features is disabled without anyone noticing.

--
Regards,
Nazir Bilal Yavuz
Microsoft

#12Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Nazir Bilal Yavuz (#11)
Re: Explicitly enable meson features in CI

On Thu, Jul 10, 2025 at 2:59 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Andres off-list mentioned that if we explicitly enable features for
*all* of the tasks, then none of the tasks will be testing the auto
feature option and I agree with Andres. My suggestion is setting
features to auto for Debian - Meson task. I decided on this because I
think it is the most checked CI task

Hehe, that's certainly true for me...

so it would be easier to catch if
one of the features is disabled without anyone noticing.

Seems reasonable. If we do this, can we rename the job with a "- Meson
Auto" suffix or something, to try to call the difference out
explicitly?

--Jacob

#13Daniel Gustafsson
daniel@yesql.se
In reply to: Jacob Champion (#12)
Re: Explicitly enable meson features in CI

On 10 Jul 2025, at 19:12, Jacob Champion <jacob.champion@enterprisedb.com> wrote:
On Thu, Jul 10, 2025 at 2:59 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

so it would be easier to catch if
one of the features is disabled without anyone noticing.

Seems reasonable.

Agreed.

If we do this, can we rename the job with a "- Meson
Auto" suffix or something, to try to call the difference out
explicitly?

+1

--
Daniel Gustafsson

#14Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Jacob Champion (#12)
Re: Explicitly enable meson features in CI

Hi,

On Thu, 10 Jul 2025 at 20:12, Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

On Thu, Jul 10, 2025 at 2:59 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Andres off-list mentioned that if we explicitly enable features for
*all* of the tasks, then none of the tasks will be testing the auto
feature option and I agree with Andres. My suggestion is setting
features to auto for Debian - Meson task. I decided on this because I
think it is the most checked CI task

Hehe, that's certainly true for me...

so it would be easier to catch if
one of the features is disabled without anyone noticing.

Seems reasonable. If we do this, can we rename the job with a "- Meson
Auto" suffix or something, to try to call the difference out
explicitly?

I think renaming it would be better but then we have two Linux tasks:

- Linux - Debian Bookworm - Autoconf
- Linux - Debian Bookworm - Meson Auto

For me it looks like 'Meson Auto' can be confused with 'Autoconf'. We
can rename it as a 'Meson Auto Feature Detection' but that is a bit
longer. Do you have any ideas? If you think 'Meson Auto' is good
enough, we can continue with it, too.

--
Regards,
Nazir Bilal Yavuz
Microsoft

#15Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Nazir Bilal Yavuz (#14)
3 attachment(s)
Re: Explicitly enable meson features in CI

Hi,

On Fri, 11 Jul 2025 at 14:00, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Hi,

On Thu, 10 Jul 2025 at 20:12, Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

On Thu, Jul 10, 2025 at 2:59 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Andres off-list mentioned that if we explicitly enable features for
*all* of the tasks, then none of the tasks will be testing the auto
feature option and I agree with Andres. My suggestion is setting
features to auto for Debian - Meson task. I decided on this because I
think it is the most checked CI task

Hehe, that's certainly true for me...

so it would be easier to catch if
one of the features is disabled without anyone noticing.

Seems reasonable. If we do this, can we rename the job with a "- Meson
Auto" suffix or something, to try to call the difference out
explicitly?

I think renaming it would be better but then we have two Linux tasks:

- Linux - Debian Bookworm - Autoconf
- Linux - Debian Bookworm - Meson Auto

For me it looks like 'Meson Auto' can be confused with 'Autoconf'. We
can rename it as a 'Meson Auto Feature Detection' but that is a bit
longer. Do you have any ideas? If you think 'Meson Auto' is good
enough, we can continue with it, too.

I renamed 'Meson Auto' as 'Meson Auto Feature Detection' in v5.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachments:

v5-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchtext/x-patch; charset=US-ASCII; name=v5-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchDownload
From 3504b3745c659a31b442c331a2cf76511693595b Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 18:07:51 +0300
Subject: [PATCH v5 1/3] ci: Remove PG_TEST_EXTRA from NetBSD and OpenBSD

PG_TEST_EXTRA environment variable is already set at the top level.
NetBSD and OpenBSD tasks will use this top level PG_TEST_EXTRA as
default.

Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 1a366975d82..13a093c03be 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -318,7 +318,6 @@ task:
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
         -Dssl=openssl ${UUID} ${TCL} \
-        -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
         build
     EOF
 
-- 
2.50.0

v5-0002-ci-meson-Explicitly-enable-meson-features.patchtext/x-patch; charset=US-ASCII; name=v5-0002-ci-meson-Explicitly-enable-meson-features.patchDownload
From 283c638d02799bf947e7883eff0311beb9ab15ec Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 25 Jun 2025 11:14:26 +0300
Subject: [PATCH v5 2/3] ci: meson: Explicitly enable meson features

By default, Meson silently disables features it cannot detect, which can
lead to incomplete builds. Explicitly enabling these features causes the
build to fail if they are missing, making such issues visible early.

These features are explicitly enabled for all meson tasks, except:
SanityCheck: uses almost no dependencies.
Windows - VS: has fewer dependencies than listed here, so defines its
own.
Linux: uses the 'auto' feature option to test meson's automatic
behavior.

Suggested-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 89 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 70 insertions(+), 19 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 13a093c03be..ef51aca32f6 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,27 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Meson feature flags shared by all meson tasks, except:
+  # SanityCheck: uses almost no dependencies.
+  # Windows - VS: has fewer dependencies than listed here, so defines its own.
+  # Linux: uses the 'auto' feature option to test meson's automatic behavior.
+  MESON_COMMON_FEATURES: >-
+    -Dauto_features=disabled
+    -Dldap=enabled
+    -Dssl=openssl
+    -Dtap_tests=enabled
+    -Dplperl=enabled
+    -Dplpython=enabled
+    -Ddocs=enabled
+    -Dicu=enabled
+    -Dlibxml=enabled
+    -Dlibxslt=enabled
+    -Dlz4=enabled
+    -Dpltcl=enabled
+    -Dreadline=enabled
+    -Dzlib=enabled
+    -Dzstd=enabled
+
 
 # What files to preserve in case tests fail
 on_failure_ac: &on_failure_ac
@@ -164,6 +185,15 @@ task:
       -c debug_parallel_query=regress
     PG_TEST_PG_UPGRADE_MODE: --link
 
+    MESON_FEATURES: >-
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Dpam=enabled
+      -Dtcl_version=tcl86
+      -Duuid=bsd
+
   <<: *freebsd_task_template
 
   depends_on: SanityCheck
@@ -198,8 +228,8 @@ task:
       meson setup \
         --buildtype=debug \
         -Dcassert=true -Dinjection_points=true \
-        -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
@@ -269,6 +299,12 @@ task:
         LC_ALL: "C"
         # -Duuid is not set for the NetBSD, see the comment below, above
         # configure_script, for more information.
+        MESON_FEATURES: >-
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+
       setup_additional_packages_script: |
         #pkgin -y install ...
       <<: *netbsd_task_template
@@ -279,8 +315,13 @@ task:
         OS_NAME: openbsd
         IMAGE_FAMILY: pg-ci-openbsd-postgres
         PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
-        UUID: -Duuid=e2fs
-        TCL: -Dtcl_version=tcl86
+
+        MESON_FEATURES: >-
+          -Dbsd_auth=enabled
+          -Dlibcurl=enabled
+          -Dtcl_version=tcl86
+          -Duuid=e2fs
+
       setup_additional_packages_script: |
         #pkg_add -I ...
       # Always core dump to ${CORE_DUMP_DIR}
@@ -317,7 +358,7 @@ task:
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
-        -Dssl=openssl ${UUID} ${TCL} \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
 
@@ -364,10 +405,6 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
   --with-uuid=ossp
   --with-zstd
 
-LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
-  -Dllvm=enabled
-  -Duuid=e2fs
-
 
 # Check SPECIAL in the matrix: below
 task:
@@ -408,7 +445,8 @@ task:
     LLVM_CONFIG: llvm-config-16
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
+    LINUX_MESON_FEATURES: >-
+      -Duuid=e2fs
 
   <<: *linux_task_template
 
@@ -494,7 +532,7 @@ task:
     #   are typically printed in the server log
     # - Test both 64bit and 32 bit builds
     # - uses io_method=io_uring
-    - name: Linux - Debian Bookworm - Meson
+    - name: Linux - Debian Bookworm - Meson Auto Feature Detection
 
       env:
         CCACHE_MAXSIZE: "400M" # tests two different builds
@@ -507,7 +545,7 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
+            ${LINUX_MESON_FEATURES} -Dllvm=enabled \
             build
         EOF
 
@@ -519,11 +557,9 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
-            -Dllvm=disabled \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
-            -Dlibnuma=disabled \
+            ${LINUX_MESON_FEATURES} -Dlibnuma=disabled \
             build-32
         EOF
 
@@ -587,6 +623,14 @@ task:
     CCACHE_DIR: ${HOME}/ccache
     MACPORTS_CACHE: ${HOME}/macports-cache
 
+    MESON_FEATURES: >-
+      -Dbonjour=enabled
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Duuid=e2fs
+
     MACOS_PACKAGE_LIST: >-
       ccache
       icu
@@ -660,7 +704,7 @@ task:
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
       -Dcassert=true -Dinjection_points=true \
-      -Duuid=e2fs -Ddtrace=auto \
+      ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
   build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
@@ -715,6 +759,14 @@ task:
     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
 
+    MESON_FEATURES:
+      -Dauto_features=disabled
+      -Dldap=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+
   <<: *windows_task_template
 
   depends_on: SanityCheck
@@ -732,7 +784,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -790,9 +842,9 @@ task:
     %BASH% -c "where perl"
     %BASH% -c "perl --version"
 
-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
@@ -830,7 +882,6 @@ task:
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
     # GCC emits a warning for llvm-14, so switch to a newer one.
     LLVM_CONFIG: llvm-config-16
-- 
2.50.0

v5-0003-ci-meson-Store-common-Postgres-configuration-opti.patchtext/x-patch; charset=US-ASCII; name=v5-0003-ci-meson-Store-common-Postgres-configuration-opti.patchDownload
From 42c38c4639fdf66a35b08299374d979440bb1f29 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 17:30:59 +0300
Subject: [PATCH v5 3/3] ci: meson: Store common Postgres configuration options
 in one variable

This helps to keep things aligned.

Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index ef51aca32f6..33f1005dee8 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,10 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Postgres config args for the meson builds, shared between all meson tasks
+  # except the 'SanityCheck' task
+  MESON_COMMON_PG_CONFIG_ARGS: -Dcassert=true -Dinjection_points=true
+
   # Meson feature flags shared by all meson tasks, except:
   # SanityCheck: uses almost no dependencies.
   # Windows - VS: has fewer dependencies than listed here, so defines its own.
@@ -226,8 +230,8 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debug \
-        -Dcassert=true -Dinjection_points=true \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
@@ -355,9 +359,9 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
-        -Dcassert=true -Dinjection_points=true \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
@@ -543,8 +547,8 @@ task:
       configure_script: |
         su postgres <<-EOF
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             ${LINUX_MESON_FEATURES} -Dllvm=enabled \
             build
         EOF
@@ -555,8 +559,8 @@ task:
         su postgres <<-EOF
           export CC='ccache gcc -m32'
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
             ${LINUX_MESON_FEATURES} -Dlibnuma=disabled \
@@ -700,10 +704,10 @@ task:
   configure_script: |
     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
     meson setup \
+      ${MESON_COMMON_PG_CONFIG_ARGS} \
       --buildtype=debug \
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
-      -Dcassert=true -Dinjection_points=true \
       ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
@@ -784,7 +788,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
+    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -844,7 +848,7 @@ task:
 
   # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
-- 
2.50.0

#16Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Nazir Bilal Yavuz (#15)
Re: Explicitly enable meson features in CI

On Wed, Jul 16, 2025 at 4:12 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

For me it looks like 'Meson Auto' can be confused with 'Autoconf'. We
can rename it as a 'Meson Auto Feature Detection' but that is a bit
longer. Do you have any ideas? If you think 'Meson Auto' is good
enough, we can continue with it, too.

I renamed 'Meson Auto' as 'Meson Auto Feature Detection' in v5.

Sorry for the delay -- while that feels a little wordy to me, it's
also trivially changed. Not worth bikeshedding over unless someone
else complains, IMO. :D

Is there anything else in particular you'd like review on? (I've
marked this patchset RfC.)

Thanks,
--Jacob

#17Andres Freund
andres@anarazel.de
In reply to: Nazir Bilal Yavuz (#15)
Re: Explicitly enable meson features in CI

Hi,

On 2025-07-16 14:12:22 +0300, Nazir Bilal Yavuz wrote:

On Fri, 11 Jul 2025 at 14:00, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

On Thu, 10 Jul 2025 at 20:12, Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

On Thu, Jul 10, 2025 at 2:59 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Andres off-list mentioned that if we explicitly enable features for
*all* of the tasks, then none of the tasks will be testing the auto
feature option and I agree with Andres. My suggestion is setting
features to auto for Debian - Meson task. I decided on this because I
think it is the most checked CI task

Hehe, that's certainly true for me...

so it would be easier to catch if
one of the features is disabled without anyone noticing.

Seems reasonable. If we do this, can we rename the job with a "- Meson
Auto" suffix or something, to try to call the difference out
explicitly?

I think renaming it would be better but then we have two Linux tasks:

- Linux - Debian Bookworm - Autoconf
- Linux - Debian Bookworm - Meson Auto

For me it looks like 'Meson Auto' can be confused with 'Autoconf'. We
can rename it as a 'Meson Auto Feature Detection' but that is a bit
longer. Do you have any ideas? If you think 'Meson Auto' is good
enough, we can continue with it, too.

I renamed 'Meson Auto' as 'Meson Auto Feature Detection' in v5.

FWIW, I don't think it's a good idea to the Auto bit to the name. We have
several special things about various tests, if we add all of them to the task
name, we'll have very long task names. This one would already be

Linux - Debian Bookworm - Meson Auto Features Detection - 32 and 64 Bit build & tests - Alignment, Undefined Behaviour Sanitizer - IO method=io_uring

And the task names would change a lot more, which is also a pain for things
like the commitfest / cfbot web apps.

But it *should* be added to the "SPECIAL:" comment.

Greetings,

Andres Freund

#18Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Andres Freund (#17)
3 attachment(s)
Re: Explicitly enable meson features in CI

Hi,

On Wed, 16 Jul 2025 at 19:02, Andres Freund <andres@anarazel.de> wrote:

Hi,

On 2025-07-16 14:12:22 +0300, Nazir Bilal Yavuz wrote:

On Fri, 11 Jul 2025 at 14:00, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

On Thu, 10 Jul 2025 at 20:12, Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

On Thu, Jul 10, 2025 at 2:59 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Andres off-list mentioned that if we explicitly enable features for
*all* of the tasks, then none of the tasks will be testing the auto
feature option and I agree with Andres. My suggestion is setting
features to auto for Debian - Meson task. I decided on this because I
think it is the most checked CI task

Hehe, that's certainly true for me...

so it would be easier to catch if
one of the features is disabled without anyone noticing.

Seems reasonable. If we do this, can we rename the job with a "- Meson
Auto" suffix or something, to try to call the difference out
explicitly?

I think renaming it would be better but then we have two Linux tasks:

- Linux - Debian Bookworm - Autoconf
- Linux - Debian Bookworm - Meson Auto

For me it looks like 'Meson Auto' can be confused with 'Autoconf'. We
can rename it as a 'Meson Auto Feature Detection' but that is a bit
longer. Do you have any ideas? If you think 'Meson Auto' is good
enough, we can continue with it, too.

I renamed 'Meson Auto' as 'Meson Auto Feature Detection' in v5.

FWIW, I don't think it's a good idea to the Auto bit to the name. We have
several special things about various tests, if we add all of them to the task
name, we'll have very long task names. This one would already be

Linux - Debian Bookworm - Meson Auto Features Detection - 32 and 64 Bit build & tests - Alignment, Undefined Behaviour Sanitizer - IO method=io_uring

And the task names would change a lot more, which is also a pain for things
like the commitfest / cfbot web apps.

I don't have a strong opinion on this. I think the naming change
clarifies things but as you said then we may/should add other specific
settings to the task name. So, I reverted the naming change.

But it *should* be added to the "SPECIAL:" comment.

Done.

v6 is attached.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachments:

v6-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchtext/x-patch; charset=US-ASCII; name=v6-0001-ci-Remove-PG_TEST_EXTRA-from-NetBSD-and-OpenBSD.patchDownload
From e4b21cfe7f9614b885a92a43d241b71fb67b363f Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 18:07:51 +0300
Subject: [PATCH v6 1/3] ci: Remove PG_TEST_EXTRA from NetBSD and OpenBSD

PG_TEST_EXTRA environment variable is already set at the top level.
NetBSD and OpenBSD tasks will use this top level PG_TEST_EXTRA as
default.

Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 1a366975d82..13a093c03be 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -318,7 +318,6 @@ task:
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
         -Dssl=openssl ${UUID} ${TCL} \
-        -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
         build
     EOF
 
-- 
2.50.0

v6-0002-ci-meson-Explicitly-enable-meson-features.patchtext/x-patch; charset=US-ASCII; name=v6-0002-ci-meson-Explicitly-enable-meson-features.patchDownload
From 7bf22529d6ab6072619f8af1c6f3180f31328d8b Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 25 Jun 2025 11:14:26 +0300
Subject: [PATCH v6 2/3] ci: meson: Explicitly enable meson features

By default, Meson silently disables features it cannot detect, which can
lead to incomplete builds. Explicitly enabling these features causes the
build to fail if they are missing, making such issues visible early.

These features are explicitly enabled for all meson tasks, except:
SanityCheck: uses almost no dependencies.
Windows - VS: has fewer dependencies than listed here, so defines its
own.
Linux: uses the 'auto' feature option to test meson feature
autodetection.

Suggested-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 88 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 70 insertions(+), 18 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 13a093c03be..a0d6f5b892e 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,27 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Meson feature flags shared by all meson tasks, except:
+  # SanityCheck: uses almost no dependencies.
+  # Windows - VS: has fewer dependencies than listed here, so defines its own.
+  # Linux: uses the 'auto' feature option to test meson feature autodetection.
+  MESON_COMMON_FEATURES: >-
+    -Dauto_features=disabled
+    -Dldap=enabled
+    -Dssl=openssl
+    -Dtap_tests=enabled
+    -Dplperl=enabled
+    -Dplpython=enabled
+    -Ddocs=enabled
+    -Dicu=enabled
+    -Dlibxml=enabled
+    -Dlibxslt=enabled
+    -Dlz4=enabled
+    -Dpltcl=enabled
+    -Dreadline=enabled
+    -Dzlib=enabled
+    -Dzstd=enabled
+
 
 # What files to preserve in case tests fail
 on_failure_ac: &on_failure_ac
@@ -164,6 +185,15 @@ task:
       -c debug_parallel_query=regress
     PG_TEST_PG_UPGRADE_MODE: --link
 
+    MESON_FEATURES: >-
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Dpam=enabled
+      -Dtcl_version=tcl86
+      -Duuid=bsd
+
   <<: *freebsd_task_template
 
   depends_on: SanityCheck
@@ -198,8 +228,8 @@ task:
       meson setup \
         --buildtype=debug \
         -Dcassert=true -Dinjection_points=true \
-        -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
@@ -269,6 +299,12 @@ task:
         LC_ALL: "C"
         # -Duuid is not set for the NetBSD, see the comment below, above
         # configure_script, for more information.
+        MESON_FEATURES: >-
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+
       setup_additional_packages_script: |
         #pkgin -y install ...
       <<: *netbsd_task_template
@@ -279,8 +315,13 @@ task:
         OS_NAME: openbsd
         IMAGE_FAMILY: pg-ci-openbsd-postgres
         PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
-        UUID: -Duuid=e2fs
-        TCL: -Dtcl_version=tcl86
+
+        MESON_FEATURES: >-
+          -Dbsd_auth=enabled
+          -Dlibcurl=enabled
+          -Dtcl_version=tcl86
+          -Duuid=e2fs
+
       setup_additional_packages_script: |
         #pkg_add -I ...
       # Always core dump to ${CORE_DUMP_DIR}
@@ -317,7 +358,7 @@ task:
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
-        -Dssl=openssl ${UUID} ${TCL} \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
 
@@ -364,10 +405,6 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
   --with-uuid=ossp
   --with-zstd
 
-LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
-  -Dllvm=enabled
-  -Duuid=e2fs
-
 
 # Check SPECIAL in the matrix: below
 task:
@@ -408,7 +445,8 @@ task:
     LLVM_CONFIG: llvm-config-16
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
+    LINUX_MESON_FEATURES: >-
+      -Duuid=e2fs
 
   <<: *linux_task_template
 
@@ -494,6 +532,7 @@ task:
     #   are typically printed in the server log
     # - Test both 64bit and 32 bit builds
     # - uses io_method=io_uring
+    # - Uses meson feature autodetection
     - name: Linux - Debian Bookworm - Meson
 
       env:
@@ -507,7 +546,7 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
+            ${LINUX_MESON_FEATURES} -Dllvm=enabled \
             build
         EOF
 
@@ -519,11 +558,9 @@ task:
           meson setup \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
-            -Dllvm=disabled \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
-            -Dlibnuma=disabled \
+            ${LINUX_MESON_FEATURES} -Dlibnuma=disabled \
             build-32
         EOF
 
@@ -587,6 +624,14 @@ task:
     CCACHE_DIR: ${HOME}/ccache
     MACPORTS_CACHE: ${HOME}/macports-cache
 
+    MESON_FEATURES: >-
+      -Dbonjour=enabled
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Duuid=e2fs
+
     MACOS_PACKAGE_LIST: >-
       ccache
       icu
@@ -660,7 +705,7 @@ task:
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
       -Dcassert=true -Dinjection_points=true \
-      -Duuid=e2fs -Ddtrace=auto \
+      ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
   build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
@@ -715,6 +760,14 @@ task:
     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
 
+    MESON_FEATURES:
+      -Dauto_features=disabled
+      -Dldap=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+
   <<: *windows_task_template
 
   depends_on: SanityCheck
@@ -732,7 +785,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -790,9 +843,9 @@ task:
     %BASH% -c "where perl"
     %BASH% -c "perl --version"
 
-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
@@ -830,7 +883,6 @@ task:
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
     # GCC emits a warning for llvm-14, so switch to a newer one.
     LLVM_CONFIG: llvm-config-16
-- 
2.50.0

v6-0003-ci-meson-Store-common-Postgres-configuration-opti.patchtext/x-patch; charset=US-ASCII; name=v6-0003-ci-meson-Store-common-Postgres-configuration-opti.patchDownload
From 614c4d578622ca3c14a9bbfbb09e9fdb5e7befda Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Wed, 2 Jul 2025 17:30:59 +0300
Subject: [PATCH v6 3/3] ci: meson: Store common Postgres configuration options
 in one variable

This helps to keep things aligned.

Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index a0d6f5b892e..b8415f6fee5 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,10 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Postgres config args for the meson builds, shared between all meson tasks
+  # except the 'SanityCheck' task
+  MESON_COMMON_PG_CONFIG_ARGS: -Dcassert=true -Dinjection_points=true
+
   # Meson feature flags shared by all meson tasks, except:
   # SanityCheck: uses almost no dependencies.
   # Windows - VS: has fewer dependencies than listed here, so defines its own.
@@ -226,8 +230,8 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debug \
-        -Dcassert=true -Dinjection_points=true \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
@@ -355,9 +359,9 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
-        -Dcassert=true -Dinjection_points=true \
         ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
@@ -544,8 +548,8 @@ task:
       configure_script: |
         su postgres <<-EOF
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             ${LINUX_MESON_FEATURES} -Dllvm=enabled \
             build
         EOF
@@ -556,8 +560,8 @@ task:
         su postgres <<-EOF
           export CC='ccache gcc -m32'
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
             ${LINUX_MESON_FEATURES} -Dlibnuma=disabled \
@@ -701,10 +705,10 @@ task:
   configure_script: |
     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
     meson setup \
+      ${MESON_COMMON_PG_CONFIG_ARGS} \
       --buildtype=debug \
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
-      -Dcassert=true -Dinjection_points=true \
       ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
@@ -785,7 +789,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
+    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -845,7 +849,7 @@ task:
 
   # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
-- 
2.50.0

#19Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Jacob Champion (#16)
Re: Explicitly enable meson features in CI

Hi,

On Wed, 16 Jul 2025 at 18:24, Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

On Wed, Jul 16, 2025 at 4:12 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

For me it looks like 'Meson Auto' can be confused with 'Autoconf'. We
can rename it as a 'Meson Auto Feature Detection' but that is a bit
longer. Do you have any ideas? If you think 'Meson Auto' is good
enough, we can continue with it, too.

I renamed 'Meson Auto' as 'Meson Auto Feature Detection' in v5.

Sorry for the delay -- while that feels a little wordy to me, it's
also trivially changed. Not worth bikeshedding over unless someone
else complains, IMO. :D

I reverted the naming change in v6 based on Andres' comments [1]/messages/by-id/zltxefhw7bej3o4oxvkfuoa2glbnip3jacp7rvacbrv5oepql3@gs3lbwg6unmv.

Is there anything else in particular you'd like review on? (I've
marked this patchset RfC.)

Not at the moment, thank you so much!

[1]: /messages/by-id/zltxefhw7bej3o4oxvkfuoa2glbnip3jacp7rvacbrv5oepql3@gs3lbwg6unmv

--
Regards,
Nazir Bilal Yavuz
Microsoft

#20Daniel Gustafsson
daniel@yesql.se
In reply to: Nazir Bilal Yavuz (#19)
Re: Explicitly enable meson features in CI

On 17 Jul 2025, at 10:33, Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
On Wed, 16 Jul 2025 at 18:24, Jacob Champion <jacob.champion@enterprisedb.com> wrote:

Is there anything else in particular you'd like review on? (I've
marked this patchset RfC.)

Reading over the v6 version posted upthread, I agree with the patch being
ready. Are you taking care of it Jacob?

-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown

I think this should be s/noticable/noticeable/ (which is a nitpick a commmitter
can deal with, no need for a new version IMO).

--
Daniel Gustafsson

#21Andrew Dunstan
andrew@dunslane.net
In reply to: Daniel Gustafsson (#20)
Re: Explicitly enable meson features in CI

On 2025-07-28 Mo 8:08 AM, Daniel Gustafsson wrote:

On 17 Jul 2025, at 10:33, Nazir Bilal Yavuz<byavuz81@gmail.com> wrote:
On Wed, 16 Jul 2025 at 18:24, Jacob Champion<jacob.champion@enterprisedb.com> wrote:

Is there anything else in particular you'd like review on? (I've
marked this patchset RfC.)

Reading over the v6 version posted upthread, I agree with the patch being
ready. Are you taking care of it Jacob?

-  # disable -Dnls as the number of files it creates cause a noticable slowdown
+  # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown

I think this should be s/noticable/noticeable/ (which is a nitpick a commmitter
can deal with, no need for a new version IMO).

At the same time they should do:

s/need/needs/

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

#22Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Daniel Gustafsson (#20)
Re: Explicitly enable meson features in CI

On Mon, Jul 28, 2025 at 5:08 AM Daniel Gustafsson <daniel@yesql.se> wrote:

Reading over the v6 version posted upthread, I agree with the patch being
ready. Are you taking care of it Jacob?

I was admittedly a bit nervous about pushing changes to the infra.
Andres, Bilal, do you have a list of things to check after pushing big
changes to .cirrus stuff, or is it just "a CI build still works on my
repo, so all good"?

--Jacob

#23Andres Freund
andres@anarazel.de
In reply to: Jacob Champion (#22)
Re: Explicitly enable meson features in CI

Hi,

On 2025-07-28 09:03:38 -0700, Jacob Champion wrote:

On Mon, Jul 28, 2025 at 5:08 AM Daniel Gustafsson <daniel@yesql.se> wrote:

Reading over the v6 version posted upthread, I agree with the patch being
ready. Are you taking care of it Jacob?

I was admittedly a bit nervous about pushing changes to the infra.
Andres, Bilal, do you have a list of things to check after pushing big
changes to .cirrus stuff, or is it just "a CI build still works on my
repo, so all good"?

I don't think there's anything special to check for CI specific changes, so I
guess "... all good" covers it...

Greetings,

Andres Freund

#24Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Andres Freund (#23)
Re: Explicitly enable meson features in CI

On Mon, Jul 28, 2025 at 10:48 AM Andres Freund <andres@anarazel.de> wrote:

I don't think there's anything special to check for CI specific changes, so I
guess "... all good" covers it...

Sounds good. I will take another look at this with a committer hat and
push Sometime Soon.

Thanks!
--Jacob

#25Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Jacob Champion (#24)
3 attachment(s)
Re: Explicitly enable meson features in CI

On Mon, Jul 28, 2025 at 11:20 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

Sounds good. I will take another look at this with a committer hat and
push Sometime Soon.

Getting back to this -- for v7 I've rebased over the FASTLINK commit.
I've squashed 0002 and 0003 together, too -- I think it's easier to
see the new envvar hierarchy in one commit.

I also moved the `-Dnls=disabled` setting into a mingw-specific
MESON_FEATURES variable. I think the existing comment in v6 wasn't
really in a place to prevent a developer from adding it to
MESON_COMMON_FEATURES in the future, which would have regressed
967db242c. There shouldn't be a hazard now.

--Jacob

Attachments:

since-v6.diff.txttext/plain; charset=US-ASCII; name=since-v6.diff.txtDownload
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index b8415f6fee5..94999e64f5f 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -789,7 +789,7 @@ task:
   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
+    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -833,6 +833,11 @@ task:
     CHERE_INVOKING: 1
     BASH: C:\msys64\usr\bin\bash.exe -l
 
+    # Keep -Dnls explicitly disabled, as the number of files it creates causes a
+    # noticeable slowdown.
+    MESON_FEATURES: >-
+      -Dnls=disabled
+
   <<: *windows_task_template
 
   ccache_cache:
@@ -847,9 +852,8 @@ task:
     %BASH% -c "where perl"
     %BASH% -c "perl --version"
 
-  # -Dnls need to be disabled as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS%  -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_FEATURES% -DTAR=%TAR% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS% -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_FEATURES% %MESON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
v7-0001-ci-Remove-extra-PG_TEST_EXTRA-from-NetBSD-OpenBSD.patchapplication/octet-stream; name=v7-0001-ci-Remove-extra-PG_TEST_EXTRA-from-NetBSD-OpenBSD.patchDownload
From 5aae4dfc28162e80d5e7aa8d8b1f98c38b746643 Mon Sep 17 00:00:00 2001
From: Jacob Champion <jacob.champion@enterprisedb.com>
Date: Tue, 5 Aug 2025 13:23:19 -0700
Subject: [PATCH v7 1/2] ci: Remove extra PG_TEST_EXTRA from NetBSD/OpenBSD

The PG_TEST_EXTRA environment variable is already set at the top level.
As of 3d1aec225, Meson tasks will use this by default, so there's no
need for another intermediate variable.

Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index d84875168bb..40b15dc9661 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -321,7 +321,6 @@ task:
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
         -Dssl=openssl ${UUID} ${TCL} \
-        -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
         build
     EOF
 
-- 
2.34.1

v7-0002-ci-Explicitly-enable-Meson-features.patchapplication/octet-stream; name=v7-0002-ci-Explicitly-enable-Meson-features.patchDownload
From 017da93faf3ae7f40cd4c093660a6b24941d322e Mon Sep 17 00:00:00 2001
From: Jacob Champion <jacob.champion@enterprisedb.com>
Date: Tue, 5 Aug 2025 13:26:37 -0700
Subject: [PATCH v7 2/2] ci: Explicitly enable Meson features

Meson's "auto" feature mode silently disables features with missing
prerequisites, which is nice for development but can lead to false
positives in the CI (such as my commit b0635bfda, which broke OAuth
detection on OpenBSD). Use an explicit feature list in the Cirrus config
instead; this mirrors the --with-XXX experience of Autoconf.

While we're here, also move common configuration options into a single
variable, MESON_COMMON_PG_CONFIG_ARGS, as suggested by Peter. The
resulting hierarchy is as follows:

MESON_COMMON_PG_CONFIG_ARGS   "global" Meson configuration options

MESON_COMMON_FEATURES         the default set of CI features, to be used
                              unless there's a specific reason not to

MESON_FEATURES                per-OS feature configuration, overriding
                              the above

The current exceptions to the use of MESON_COMMON_FEATURES are
- SanityCheck, which uses almost no dependencies;
- Windows - VS, whose feature list has diverged significantly from the
  others; and
- Linux, which continues to use 'auto' features so that autodetection is
  still tested in the CI. (Options shared between 64- and 32-bit builds
  can go into LINUX_MESON_FEATURES instead.)

Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Suggested-by: Jacob Champion <jacob.champion@enterprisedb.com>
Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/flat/CAN55FZ0aO8d_jkyRijcGP8qO%3DXH09qG%3Dpw0ZZDvB4LMzuXYU1w%40mail.gmail.com
---
 .cirrus.tasks.yml | 106 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 83 insertions(+), 23 deletions(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 40b15dc9661..eca9d62fc22 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -31,6 +31,31 @@ env:
   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
   PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
 
+  # Postgres config args for the meson builds, shared between all meson tasks
+  # except the 'SanityCheck' task
+  MESON_COMMON_PG_CONFIG_ARGS: -Dcassert=true -Dinjection_points=true
+
+  # Meson feature flags shared by all meson tasks, except:
+  # SanityCheck: uses almost no dependencies.
+  # Windows - VS: has fewer dependencies than listed here, so defines its own.
+  # Linux: uses the 'auto' feature option to test meson feature autodetection.
+  MESON_COMMON_FEATURES: >-
+    -Dauto_features=disabled
+    -Dldap=enabled
+    -Dssl=openssl
+    -Dtap_tests=enabled
+    -Dplperl=enabled
+    -Dplpython=enabled
+    -Ddocs=enabled
+    -Dicu=enabled
+    -Dlibxml=enabled
+    -Dlibxslt=enabled
+    -Dlz4=enabled
+    -Dpltcl=enabled
+    -Dreadline=enabled
+    -Dzlib=enabled
+    -Dzstd=enabled
+
 
 # What files to preserve in case tests fail
 on_failure_ac: &on_failure_ac
@@ -164,6 +189,15 @@ task:
       -c debug_parallel_query=regress
     PG_TEST_PG_UPGRADE_MODE: --link
 
+    MESON_FEATURES: >-
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Dpam=enabled
+      -Dtcl_version=tcl86
+      -Duuid=bsd
+
   <<: *freebsd_task_template
 
   depends_on: SanityCheck
@@ -196,10 +230,10 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debug \
-        -Dcassert=true -Dinjection_points=true \
-        -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
@@ -270,6 +304,12 @@ task:
         LC_ALL: "C"
         # -Duuid is not set for the NetBSD, see the comment below, above
         # configure_script, for more information.
+        MESON_FEATURES: >-
+          -Dgssapi=enabled
+          -Dlibcurl=enabled
+          -Dnls=enabled
+          -Dpam=enabled
+
       setup_additional_packages_script: |
         #pkgin -y install ...
       <<: *netbsd_task_template
@@ -282,8 +322,13 @@ task:
         OS_NAME: openbsd
         IMAGE_FAMILY: pg-ci-openbsd-postgres
         PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
-        UUID: -Duuid=e2fs
-        TCL: -Dtcl_version=tcl86
+
+        MESON_FEATURES: >-
+          -Dbsd_auth=enabled
+          -Dlibcurl=enabled
+          -Dtcl_version=tcl86
+          -Duuid=e2fs
+
       setup_additional_packages_script: |
         #pkg_add -I ...
       # Always core dump to ${CORE_DUMP_DIR}
@@ -317,10 +362,10 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        ${MESON_COMMON_PG_CONFIG_ARGS} \
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
-        -Dcassert=true -Dinjection_points=true \
-        -Dssl=openssl ${UUID} ${TCL} \
+        ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
         build
     EOF
 
@@ -367,10 +412,6 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
   --with-uuid=ossp
   --with-zstd
 
-LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
-  -Dllvm=enabled
-  -Duuid=e2fs
-
 
 # Check SPECIAL in the matrix: below
 task:
@@ -411,7 +452,8 @@ task:
     LLVM_CONFIG: llvm-config-16
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
+    LINUX_MESON_FEATURES: >-
+      -Duuid=e2fs
 
   <<: *linux_task_template
 
@@ -497,6 +539,7 @@ task:
     #   are typically printed in the server log
     # - Test both 64bit and 32 bit builds
     # - uses io_method=io_uring
+    # - Uses meson feature autodetection
     - name: Linux - Debian Bookworm - Meson
 
       env:
@@ -508,9 +551,9 @@ task:
       configure_script: |
         su postgres <<-EOF
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
+            ${LINUX_MESON_FEATURES} -Dllvm=enabled \
             build
         EOF
 
@@ -520,13 +563,11 @@ task:
         su postgres <<-EOF
           export CC='ccache gcc -m32'
           meson setup \
+            ${MESON_COMMON_PG_CONFIG_ARGS} \
             --buildtype=debug \
-            -Dcassert=true -Dinjection_points=true \
-            ${LINUX_MESON_FEATURES} \
-            -Dllvm=disabled \
             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
             -DPERL=perl5.36-i386-linux-gnu \
-            -Dlibnuma=disabled \
+            ${LINUX_MESON_FEATURES} -Dlibnuma=disabled \
             build-32
         EOF
 
@@ -590,6 +631,14 @@ task:
     CCACHE_DIR: ${HOME}/ccache
     MACPORTS_CACHE: ${HOME}/macports-cache
 
+    MESON_FEATURES: >-
+      -Dbonjour=enabled
+      -Ddtrace=enabled
+      -Dgssapi=enabled
+      -Dlibcurl=enabled
+      -Dnls=enabled
+      -Duuid=e2fs
+
     MACOS_PACKAGE_LIST: >-
       ccache
       icu
@@ -659,11 +708,11 @@ task:
   configure_script: |
     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
     meson setup \
+      ${MESON_COMMON_PG_CONFIG_ARGS} \
       --buildtype=debug \
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
-      -Dcassert=true -Dinjection_points=true \
-      -Duuid=e2fs -Ddtrace=auto \
+      ${MESON_COMMON_FEATURES} ${MESON_FEATURES} \
       build
 
   build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
@@ -718,6 +767,14 @@ task:
     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
 
+    MESON_FEATURES:
+      -Dauto_features=disabled
+      -Dldap=enabled
+      -Dssl=openssl
+      -Dtap_tests=enabled
+      -Dplperl=enabled
+      -Dplpython=enabled
+
   <<: *windows_task_template
 
   depends_on: SanityCheck
@@ -734,7 +791,7 @@ task:
 
   configure_script: |
     vcvarsall x64
-    meson setup --backend ninja --buildtype debug -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+    meson setup --backend ninja %MESON_COMMON_PG_CONFIG_ARGS% --buildtype debug -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% %MESON_FEATURES% build
 
   build_script: |
     vcvarsall x64
@@ -776,6 +833,11 @@ task:
     CHERE_INVOKING: 1
     BASH: C:\msys64\usr\bin\bash.exe -l
 
+    # Keep -Dnls explicitly disabled, as the number of files it creates causes a
+    # noticeable slowdown.
+    MESON_FEATURES: >-
+      -Dnls=disabled
+
   <<: *windows_task_template
 
   ccache_cache:
@@ -790,9 +852,8 @@ task:
     %BASH% -c "where perl"
     %BASH% -c "perl --version"
 
-  # disable -Dnls as the number of files it creates cause a noticable slowdown
   configure_script: |
-    %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+    %BASH% -c "meson setup %MESON_COMMON_PG_CONFIG_ARGS% -Ddebug=true -Doptimization=g -Db_pch=true %MESON_COMMON_FEATURES% %MESON_FEATURES% -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
@@ -829,7 +890,6 @@ task:
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-    LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
 
     # GCC emits a warning for llvm-14, so switch to a newer one.
     LLVM_CONFIG: llvm-config-16
-- 
2.34.1

#26Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: Jacob Champion (#25)
Re: Explicitly enable meson features in CI

Hi,

On Tue, 26 Aug 2025 at 02:37, Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

On Mon, Jul 28, 2025 at 11:20 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

Sounds good. I will take another look at this with a committer hat and
push Sometime Soon.

Getting back to this -- for v7 I've rebased over the FASTLINK commit.
I've squashed 0002 and 0003 together, too -- I think it's easier to
see the new envvar hierarchy in one commit.

I also moved the `-Dnls=disabled` setting into a mingw-specific
MESON_FEATURES variable. I think the existing comment in v6 wasn't
really in a place to prevent a developer from adding it to
MESON_COMMON_FEATURES in the future, which would have regressed
967db242c. There shouldn't be a hazard now.

Thank you for doing these!

Patches LGTM. I also checked the CI tasks and everything looks good.

--
Regards,
Nazir Bilal Yavuz
Microsoft

#27Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Nazir Bilal Yavuz (#26)
Re: Explicitly enable meson features in CI

On Tue, Aug 26, 2025 at 12:27 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:

Patches LGTM. I also checked the CI tasks and everything looks good.

Great, thanks! The full diff of the Meson configure output for each
task also looks good. So I'll plan to push v7.

--Jacob

#28Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Jacob Champion (#27)
Re: Explicitly enable meson features in CI

On Tue, Aug 26, 2025 at 9:40 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:

Great, thanks! The full diff of the Meson configure output for each
task also looks good. So I'll plan to push v7.

Pushed, finally, and all the Cirrus tasks look happy. Thank you very
much for this improvement!

--Jacob