On 17.06.25 19:36, Peter Eisentraut wrote:
meson.build currently says

# We want < 0.56 for python 3.5 compatibility on old platforms. EPEL for
# RHEL 7 has 0.55. < 0.54 would require replacing some uses of the fs
# module, < 0.53 all uses of fs. So far there's no need to go to >=0.56.
meson_version: '>=0.54',

Since the current minimum supported Python version is now actually 3.6, we could update this a bit.

The first Meson version to require Python 3.7 is 0.62, so we should stay below that.

Moving to 0.55 and 0.56 would get rid of some future-deprecated warnings.

There is some conditional code for 0.57 and 0.59, so landing on either of these would allow getting rid of some of that.

I see that Rocky Linux 8 ships with Meson 0.58.2 [0], so maybe that is a good target to aim for.  (I don't know if that carried over from RHEL 8 or is their own doing.)  But there aren't any compelling features new in 0.58 (format strings seem nice but are pretty much cosmetic), so maybe setting the minimum to 0.57 is enough.

Ok, let's make a small start. Here is a patch set that moves the requirement to >=0.57. As explained above, this allows getting rid of a bunch of conditional code and the future-deprecated warnings.

There is one mention that I didn't dare touch:

if have_gssapi
  # Meson before 0.57.0 did not support using check_header() etc with
  # declare_dependency(). Thus the tests below use the library looked up
  # above.  Once we require a newer meson version, we can simplify.
  gssapi = declare_dependency(dependencies: gssapi_deps)
endif

I didn't quite understand what was meant by this. This code is relatively new, so maybe someone who worked on it still remembers and can offer a suggestion.

Along the way, I also found that our meson.build always issues a warning when run on Windows/msvc, which I fixed. (Should probably be backpatched.)

To help find all the places to update for deprecations etc., I used the option meson setup --fatal-meson-warnings. This seems quite useful, so I'm also suggesting adding it to the CI tasks. I think this could be useful in general, as I've seen more than zero times someone submitting a patch that accidentally violates the meson version requirement in some way, and we might as well catch those early.
From 79bcc6e45ee63867c46674f602c9a83a3baf88c4 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Wed, 18 Jun 2025 10:18:26 +0200
Subject: [PATCH 1/5] meson: Fix meson warning

    WARNING: You should add the boolean check kwarg to the run_command call.
             It currently defaults to false,
             but it will default to true in meson 2.0.

(This only happens in the msvc branch.  All the other run_command
calls are ok.)
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index d142e3e408b..474763ad19f 100644
--- a/meson.build
+++ b/meson.build
@@ -1205,7 +1205,7 @@ if not perlopt.disabled()
       if cc.get_id() == 'msvc'
         # prevent binary mismatch between MSVC built plperl and Strawberry or
         # msys ucrt perl libraries
-        perl_v = run_command(perl, '-V').stdout()
+        perl_v = run_command(perl, '-V', check: false).stdout()
         if not perl_v.contains('USE_THREAD_SAFE_LOCALE')
           perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
         endif

base-commit: 6f55fb741147c49dc20dd2e4597363b2cc04acb4
-- 
2.49.0

From 696292df195631b64b3724cb93c0e5d32b14b659 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Wed, 18 Jun 2025 10:18:26 +0200
Subject: [PATCH 2/5] ci: Run meson with --fatal-meson-warnings

To quote from the meson commit log:

> This makes any warning message printed by meson raise an exception,
> intended to be used by CI and developpers to easily catch deprecation
> warnings and other potential issues.

But not for the Windows VS task, because that currently produces

    WARNING: Using a debug build type with MSVC or an MSVC-compatible compiler
    when the Python interpreter is not also a debug build will almost
    certainly result in a failed build. Prefer using a release build
    type or a debug Python interpreter.

That should maybe be fixed separately.
---
 .cirrus.tasks.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 92057006c93..0650263d58c 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -105,6 +105,7 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        --fatal-meson-warnings \
         --buildtype=debug \
         --auto-features=disabled \
         -Dtap_tests=enabled \
@@ -196,6 +197,7 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        --fatal-meson-warnings \
         --buildtype=debug \
         -Dcassert=true -Dinjection_points=true \
         -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
@@ -314,6 +316,7 @@ task:
   configure_script: |
     su postgres <<-EOF
       meson setup \
+        --fatal-meson-warnings \
         --buildtype=debugoptimized \
         --pkg-config-path ${PKGCONFIG_PATH} \
         -Dcassert=true -Dinjection_points=true \
@@ -506,6 +509,7 @@ task:
       configure_script: |
         su postgres <<-EOF
           meson setup \
+            --fatal-meson-warnings \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
             ${LINUX_MESON_FEATURES} \
@@ -518,6 +522,7 @@ task:
         su postgres <<-EOF
           export CC='ccache gcc -m32'
           meson setup \
+            --fatal-meson-warnings \
             --buildtype=debug \
             -Dcassert=true -Dinjection_points=true \
             ${LINUX_MESON_FEATURES} \
@@ -657,6 +662,7 @@ task:
   configure_script: |
     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
     meson setup \
+      --fatal-meson-warnings \
       --buildtype=debug \
       -Dextra_include_dirs=/opt/local/include \
       -Dextra_lib_dirs=/opt/local/lib \
@@ -793,7 +799,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 --fatal-meson-warnings -Ddebug=true 
-Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true 
-Dnls=disabled -DTAR=%TAR% build"
 
   build_script: |
     %BASH% -c "ninja -C build ${MBUILD_TARGET}"
-- 
2.49.0

From 2fc5ecddacf0276e89d66163552f55c736179389 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Wed, 18 Jun 2025 10:18:26 +0200
Subject: [PATCH 3/5] meson: Increase minimum version to 0.57

The previous minimum was to maintain support for Python 3.5, but we
now require Python 3.6 anyway (commit 45363fca637), so that reason is
obsolete.  A small raise to Meson 0.57 allows getting rid of a fair
amount of version conditionals and silences some future-deprecated
warnings.
---
 doc/src/sgml/installation.sgml | 2 +-
 meson.build                    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index de19f3ad929..7f2e905bc9e 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -65,7 +65,7 @@ <title>Requirements</title>
      </para>
 
      <para>
-      The minimum required version of <application>Meson</application> is 0.54.
+      The minimum required version of <application>Meson</application> is 0.57.
      </para>
     </listitem>
 
diff --git a/meson.build b/meson.build
index 474763ad19f..3c3667ffe61 100644
--- a/meson.build
+++ b/meson.build
@@ -11,10 +11,10 @@ project('postgresql',
   version: '18beta1',
   license: 'PostgreSQL',
 
-  # We want < 0.56 for python 3.5 compatibility on old platforms. EPEL for
-  # RHEL 7 has 0.55. < 0.54 would require replacing some uses of the fs
-  # module, < 0.53 all uses of fs. So far there's no need to go to >=0.56.
-  meson_version: '>=0.54',
+  # We want < 0.62 for python 3.6 compatibility on old platforms.
+  # RHEL 8 has 0.58.  < 0.57 would require various additional
+  # backward-compatibility conditionals.
+  meson_version: '>=0.57',
   default_options: [
     'warning_level=1', #-Wall equivalent
     'b_pch=false',
-- 
2.49.0

From 9c263b581795682c136177b86c4dc26a547156aa Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Wed, 18 Jun 2025 10:18:26 +0200
Subject: [PATCH 4/5] meson: Remove conditionals for Meson versions lower than
 0.57

---
 meson.build | 203 ++++++++++++++++++++++++----------------------------
 1 file changed, 94 insertions(+), 109 deletions(-)

diff --git a/meson.build b/meson.build
index 3c3667ffe61..92945cb4291 100644
--- a/meson.build
+++ b/meson.build
@@ -3600,19 +3600,13 @@ sys.exit(sp.returncode)
 # Test Generation
 ###############################################################
 
-# When using a meson version understanding exclude_suites, define a
-# 'tmp_install' test setup (the default) that excludes tests running against a
-# pre-existing install and a 'running' setup that conflicts with creation of
-# the temporary installation and tap tests (which don't support running
-# against a running server).
+# Define a 'tmp_install' test setup (the default) that excludes tests
+# running against a pre-existing install and a 'running' setup that
+# conflicts with creation of the temporary installation and tap tests
+# (which don't support running against a running server).
 
 running_suites = []
 install_suites = []
-if meson.version().version_compare('>=0.57')
-  runningcheck = true
-else
-  runningcheck = false
-endif
 
 testwrap = files('src/tools/testwrap')
 
@@ -3709,7 +3703,7 @@ foreach test_dir : tests
       install_suites += test_group
 
       # some tests can't support running against running DB
-      if runningcheck and t.get('runningcheck', true)
+      if t.get('runningcheck', true)
         test(test_group_running / kind,
           python,
           args: [
@@ -3792,13 +3786,11 @@ foreach test_dir : tests
 endforeach # directories with tests
 
 # repeat condition so meson realizes version dependency
-if meson.version().version_compare('>=0.57')
-  add_test_setup('tmp_install',
-    is_default: true,
-    exclude_suites: running_suites)
-  add_test_setup('running',
-    exclude_suites: ['setup'] + install_suites)
-endif
+add_test_setup('tmp_install',
+  is_default: true,
+  exclude_suites: running_suites)
+add_test_setup('running',
+  exclude_suites: ['setup'] + install_suites)
 
 
 
@@ -3886,10 +3878,7 @@ alias_target('pgdist', [tar_gz, tar_bz2])
 # But not if we are in a subproject, in case the parent project wants to
 # create a dist using the standard Meson command.
 if not meson.is_subproject()
-  # We can only pass the identifier perl here when we depend on >= 0.55
-  if meson.version().version_compare('>=0.55')
-    meson.add_dist_script(perl, '-e', 'exit 1')
-  endif
+  meson.add_dist_script(perl, '-e', 'exit 1')
 endif
 
 
@@ -3898,106 +3887,102 @@ endif
 # The End, The End, My Friend
 ###############################################################
 
-if meson.version().version_compare('>=0.57')
+summary(
+  {
+    'data block size': '@0@ kB'.format(cdata.get('BLCKSZ') / 1024),
+    'WAL block size': '@0@ kB'.format(cdata.get('XLOG_BLCKSZ') / 1024),
+    'segment size': get_option('segsize_blocks') != 0 ?
+      '@0@ blocks'.format(cdata.get('RELSEG_SIZE')) :
+      '@0@ GB'.format(get_option('segsize')),
+  },
+  section: 'Data layout',
+)
 
-  summary(
-    {
-      'data block size': '@0@ kB'.format(cdata.get('BLCKSZ') / 1024),
-      'WAL block size': '@0@ kB'.format(cdata.get('XLOG_BLCKSZ') / 1024),
-      'segment size': get_option('segsize_blocks') != 0 ?
-        '@0@ blocks'.format(cdata.get('RELSEG_SIZE')) :
-        '@0@ GB'.format(get_option('segsize')),
-    },
-    section: 'Data layout',
-  )
+summary(
+  {
+    'host system': '@0@ @1@'.format(host_system, host_cpu),
+    'build system': '@0@ @1@'.format(build_machine.system(),
+                                     build_machine.cpu_family()),
+  },
+  section: 'System',
+)
 
-  summary(
-    {
-      'host system': '@0@ @1@'.format(host_system, host_cpu),
-      'build system': '@0@ @1@'.format(build_machine.system(),
-                                       build_machine.cpu_family()),
-    },
-    section: 'System',
-  )
+summary(
+  {
+    'linker': '@0@'.format(cc.get_linker_id()),
+    'C compiler': '@0@ @1@'.format(cc.get_id(), cc.version()),
+  },
+  section: 'Compiler',
+)
 
+summary(
+  {
+    'CPP FLAGS': ' '.join(cppflags),
+    'C FLAGS, functional': ' '.join(cflags),
+    'C FLAGS, warnings': ' '.join(cflags_warn),
+    'C FLAGS, modules': ' '.join(cflags_mod),
+    'C FLAGS, user specified': ' '.join(get_option('c_args')),
+    'LD FLAGS': ' '.join(ldflags + get_option('c_link_args')),
+  },
+  section: 'Compiler Flags',
+)
+
+if llvm.found()
   summary(
     {
-      'linker': '@0@'.format(cc.get_linker_id()),
-      'C compiler': '@0@ @1@'.format(cc.get_id(), cc.version()),
+      'C++ compiler': '@0@ @1@'.format(cpp.get_id(), cpp.version()),
     },
     section: 'Compiler',
   )
 
   summary(
     {
-      'CPP FLAGS': ' '.join(cppflags),
-      'C FLAGS, functional': ' '.join(cflags),
-      'C FLAGS, warnings': ' '.join(cflags_warn),
-      'C FLAGS, modules': ' '.join(cflags_mod),
-      'C FLAGS, user specified': ' '.join(get_option('c_args')),
-      'LD FLAGS': ' '.join(ldflags + get_option('c_link_args')),
+      'C++ FLAGS, functional': ' '.join(cxxflags),
+      'C++ FLAGS, warnings': ' '.join(cxxflags_warn),
+      'C++ FLAGS, user specified': ' '.join(get_option('cpp_args')),
     },
     section: 'Compiler Flags',
   )
+endif
 
-  if llvm.found()
-    summary(
-      {
-        'C++ compiler': '@0@ @1@'.format(cpp.get_id(), cpp.version()),
-      },
-      section: 'Compiler',
-    )
-
-    summary(
-      {
-        'C++ FLAGS, functional': ' '.join(cxxflags),
-        'C++ FLAGS, warnings': ' '.join(cxxflags_warn),
-        'C++ FLAGS, user specified': ' '.join(get_option('cpp_args')),
-      },
-      section: 'Compiler Flags',
-    )
-  endif
-
-  summary(
-    {
-      'bison': '@0@ @1@'.format(bison.full_path(), bison_version),
-      'dtrace': dtrace,
-      'flex': '@0@ @1@'.format(flex.full_path(), flex_version),
-    },
-    section: 'Programs',
-  )
-
-  summary(
-    {
-      'bonjour': bonjour,
-      'bsd_auth': bsd_auth,
-      'docs': docs_dep,
-      'docs_pdf': docs_pdf_dep,
-      'gss': gssapi,
-      'icu': icu,
-      'ldap': ldap,
-      'libcurl': libcurl,
-      'libnuma': libnuma,
-      'liburing': liburing,
-      'libxml': libxml,
-      'libxslt': libxslt,
-      'llvm': llvm,
-      'lz4': lz4,
-      'nls': libintl,
-      'openssl': ssl,
-      'pam': pam,
-      'plperl': [perl_dep, perlversion],
-      'plpython': python3_dep,
-      'pltcl': tcl_dep,
-      'readline': readline,
-      'selinux': selinux,
-      'systemd': systemd,
-      'uuid': uuid,
-      'zlib': zlib,
-      'zstd': zstd,
-    },
-    section: 'External libraries',
-    list_sep: ' ',
-  )
+summary(
+  {
+    'bison': '@0@ @1@'.format(bison.full_path(), bison_version),
+    'dtrace': dtrace,
+    'flex': '@0@ @1@'.format(flex.full_path(), flex_version),
+  },
+  section: 'Programs',
+)
 
-endif
+summary(
+  {
+    'bonjour': bonjour,
+    'bsd_auth': bsd_auth,
+    'docs': docs_dep,
+    'docs_pdf': docs_pdf_dep,
+    'gss': gssapi,
+    'icu': icu,
+    'ldap': ldap,
+    'libcurl': libcurl,
+    'libnuma': libnuma,
+    'liburing': liburing,
+    'libxml': libxml,
+    'libxslt': libxslt,
+    'llvm': llvm,
+    'lz4': lz4,
+    'nls': libintl,
+    'openssl': ssl,
+    'pam': pam,
+    'plperl': [perl_dep, perlversion],
+    'plpython': python3_dep,
+    'pltcl': tcl_dep,
+    'readline': readline,
+    'selinux': selinux,
+    'systemd': systemd,
+    'uuid': uuid,
+    'zlib': zlib,
+    'zstd': zstd,
+  },
+  section: 'External libraries',
+  list_sep: ' ',
+)
-- 
2.49.0

From 38496e5c395b047331f75c028d3346080b8cfd7b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Wed, 18 Jun 2025 10:18:26 +0200
Subject: [PATCH 5/5] meson: Fix deprecation warnings

WARNING: Project targets '>=0.57' but uses feature deprecated since '0.55.0': 
ExternalProgram.path. use ExternalProgram.full_path() instead
WARNING: Project targets '>=0.57' but uses feature deprecated since '0.56.0': 
meson.build_root. use meson.project_build_root() or meson.global_build_root() 
instead.
---
 contrib/basebackup_to_shell/meson.build       |  4 +--
 contrib/dblink/meson.build                    |  2 +-
 contrib/postgres_fdw/meson.build              |  2 +-
 meson.build                                   | 32 +++++++++----------
 src/backend/jit/llvm/meson.build              |  2 +-
 src/bin/pg_basebackup/meson.build             |  6 ++--
 src/bin/pg_dump/meson.build                   |  6 ++--
 src/bin/pg_verifybackup/meson.build           |  8 ++---
 src/include/nodes/meson.build                 |  2 +-
 src/include/pch/meson.build                   |  6 ++--
 src/makefiles/meson.build                     | 10 +++---
 src/pl/plperl/meson.build                     |  2 +-
 src/test/modules/injection_points/meson.build |  2 +-
 src/test/modules/oauth_validator/meson.build  |  2 +-
 src/test/ssl/meson.build                      |  2 +-
 15 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/contrib/basebackup_to_shell/meson.build 
b/contrib/basebackup_to_shell/meson.build
index 8c88242456e..8a4f170c5f8 100644
--- a/contrib/basebackup_to_shell/meson.build
+++ b/contrib/basebackup_to_shell/meson.build
@@ -24,7 +24,7 @@ tests += {
     'tests': [
       't/001_basic.pl',
     ],
-    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
-            'TAR': tar.found() ? tar.path() : '' },
+    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
+            'TAR': tar.found() ? tar.full_path() : '' },
   },
 }
diff --git a/contrib/dblink/meson.build b/contrib/dblink/meson.build
index dfd8eb6877e..a19ce6cf4b9 100644
--- a/contrib/dblink/meson.build
+++ b/contrib/dblink/meson.build
@@ -34,7 +34,7 @@ tests += {
     'sql': [
       'dblink',
     ],
-    'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+    'regress_args': ['--dlpath', meson.project_build_root() / 
'src/test/regress'],
   },
   'tap': {
     'tests': [
diff --git a/contrib/postgres_fdw/meson.build b/contrib/postgres_fdw/meson.build
index 8b29be24dee..5c11bc6496f 100644
--- a/contrib/postgres_fdw/meson.build
+++ b/contrib/postgres_fdw/meson.build
@@ -39,7 +39,7 @@ tests += {
       'postgres_fdw',
       'query_cancel',
     ],
-    'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+    'regress_args': ['--dlpath', meson.project_build_root() / 
'src/test/regress'],
   },
   'tap': {
     'tests': [
diff --git a/meson.build b/meson.build
index 92945cb4291..188a5d55a97 100644
--- a/meson.build
+++ b/meson.build
@@ -1284,7 +1284,7 @@ pyopt = get_option('plpython')
 python3_dep = not_found_dep
 if not pyopt.disabled()
   pm = import('python')
-  python3_inst = pm.find_installation(python.path(), required: pyopt)
+  python3_inst = pm.find_installation(python.full_path(), required: pyopt)
   if python3_inst.found()
     python3_dep = python3_inst.dependency(embed: true, required: pyopt)
     # Remove this check after we depend on Meson >= 1.1.0
@@ -3145,13 +3145,13 @@ gen_kwlist_cmd = [
 ###
 
 if host_system == 'windows'
-  pg_ico = meson.source_root() / 'src' / 'port' / 'win32.ico'
+  pg_ico = meson.project_source_root() / 'src' / 'port' / 'win32.ico'
   win32ver_rc = files('src/port/win32ver.rc')
   rcgen = find_program('src/tools/rcgen', native: true)
 
   rcgen_base_args = [
     '--srcdir', '@SOURCE_DIR@',
-    '--builddir', meson.build_root(),
+    '--builddir', meson.project_build_root(),
     '--rcout', '@OUTPUT0@',
     '--out', '@OUTPUT1@',
     '--input', '@INPUT@',
@@ -3160,11 +3160,11 @@ if host_system == 'windows'
 
   if cc.get_argument_syntax() == 'msvc'
     rc = find_program('rc', required: true)
-    rcgen_base_args += ['--rc', rc.path()]
+    rcgen_base_args += ['--rc', rc.full_path()]
     rcgen_outputs = ['@BASENAME@.rc', '@BASENAME@.res']
   else
     windres = find_program('windres', required: true)
-    rcgen_base_args += ['--windres', windres.path()]
+    rcgen_base_args += ['--windres', windres.full_path()]
     rcgen_outputs = ['@BASENAME@.rc', '@BASENAME@.obj']
   endif
 
@@ -3397,7 +3397,7 @@ foreach t1 : configure_files
   potentially_conflicting_files += meson.current_build_dir() / t
 endforeach
 foreach sub, fnames : generated_sources_ac
-  sub = meson.build_root() / sub
+  sub = meson.project_build_root() / sub
   foreach fname : fnames
     potentially_conflicting_files += sub / fname
   endforeach
@@ -3497,7 +3497,7 @@ run_target('install-test-files',
 ###############################################################
 
 # DESTDIR for the installation we'll run tests in
-test_install_destdir = meson.build_root() / 'tmp_install/'
+test_install_destdir = meson.project_build_root() / 'tmp_install/'
 
 # DESTDIR + prefix appropriately munged
 if build_system != 'windows'
@@ -3540,7 +3540,7 @@ test('install_test_files',
     is_parallel: false,
     suite: ['setup'])
 
-test_result_dir = meson.build_root() / 'testrun'
+test_result_dir = meson.project_build_root() / 'testrun'
 
 
 # XXX: pg_regress doesn't assign unique ports on windows. To avoid the
@@ -3551,12 +3551,12 @@ testport = 40000
 
 test_env = environment()
 
-test_initdb_template = meson.build_root() / 'tmp_install' / 'initdb-template'
+test_initdb_template = meson.project_build_root() / 'tmp_install' / 
'initdb-template'
 test_env.set('PG_REGRESS', pg_regress.full_path())
 test_env.set('REGRESS_SHLIB', regress_module.full_path())
 test_env.set('INITDB_TEMPLATE', test_initdb_template)
 # for Cluster.pm's portlock logic
-test_env.set('top_builddir', meson.build_root())
+test_env.set('top_builddir', meson.project_build_root())
 
 # Add the temporary installation to the library search path on platforms where
 # that works (everything but windows, basically). On windows everything
@@ -3613,7 +3613,7 @@ testwrap = files('src/tools/testwrap')
 foreach test_dir : tests
   testwrap_base = [
     testwrap,
-    '--basedir', meson.build_root(),
+    '--basedir', meson.project_build_root(),
     '--srcdir', test_dir['sd'],
     # Some test suites are not run by default but can be run if selected by the
     # user via variable PG_TEST_EXTRA. Pass configuration time value of
@@ -3730,8 +3730,8 @@ foreach test_dir : tests
       endif
 
       test_command = [
-        perl.path(),
-        '-I', meson.source_root() / 'src/test/perl',
+        perl.full_path(),
+        '-I', meson.project_source_root() / 'src/test/perl',
         '-I', test_dir['sd'],
       ]
 
@@ -3847,7 +3847,7 @@ tar_gz = custom_target('tar.gz',
             '--format', 'tar.gz',
             '-9',
             '--prefix', distdir + '/',
-            '-o', join_paths(meson.build_root(), '@OUTPUT@'),
+            '-o', join_paths(meson.project_build_root(), '@OUTPUT@'),
             pg_git_revision],
   output: distdir + '.tar.gz',
 )
@@ -3857,11 +3857,11 @@ if bzip2.found()
     build_always_stale: true,
     command: [git, '-C', '@SOURCE_ROOT@',
               '-c', 'core.autocrlf=false',
-              '-c', 'tar.tar.bz2.command="@0@" -c'.format(bzip2.path()),
+              '-c', 'tar.tar.bz2.command="@0@" -c'.format(bzip2.full_path()),
               'archive',
               '--format', 'tar.bz2',
               '--prefix', distdir + '/',
-              '-o', join_paths(meson.build_root(), '@OUTPUT@'),
+              '-o', join_paths(meson.project_build_root(), '@OUTPUT@'),
               pg_git_revision],
     output: distdir + '.tar.bz2',
   )
diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build
index c8e06dfbe35..805fbd69006 100644
--- a/src/backend/jit/llvm/meson.build
+++ b/src/backend/jit/llvm/meson.build
@@ -53,7 +53,7 @@ llvm_irgen_args = [
 
 if ccache.found()
   llvm_irgen_command = ccache
-  llvm_irgen_args = [clang.path()] + llvm_irgen_args
+  llvm_irgen_args = [clang.full_path()] + llvm_irgen_args
 else
   llvm_irgen_command = clang
 endif
diff --git a/src/bin/pg_basebackup/meson.build 
b/src/bin/pg_basebackup/meson.build
index 8a1c96b4f5c..3a7fc10eab0 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -93,9 +93,9 @@ tests += {
   'sd': meson.current_source_dir(),
   'bd': meson.current_build_dir(),
   'tap': {
-    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
-            'TAR': tar.found() ? tar.path() : '',
-            'LZ4': program_lz4.found() ? program_lz4.path() : '',
+    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
+            'TAR': tar.found() ? tar.full_path() : '',
+            'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
     },
     'tests': [
       't/010_pg_basebackup.pl',
diff --git a/src/bin/pg_dump/meson.build b/src/bin/pg_dump/meson.build
index d8e9e101254..4a4ebbd8ec9 100644
--- a/src/bin/pg_dump/meson.build
+++ b/src/bin/pg_dump/meson.build
@@ -91,9 +91,9 @@ tests += {
   'bd': meson.current_build_dir(),
   'tap': {
     'env': {
-      'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
-      'LZ4': program_lz4.found() ? program_lz4.path() : '',
-      'ZSTD': program_zstd.found() ? program_zstd.path() : '',
+      'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
+      'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
+      'ZSTD': program_zstd.found() ? program_zstd.full_path() : '',
       'with_icu': icu.found() ? 'yes' : 'no',
     },
     'tests': [
diff --git a/src/bin/pg_verifybackup/meson.build 
b/src/bin/pg_verifybackup/meson.build
index 9567d55500d..f45ea790d8e 100644
--- a/src/bin/pg_verifybackup/meson.build
+++ b/src/bin/pg_verifybackup/meson.build
@@ -23,10 +23,10 @@ tests += {
   'sd': meson.current_source_dir(),
   'bd': meson.current_build_dir(),
   'tap': {
-    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
-            'TAR': tar.found() ? tar.path() : '',
-            'LZ4': program_lz4.found() ? program_lz4.path() : '',
-            'ZSTD': program_zstd.found() ? program_zstd.path() : ''},
+    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
+            'TAR': tar.found() ? tar.full_path() : '',
+            'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
+            'ZSTD': program_zstd.found() ? program_zstd.full_path() : ''},
     'tests': [
       't/001_basic.pl',
       't/002_algorithm.pl',
diff --git a/src/include/nodes/meson.build b/src/include/nodes/meson.build
index d1ca24dd32f..ea36cb0fda4 100644
--- a/src/include/nodes/meson.build
+++ b/src/include/nodes/meson.build
@@ -28,7 +28,7 @@ node_support_input_i = [
 
 node_support_input = []
 foreach i : node_support_input_i
-  node_support_input += meson.source_root() / 'src' / 'include' / i
+  node_support_input += meson.project_source_root() / 'src' / 'include' / i
 endforeach
 
 node_support_output = [
diff --git a/src/include/pch/meson.build b/src/include/pch/meson.build
index f6babee6f6d..603add1a351 100644
--- a/src/include/pch/meson.build
+++ b/src/include/pch/meson.build
@@ -1,6 +1,6 @@
 # Copyright (c) 2022-2025, PostgreSQL Global Development Group
 
 # See https://github.com/mesonbuild/meson/issues/10338
-pch_c_h = meson.source_root() / meson.current_source_dir() / 'c_pch.h'
-pch_postgres_h = meson.source_root() / meson.current_source_dir() / 
'postgres_pch.h'
-pch_postgres_fe_h = meson.source_root() / meson.current_source_dir() / 
'postgres_fe_pch.h'
+pch_c_h = meson.project_source_root() / meson.current_source_dir() / 'c_pch.h'
+pch_postgres_h = meson.project_source_root() / meson.current_source_dir() / 
'postgres_pch.h'
+pch_postgres_fe_h = meson.project_source_root() / meson.current_source_dir() / 
'postgres_fe_pch.h'
diff --git a/src/makefiles/meson.build b/src/makefiles/meson.build
index 91a8de1ee9b..54dbc059ada 100644
--- a/src/makefiles/meson.build
+++ b/src/makefiles/meson.build
@@ -6,7 +6,7 @@
 
 # Emulation of PGAC_CHECK_STRIP
 strip_bin = find_program(get_option('STRIP'), required: false, native: true)
-strip_cmd = strip_bin.found() ? [strip_bin.path()] : [':']
+strip_cmd = strip_bin.found() ? [strip_bin.full_path()] : [':']
 
 working_strip = false
 if strip_bin.found()
@@ -49,8 +49,8 @@ pgxs_kv = {
   'PORTNAME': portname,
   'PG_SYSROOT': pg_sysroot,
 
-  'abs_top_builddir': meson.build_root(),
-  'abs_top_srcdir': meson.source_root(),
+  'abs_top_builddir': meson.project_build_root(),
+  'abs_top_srcdir': meson.project_source_root(),
 
   'enable_rpath': get_option('rpath') ? 'yes' : 'no',
   'enable_nls': libintl.found() ? 'yes' : 'no',
@@ -123,7 +123,7 @@ pgxs_kv = {
 
 if llvm.found()
   pgxs_kv += {
-    'CLANG': clang.path(),
+    'CLANG': clang.full_path(),
     'CXX': ' '.join(cpp.cmd_array()),
     'LLVM_BINPATH': llvm_binpath,
   }
@@ -258,7 +258,7 @@ pgxs_deps = {
 pgxs_cdata = configuration_data(pgxs_kv)
 
 foreach b, p : pgxs_bins
-  pgxs_cdata.set(b, p.found() ? p.path() : '')
+  pgxs_cdata.set(b, p.found() ? p.full_path() : '')
 endforeach
 
 foreach pe : pgxs_empty
diff --git a/src/pl/plperl/meson.build b/src/pl/plperl/meson.build
index b463d4d56c5..7c4081c3460 100644
--- a/src/pl/plperl/meson.build
+++ b/src/pl/plperl/meson.build
@@ -96,7 +96,7 @@ tests += {
       'plperl_transaction',
       'plperl_env',
     ],
-    'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+    'regress_args': ['--dlpath', meson.project_build_root() / 
'src/test/regress'],
   },
 }
 
diff --git a/src/test/modules/injection_points/meson.build 
b/src/test/modules/injection_points/meson.build
index d61149712fd..7cea10d2c69 100644
--- a/src/test/modules/injection_points/meson.build
+++ b/src/test/modules/injection_points/meson.build
@@ -38,7 +38,7 @@ tests += {
       'hashagg',
       'reindex_conc',
     ],
-    'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+    'regress_args': ['--dlpath', meson.project_build_root() / 
'src/test/regress'],
     # The injection points are cluster-wide, so disable installcheck
     'runningcheck': false,
   },
diff --git a/src/test/modules/oauth_validator/meson.build 
b/src/test/modules/oauth_validator/meson.build
index e190f9cf15a..a6f937fd7d7 100644
--- a/src/test/modules/oauth_validator/meson.build
+++ b/src/test/modules/oauth_validator/meson.build
@@ -77,7 +77,7 @@ tests += {
       't/002_client.pl',
     ],
     'env': {
-      'PYTHON': python.path(),
+      'PYTHON': python.full_path(),
       'with_libcurl': oauth_flow_supported ? 'yes' : 'no',
       'with_python': 'yes',
     },
diff --git a/src/test/ssl/meson.build b/src/test/ssl/meson.build
index cf8b2b9303a..d8e0fb518e0 100644
--- a/src/test/ssl/meson.build
+++ b/src/test/ssl/meson.build
@@ -7,7 +7,7 @@ tests += {
   'tap': {
     'env': {
       'with_ssl': ssl_library,
-      'OPENSSL': openssl.found() ? openssl.path() : '',
+      'OPENSSL': openssl.found() ? openssl.full_path() : '',
     },
     'tests': [
       't/001_ssltests.pl',
-- 
2.49.0

Reply via email to