1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

meson: Increase minimum version to 0.57.2

The previous minimum was to maintain support for Python 3.5, but we
now require Python 3.6 anyway (commit 45363fca63), 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.

With the version bump, the following deprecation warnings appeared and
are fixed:

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.

It turns out that meson 0.57.0 and 0.57.1 are buggy for our use, so
the minimum is actually set to 0.57.2.  This is specific to this
version series; in the future we won't necessarily need to be this
precise.

Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/42e13eb0-862a-441e-8d84-4f0fd5f6def0%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-07-02 11:14:53 +02:00
parent de5aa15209
commit f039c22441
16 changed files with 147 additions and 161 deletions

View File

@ -24,7 +24,7 @@ tests += {
'tests': [ 'tests': [
't/001_basic.pl', 't/001_basic.pl',
], ],
'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', 'env': {'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
'TAR': tar.found() ? tar.path() : '' }, 'TAR': tar.found() ? tar.full_path() : '' },
}, },
} }

View File

@ -34,7 +34,7 @@ tests += {
'sql': [ 'sql': [
'dblink', 'dblink',
], ],
'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'], 'regress_args': ['--dlpath', meson.project_build_root() / 'src/test/regress'],
}, },
'tap': { 'tap': {
'tests': [ 'tests': [

View File

@ -39,7 +39,7 @@ tests += {
'postgres_fdw', 'postgres_fdw',
'query_cancel', 'query_cancel',
], ],
'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'], 'regress_args': ['--dlpath', meson.project_build_root() / 'src/test/regress'],
}, },
'tap': { 'tap': {
'tests': [ 'tests': [

View File

@ -65,7 +65,7 @@
</para> </para>
<para> <para>
The minimum required version of <application>Meson</application> is 0.54. The minimum required version of <application>Meson</application> is 0.57.2.
</para> </para>
</listitem> </listitem>

View File

@ -11,10 +11,11 @@ project('postgresql',
version: '19devel', version: '19devel',
license: 'PostgreSQL', license: 'PostgreSQL',
# We want < 0.56 for python 3.5 compatibility on old platforms. EPEL for # We want < 0.62 for python 3.6 compatibility on old platforms.
# RHEL 7 has 0.55. < 0.54 would require replacing some uses of the fs # RHEL 8 has 0.58. < 0.57 would require various additional
# module, < 0.53 all uses of fs. So far there's no need to go to >=0.56. # backward-compatibility conditionals.
meson_version: '>=0.54', # Meson 0.57.0 and 0.57.1 are buggy, therefore >=0.57.2.
meson_version: '>=0.57.2',
default_options: [ default_options: [
'warning_level=1', #-Wall equivalent 'warning_level=1', #-Wall equivalent
'b_pch=false', 'b_pch=false',
@ -1288,7 +1289,7 @@ pyopt = get_option('plpython')
python3_dep = not_found_dep python3_dep = not_found_dep
if not pyopt.disabled() if not pyopt.disabled()
pm = import('python') 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() if python3_inst.found()
python3_dep = python3_inst.dependency(embed: true, required: pyopt) python3_dep = python3_inst.dependency(embed: true, required: pyopt)
# Remove this check after we depend on Meson >= 1.1.0 # Remove this check after we depend on Meson >= 1.1.0
@ -3150,13 +3151,13 @@ gen_kwlist_cmd = [
### ###
if host_system == 'windows' 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') win32ver_rc = files('src/port/win32ver.rc')
rcgen = find_program('src/tools/rcgen', native: true) rcgen = find_program('src/tools/rcgen', native: true)
rcgen_base_args = [ rcgen_base_args = [
'--srcdir', '@SOURCE_DIR@', '--srcdir', '@SOURCE_DIR@',
'--builddir', meson.build_root(), '--builddir', meson.project_build_root(),
'--rcout', '@OUTPUT0@', '--rcout', '@OUTPUT0@',
'--out', '@OUTPUT1@', '--out', '@OUTPUT1@',
'--input', '@INPUT@', '--input', '@INPUT@',
@ -3165,11 +3166,11 @@ if host_system == 'windows'
if cc.get_argument_syntax() == 'msvc' if cc.get_argument_syntax() == 'msvc'
rc = find_program('rc', required: true) 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'] rcgen_outputs = ['@BASENAME@.rc', '@BASENAME@.res']
else else
windres = find_program('windres', required: true) 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'] rcgen_outputs = ['@BASENAME@.rc', '@BASENAME@.obj']
endif endif
@ -3402,7 +3403,7 @@ foreach t1 : configure_files
potentially_conflicting_files += meson.current_build_dir() / t potentially_conflicting_files += meson.current_build_dir() / t
endforeach endforeach
foreach sub, fnames : generated_sources_ac foreach sub, fnames : generated_sources_ac
sub = meson.build_root() / sub sub = meson.project_build_root() / sub
foreach fname : fnames foreach fname : fnames
potentially_conflicting_files += sub / fname potentially_conflicting_files += sub / fname
endforeach endforeach
@ -3502,7 +3503,7 @@ run_target('install-test-files',
############################################################### ###############################################################
# DESTDIR for the installation we'll run tests in # 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 # DESTDIR + prefix appropriately munged
if build_system != 'windows' if build_system != 'windows'
@ -3545,7 +3546,7 @@ test('install_test_files',
is_parallel: false, is_parallel: false,
suite: ['setup']) 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 # XXX: pg_regress doesn't assign unique ports on windows. To avoid the
@ -3556,12 +3557,12 @@ testport = 40000
test_env = environment() 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('PG_REGRESS', pg_regress.full_path())
test_env.set('REGRESS_SHLIB', regress_module.full_path()) test_env.set('REGRESS_SHLIB', regress_module.full_path())
test_env.set('INITDB_TEMPLATE', test_initdb_template) test_env.set('INITDB_TEMPLATE', test_initdb_template)
# for Cluster.pm's portlock logic # 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 # Add the temporary installation to the library search path on platforms where
# that works (everything but windows, basically). On windows everything # that works (everything but windows, basically). On windows everything
@ -3605,26 +3606,20 @@ sys.exit(sp.returncode)
# Test Generation # Test Generation
############################################################### ###############################################################
# When using a meson version understanding exclude_suites, define a # Define a 'tmp_install' test setup (the default) that excludes tests
# 'tmp_install' test setup (the default) that excludes tests running against a # running against a pre-existing install and a 'running' setup that
# pre-existing install and a 'running' setup that conflicts with creation of # conflicts with creation of the temporary installation and tap tests
# the temporary installation and tap tests (which don't support running # (which don't support running against a running server).
# against a running server).
running_suites = [] running_suites = []
install_suites = [] install_suites = []
if meson.version().version_compare('>=0.57')
runningcheck = true
else
runningcheck = false
endif
testwrap = files('src/tools/testwrap') testwrap = files('src/tools/testwrap')
foreach test_dir : tests foreach test_dir : tests
testwrap_base = [ testwrap_base = [
testwrap, testwrap,
'--basedir', meson.build_root(), '--basedir', meson.project_build_root(),
'--srcdir', test_dir['sd'], '--srcdir', test_dir['sd'],
# Some test suites are not run by default but can be run if selected by the # 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 # user via variable PG_TEST_EXTRA. Pass configuration time value of
@ -3714,7 +3709,7 @@ foreach test_dir : tests
install_suites += test_group install_suites += test_group
# some tests can't support running against running DB # 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, test(test_group_running / kind,
python, python,
args: [ args: [
@ -3741,8 +3736,8 @@ foreach test_dir : tests
endif endif
test_command = [ test_command = [
perl.path(), perl.full_path(),
'-I', meson.source_root() / 'src/test/perl', '-I', meson.project_source_root() / 'src/test/perl',
'-I', test_dir['sd'], '-I', test_dir['sd'],
] ]
@ -3797,13 +3792,11 @@ foreach test_dir : tests
endforeach # directories with tests endforeach # directories with tests
# repeat condition so meson realizes version dependency # repeat condition so meson realizes version dependency
if meson.version().version_compare('>=0.57')
add_test_setup('tmp_install', add_test_setup('tmp_install',
is_default: true, is_default: true,
exclude_suites: running_suites) exclude_suites: running_suites)
add_test_setup('running', add_test_setup('running',
exclude_suites: ['setup'] + install_suites) exclude_suites: ['setup'] + install_suites)
endif
@ -3860,7 +3853,7 @@ tar_gz = custom_target('tar.gz',
'--format', 'tar.gz', '--format', 'tar.gz',
'-9', '-9',
'--prefix', distdir + '/', '--prefix', distdir + '/',
'-o', join_paths(meson.build_root(), '@OUTPUT@'), '-o', join_paths(meson.project_build_root(), '@OUTPUT@'),
pg_git_revision], pg_git_revision],
output: distdir + '.tar.gz', output: distdir + '.tar.gz',
) )
@ -3870,11 +3863,11 @@ if bzip2.found()
build_always_stale: true, build_always_stale: true,
command: [git, '-C', '@SOURCE_ROOT@', command: [git, '-C', '@SOURCE_ROOT@',
'-c', 'core.autocrlf=false', '-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', 'archive',
'--format', 'tar.bz2', '--format', 'tar.bz2',
'--prefix', distdir + '/', '--prefix', distdir + '/',
'-o', join_paths(meson.build_root(), '@OUTPUT@'), '-o', join_paths(meson.project_build_root(), '@OUTPUT@'),
pg_git_revision], pg_git_revision],
output: distdir + '.tar.bz2', output: distdir + '.tar.bz2',
) )
@ -3891,11 +3884,8 @@ alias_target('pgdist', [tar_gz, tar_bz2])
# But not if we are in a subproject, in case the parent project wants to # But not if we are in a subproject, in case the parent project wants to
# create a dist using the standard Meson command. # create a dist using the standard Meson command.
if not meson.is_subproject() 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') meson.add_dist_script(perl, '-e', 'exit 1')
endif endif
endif
@ -3903,8 +3893,6 @@ endif
# The End, The End, My Friend # The End, The End, My Friend
############################################################### ###############################################################
if meson.version().version_compare('>=0.57')
summary( summary(
{ {
'data block size': '@0@ kB'.format(cdata.get('BLCKSZ') / 1024), 'data block size': '@0@ kB'.format(cdata.get('BLCKSZ') / 1024),
@ -4004,5 +3992,3 @@ if meson.version().version_compare('>=0.57')
section: 'External libraries', section: 'External libraries',
list_sep: ' ', list_sep: ' ',
) )
endif

View File

@ -53,7 +53,7 @@ llvm_irgen_args = [
if ccache.found() if ccache.found()
llvm_irgen_command = ccache llvm_irgen_command = ccache
llvm_irgen_args = [clang.path()] + llvm_irgen_args llvm_irgen_args = [clang.full_path()] + llvm_irgen_args
else else
llvm_irgen_command = clang llvm_irgen_command = clang
endif endif

View File

@ -93,9 +93,9 @@ tests += {
'sd': meson.current_source_dir(), 'sd': meson.current_source_dir(),
'bd': meson.current_build_dir(), 'bd': meson.current_build_dir(),
'tap': { 'tap': {
'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', 'env': {'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
'TAR': tar.found() ? tar.path() : '', 'TAR': tar.found() ? tar.full_path() : '',
'LZ4': program_lz4.found() ? program_lz4.path() : '', 'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
}, },
'tests': [ 'tests': [
't/010_pg_basebackup.pl', 't/010_pg_basebackup.pl',

View File

@ -91,9 +91,9 @@ tests += {
'bd': meson.current_build_dir(), 'bd': meson.current_build_dir(),
'tap': { 'tap': {
'env': { 'env': {
'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', 'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
'LZ4': program_lz4.found() ? program_lz4.path() : '', 'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
'ZSTD': program_zstd.found() ? program_zstd.path() : '', 'ZSTD': program_zstd.found() ? program_zstd.full_path() : '',
'with_icu': icu.found() ? 'yes' : 'no', 'with_icu': icu.found() ? 'yes' : 'no',
}, },
'tests': [ 'tests': [

View File

@ -23,10 +23,10 @@ tests += {
'sd': meson.current_source_dir(), 'sd': meson.current_source_dir(),
'bd': meson.current_build_dir(), 'bd': meson.current_build_dir(),
'tap': { 'tap': {
'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', 'env': {'GZIP_PROGRAM': gzip.found() ? gzip.full_path() : '',
'TAR': tar.found() ? tar.path() : '', 'TAR': tar.found() ? tar.full_path() : '',
'LZ4': program_lz4.found() ? program_lz4.path() : '', 'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
'ZSTD': program_zstd.found() ? program_zstd.path() : ''}, 'ZSTD': program_zstd.found() ? program_zstd.full_path() : ''},
'tests': [ 'tests': [
't/001_basic.pl', 't/001_basic.pl',
't/002_algorithm.pl', 't/002_algorithm.pl',

View File

@ -28,7 +28,7 @@ node_support_input_i = [
node_support_input = [] node_support_input = []
foreach i : node_support_input_i 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 endforeach
node_support_output = [ node_support_output = [

View File

@ -1,6 +1,6 @@
# Copyright (c) 2022-2025, PostgreSQL Global Development Group # Copyright (c) 2022-2025, PostgreSQL Global Development Group
# See https://github.com/mesonbuild/meson/issues/10338 # See https://github.com/mesonbuild/meson/issues/10338
pch_c_h = meson.source_root() / meson.current_source_dir() / 'c_pch.h' pch_c_h = meson.project_source_root() / meson.current_source_dir() / 'c_pch.h'
pch_postgres_h = meson.source_root() / meson.current_source_dir() / 'postgres_pch.h' pch_postgres_h = meson.project_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_postgres_fe_h = meson.project_source_root() / meson.current_source_dir() / 'postgres_fe_pch.h'

View File

@ -6,7 +6,7 @@
# Emulation of PGAC_CHECK_STRIP # Emulation of PGAC_CHECK_STRIP
strip_bin = find_program(get_option('STRIP'), required: false, native: true) 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 working_strip = false
if strip_bin.found() if strip_bin.found()
@ -49,8 +49,8 @@ pgxs_kv = {
'PORTNAME': portname, 'PORTNAME': portname,
'PG_SYSROOT': pg_sysroot, 'PG_SYSROOT': pg_sysroot,
'abs_top_builddir': meson.build_root(), 'abs_top_builddir': meson.project_build_root(),
'abs_top_srcdir': meson.source_root(), 'abs_top_srcdir': meson.project_source_root(),
'enable_rpath': get_option('rpath') ? 'yes' : 'no', 'enable_rpath': get_option('rpath') ? 'yes' : 'no',
'enable_nls': libintl.found() ? 'yes' : 'no', 'enable_nls': libintl.found() ? 'yes' : 'no',
@ -123,7 +123,7 @@ pgxs_kv = {
if llvm.found() if llvm.found()
pgxs_kv += { pgxs_kv += {
'CLANG': clang.path(), 'CLANG': clang.full_path(),
'CXX': ' '.join(cpp.cmd_array()), 'CXX': ' '.join(cpp.cmd_array()),
'LLVM_BINPATH': llvm_binpath, 'LLVM_BINPATH': llvm_binpath,
} }
@ -258,7 +258,7 @@ pgxs_deps = {
pgxs_cdata = configuration_data(pgxs_kv) pgxs_cdata = configuration_data(pgxs_kv)
foreach b, p : pgxs_bins foreach b, p : pgxs_bins
pgxs_cdata.set(b, p.found() ? p.path() : '') pgxs_cdata.set(b, p.found() ? p.full_path() : '')
endforeach endforeach
foreach pe : pgxs_empty foreach pe : pgxs_empty

View File

@ -96,7 +96,7 @@ tests += {
'plperl_transaction', 'plperl_transaction',
'plperl_env', 'plperl_env',
], ],
'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'], 'regress_args': ['--dlpath', meson.project_build_root() / 'src/test/regress'],
}, },
} }

View File

@ -39,7 +39,7 @@ tests += {
'reindex_conc', 'reindex_conc',
'vacuum', 'vacuum',
], ],
'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 # The injection points are cluster-wide, so disable installcheck
'runningcheck': false, 'runningcheck': false,
}, },

View File

@ -77,7 +77,7 @@ tests += {
't/002_client.pl', 't/002_client.pl',
], ],
'env': { 'env': {
'PYTHON': python.path(), 'PYTHON': python.full_path(),
'with_libcurl': oauth_flow_supported ? 'yes' : 'no', 'with_libcurl': oauth_flow_supported ? 'yes' : 'no',
'with_python': 'yes', 'with_python': 'yes',
}, },

View File

@ -7,7 +7,7 @@ tests += {
'tap': { 'tap': {
'env': { 'env': {
'with_ssl': ssl_library, 'with_ssl': ssl_library,
'OPENSSL': openssl.found() ? openssl.path() : '', 'OPENSSL': openssl.found() ? openssl.full_path() : '',
}, },
'tests': [ 'tests': [
't/001_ssltests.pl', 't/001_ssltests.pl',