Hi,

On Wed, 16 Jul 2025 at 19:02, Andres Freund <and...@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 <byavu...@gmail.com> wrote:
> > > On Thu, 10 Jul 2025 at 20:12, Jacob Champion
> > > <jacob.champ...@enterprisedb.com> wrote:
> > > >
> > > > On Thu, Jul 10, 2025 at 2:59 AM Nazir Bilal Yavuz <byavu...@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
From e4b21cfe7f9614b885a92a43d241b71fb67b363f Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavu...@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

From 7bf22529d6ab6072619f8af1c6f3180f31328d8b Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavu...@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.champ...@enterprisedb.com>
Reviewed-by: Andres Freund <and...@anarazel.de>
Reviewed-by: Daniel Gustafsson <dan...@yesql.se>
Reviewed-by: Jacob Champion <jacob.champ...@enterprisedb.com>
Reviewed-by: Peter Eisentraut <pe...@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

From 614c4d578622ca3c14a9bbfbb09e9fdb5e7befda Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavu...@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 <pe...@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

Reply via email to