Meson build updates
Hi,
I took some time to look at the Meson build for Postgres. I contribute
some of the time to Meson, itself. Within this patchset you will find
pretty small changes. Most of the commits are attempting to create more
consistency with the surrounding code. I think there is more that can be
done to improve the build a bit like including subprojects for optional
dependencies like lz4, zstd, etc.
While I was reading through the code, I also noticed a few XXX/FIXMEs. I
don't mind taking a look at those in the future, but I think I need more
context for almost all of them since I am brand new to Postgres
development. Since I also have _some_ sway in the Meson community, I can
help get more attention to Meson issues that benefit Postgres. I
currently note 3 Meson issues that are commented in the code for
instance. If anyone ever has any problems or questions about Meson or
specifically the Meson build of Postgres, I am more than happy to
receive an email to see if I can help out.
Highlighting the biggest changes in this patchset:
- Add Meson overrides
- Remove Meson program options for specifying paths
Everything but the last patch could most likely be backported to
previous maintained releases including Meson, though the patchset is
initially targeting the master branch.
--
Tristan Partin
Neon (https://neon.tech)
Attachments:
v1-0001-Remove-triple-quoted-strings.patchtext/x-patch; charset=utf-8; name=v1-0001-Remove-triple-quoted-strings.patchDownload
From ae61706e5466b689dfbb3d7d3eafec218547204e Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 07:55:03 -0500
Subject: [PATCH postgres v1 01/17] Remove triple-quoted strings
Triple-quoted strings are for multiline strings in Meson. None of the
descriptions that got changed were multiline and the entire file uses
single-line descriptions.
---
meson_options.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 5b44a8829d..1ea9729dc2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,19 +10,19 @@ option('blocksize', type : 'combo',
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : '''WAL block size, in kilobytes''')
+ description : 'WAL block size, in kilobytes')
option('segsize', type : 'integer', value : 1,
- description : '''Segment size, in gigabytes''')
+ description : 'Segment size, in gigabytes')
option('segsize_blocks', type : 'integer', value: 0,
- description : '''Segment size, in blocks''')
+ description : 'Segment size, in blocks')
# Miscellaneous options
option('krb_srvnam', type : 'string', value : 'postgres',
- description : '''Default Kerberos service principal for GSSAPI''')
+ description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'use system time zone data in specified directory')
@@ -32,7 +32,7 @@ option('system_tzdata', type: 'string', value: '',
option('pgport', type : 'integer', value : 5432,
min: 1, max: 65535,
- description : '''Default port number for server and clients''')
+ description : 'Default port number for server and clients')
# Developer options
--
Tristan Partin
Neon (https://neon.tech)
v1-0002-Use-consistent-casing-in-Meson-option-description.patchtext/x-patch; charset=utf-8; name=v1-0002-Use-consistent-casing-in-Meson-option-description.patchDownload
From 63d982604a2c1ee13f290c4cbd6af5e9404e541e Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:03:31 -0500
Subject: [PATCH postgres v1 02/17] Use consistent casing in Meson option
descriptions
Meson itself uses capital letters for option descriptions, so follow
that.
---
meson_options.txt | 90 +++++++++++++++++++++++------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 1ea9729dc2..fa823fd088 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'set relation block size in kB')
+ description: 'Set relation block size in kB')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -25,7 +25,7 @@ option('krb_srvnam', type : 'string', value : 'postgres',
description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
- description: 'use system time zone data in specified directory')
+ description: 'Use system time zone data in specified directory')
# Defaults
@@ -38,7 +38,7 @@ option('pgport', type : 'integer', value : 5432,
# Developer options
option('cassert', type : 'boolean', value: false,
- description: 'enable assertion checks (for debugging)')
+ description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
description : 'Whether to enable tap tests')
@@ -47,43 +47,43 @@ option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'whether to use atomic operations')
+ description: 'Whether to use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'whether to use spinlocks')
+ description: 'Whether to use spinlocks')
# Compilation options
option('extra_include_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for headers')
+ description: 'Non-default directories to be searched for headers')
option('extra_lib_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for libs')
+ description: 'Non-default directories to be searched for libs')
option('extra_version', type : 'string', value: '',
- description: 'append STRING to the PostgreSQL version number')
+ description: 'Append STRING to the PostgreSQL version number')
option('darwin_sysroot', type : 'string', value: '',
- description: 'select a non-default sysroot path')
+ description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'whether to embed shared library search path in executables')
+ description: 'Whether to embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'build with Bonjour support')
+ description: 'Build with Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'build with BSD Authentication support')
+ description: 'Build with BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
- description: 'documentation in HTML and man page format')
+ description: 'Documentation in HTML and man page format')
option('docs_pdf', type : 'feature', value: 'auto',
- description: 'documentation in PDF format')
+ description: 'Documentation in PDF format')
option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
@@ -110,102 +110,102 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'whether to use llvm')
+ description: 'Whether to use llvm')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
- description: 'native language support')
+ description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'build with PAM support')
+ description: 'Build with PAM support')
option('plperl', type : 'feature', value: 'auto',
- description: 'build Perl modules (PL/Perl)')
+ description: 'Build Perl modules (PL/Perl)')
option('plpython', type : 'feature', value: 'auto',
- description: 'build Python modules (PL/Python)')
+ description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'build with TCL support')
+ description: 'Build with TCL support')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'specify TCL version')
+ description: 'Specify TCL version')
option('readline', type : 'feature', value : 'auto',
- description: 'use GNU Readline or BSD Libedit for editing')
+ description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'build with SELinux support')
+ description: 'Build with SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
- description: 'use LIB for SSL/TLS support (openssl)')
+ description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'build with systemd support')
+ description: 'Build with systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'build contrib/uuid-ossp using LIB')
+ description: 'Build contrib/uuid-ossp using LIB')
option('zlib', type : 'feature', value: 'auto',
- description: 'whether to use zlib')
+ description: 'Whether to use zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'whether to use zstd')
+ description: 'Whether to use zstd')
# Programs
option('BISON', type : 'array', value: ['bison', 'win_bison'],
- description: 'path to bison binary')
+ description: 'Path to bison binary')
option('DTRACE', type : 'string', value: 'dtrace',
- description: 'path to dtrace binary')
+ description: 'Path to dtrace binary')
option('FLEX', type : 'array', value: ['flex', 'win_flex'],
- description: 'path to flex binary')
+ description: 'Path to flex binary')
option('FOP', type : 'string', value: 'fop',
- description: 'path to fop binary')
+ description: 'Path to fop binary')
option('GZIP', type : 'string', value: 'gzip',
- description: 'path to gzip binary')
+ description: 'Path to gzip binary')
option('LZ4', type : 'string', value: 'lz4',
- description: 'path to lz4 binary')
+ description: 'Path to lz4 binary')
option('OPENSSL', type : 'string', value: 'openssl',
- description: 'path to openssl binary')
+ description: 'Path to openssl binary')
option('PERL', type : 'string', value: 'perl',
- description: 'path to perl binary')
+ description: 'Path to perl binary')
option('PROVE', type : 'string', value: 'prove',
- description: 'path to prove binary')
+ description: 'Path to prove binary')
option('PYTHON', type : 'array', value: ['python3', 'python'],
- description: 'path to python binary')
+ description: 'Path to python binary')
option('SED', type : 'string', value: 'gsed',
- description: 'path to sed binary')
+ description: 'Path to sed binary')
option('STRIP', type : 'string', value: 'strip',
- description: 'path to strip binary, used for PGXS emulation')
+ description: 'Path to strip binary, used for PGXS emulation')
option('TAR', type : 'string', value: 'tar',
- description: 'path to tar binary')
+ description: 'Path to tar binary')
option('XMLLINT', type : 'string', value: 'xmllint',
- description: 'path to xmllint binary')
+ description: 'Path to xmllint binary')
option('XSLTPROC', type : 'string', value: 'xsltproc',
- description: 'path to xsltproc binary')
+ description: 'Path to xsltproc binary')
option('ZSTD', type : 'string', value: 'zstd',
- description: 'path to zstd binary')
+ description: 'Path to zstd binary')
option('ZIC', type : 'string', value: 'zic',
- description: 'path to zic binary, when cross-compiling')
+ description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v1-0003-Use-consistent-Meson-option-description-formats.patchtext/x-patch; charset=utf-8; name=v1-0003-Use-consistent-Meson-option-description-formats.patchDownload
From 1c8d374504ceb0c4051457092f6140ef730fa87d Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:11:14 -0500
Subject: [PATCH postgres v1 03/17] Use consistent Meson option description
formats
---
meson_options.txt | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index fa823fd088..bdc6735332 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'Set relation block size in kB')
+ description: 'Relation block size, in kilobytes')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -41,16 +41,16 @@ option('cassert', type : 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
- description : 'Whether to enable tap tests')
+ description : 'Enable tap tests')
option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'Whether to use atomic operations')
+ description: 'Use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'Whether to use spinlocks')
+ description: 'Use spinlocks')
# Compilation options
@@ -68,16 +68,16 @@ option('darwin_sysroot', type : 'string', value: '',
description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'Whether to embed shared library search path in executables')
+ description: 'Embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'Build with Bonjour support')
+ description: 'Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'Build with BSD Authentication support')
+ description: 'BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
@@ -110,7 +110,7 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'Whether to use llvm')
+ description: 'LLVM support')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
@@ -119,7 +119,7 @@ option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'Build with PAM support')
+ description: 'PAM support')
option('plperl', type : 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
@@ -128,33 +128,33 @@ option('plpython', type : 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'Build with TCL support')
+ description: 'Build with TCL support (PL/TCL)')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'Specify TCL version')
+ description: 'TCL version')
option('readline', type : 'feature', value : 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'Build with SELinux support')
+ description: 'SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'Build with systemd support')
+ description: 'systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'Build contrib/uuid-ossp using LIB')
+ description: 'Use LIB for contrib/uuid-ossp support')
option('zlib', type : 'feature', value: 'auto',
- description: 'Whether to use zlib')
+ description: 'Enable zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'Whether to use zstd')
+ description: 'Enable zstd')
# Programs
--
Tristan Partin
Neon (https://neon.tech)
v1-0004-Attach-colon-to-keyword-argument.patchtext/x-patch; charset=utf-8; name=v1-0004-Attach-colon-to-keyword-argument.patchDownload
From c2c40d1c4120b4b3948b00866b13ea0795a49cdd Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:28:48 -0500
Subject: [PATCH postgres v1 04/17] Attach colon to keyword argument
This matches the style found in the rest of the Meson build description.
---
meson_options.txt | 138 +++++++++++++++++++++++-----------------------
1 file changed, 69 insertions(+), 69 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index bdc6735332..e9ac70766a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,27 +2,27 @@
# Data layout influencing options
-option('blocksize', type : 'combo',
- choices : ['1', '2', '4', '8', '16', '32'],
- value : '8',
+option('blocksize', type: 'combo',
+ choices: ['1', '2', '4', '8', '16', '32'],
+ value: '8',
description: 'Relation block size, in kilobytes')
-option('wal_blocksize', type : 'combo',
+option('wal_blocksize', type: 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : 'WAL block size, in kilobytes')
+ description: 'WAL block size, in kilobytes')
-option('segsize', type : 'integer', value : 1,
- description : 'Segment size, in gigabytes')
+option('segsize', type: 'integer', value: 1,
+ description: 'Segment size, in gigabytes')
-option('segsize_blocks', type : 'integer', value: 0,
- description : 'Segment size, in blocks')
+option('segsize_blocks', type: 'integer', value: 0,
+ description: 'Segment size, in blocks')
# Miscellaneous options
-option('krb_srvnam', type : 'string', value : 'postgres',
- description : 'Default Kerberos service principal for GSSAPI')
+option('krb_srvnam', type: 'string', value: 'postgres',
+ description: 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'Use system time zone data in specified directory')
@@ -30,182 +30,182 @@ option('system_tzdata', type: 'string', value: '',
# Defaults
-option('pgport', type : 'integer', value : 5432,
+option('pgport', type: 'integer', value: 5432,
min: 1, max: 65535,
- description : 'Default port number for server and clients')
+ description: 'Default port number for server and clients')
# Developer options
-option('cassert', type : 'boolean', value: false,
+option('cassert', type: 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
-option('tap_tests', type : 'feature', value : 'auto',
- description : 'Enable tap tests')
+option('tap_tests', type: 'feature', value: 'auto',
+ description: 'Enable tap tests')
-option('PG_TEST_EXTRA', type : 'string', value: '',
+option('PG_TEST_EXTRA', type: 'string', value: '',
description: 'Enable selected extra tests')
-option('atomics', type : 'boolean', value: true,
+option('atomics', type: 'boolean', value: true,
description: 'Use atomic operations')
-option('spinlocks', type : 'boolean', value: true,
+option('spinlocks', type: 'boolean', value: true,
description: 'Use spinlocks')
# Compilation options
-option('extra_include_dirs', type : 'array', value: [],
+option('extra_include_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for headers')
-option('extra_lib_dirs', type : 'array', value: [],
+option('extra_lib_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for libs')
-option('extra_version', type : 'string', value: '',
+option('extra_version', type: 'string', value: '',
description: 'Append STRING to the PostgreSQL version number')
-option('darwin_sysroot', type : 'string', value: '',
+option('darwin_sysroot', type: 'string', value: '',
description: 'Select a non-default sysroot path')
-option('rpath', type : 'boolean', value: true,
+option('rpath', type: 'boolean', value: true,
description: 'Embed shared library search path in executables')
# External dependencies
-option('bonjour', type : 'feature', value: 'auto',
+option('bonjour', type: 'feature', value: 'auto',
description: 'Bonjour support')
-option('bsd_auth', type : 'feature', value: 'auto',
+option('bsd_auth', type: 'feature', value: 'auto',
description: 'BSD Authentication support')
-option('docs', type : 'feature', value: 'auto',
+option('docs', type: 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
-option('docs_pdf', type : 'feature', value: 'auto',
+option('docs_pdf', type: 'feature', value: 'auto',
description: 'Documentation in PDF format')
-option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
+option('docs_html_style', type: 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
-option('dtrace', type : 'feature', value: 'disabled',
+option('dtrace', type: 'feature', value: 'disabled',
description: 'DTrace support')
-option('gssapi', type : 'feature', value: 'auto',
+option('gssapi', type: 'feature', value: 'auto',
description: 'GSSAPI support')
-option('icu', type : 'feature', value: 'auto',
+option('icu', type: 'feature', value: 'auto',
description: 'ICU support')
-option('ldap', type : 'feature', value: 'auto',
+option('ldap', type: 'feature', value: 'auto',
description: 'LDAP support')
-option('libedit_preferred', type : 'boolean', value: false,
+option('libedit_preferred', type: 'boolean', value: false,
description: 'Prefer BSD Libedit over GNU Readline')
-option('libxml', type : 'feature', value: 'auto',
+option('libxml', type: 'feature', value: 'auto',
description: 'XML support')
-option('libxslt', type : 'feature', value: 'auto',
+option('libxslt', type: 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
-option('llvm', type : 'feature', value: 'disabled',
+option('llvm', type: 'feature', value: 'disabled',
description: 'LLVM support')
-option('lz4', type : 'feature', value: 'auto',
+option('lz4', type: 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
-option('pam', type : 'feature', value: 'auto',
+option('pam', type: 'feature', value: 'auto',
description: 'PAM support')
-option('plperl', type : 'feature', value: 'auto',
+option('plperl', type: 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
-option('plpython', type : 'feature', value: 'auto',
+option('plpython', type: 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
-option('pltcl', type : 'feature', value: 'auto',
+option('pltcl', type: 'feature', value: 'auto',
description: 'Build with TCL support (PL/TCL)')
-option('tcl_version', type : 'string', value : 'tcl',
+option('tcl_version', type: 'string', value: 'tcl',
description: 'TCL version')
-option('readline', type : 'feature', value : 'auto',
+option('readline', type: 'feature', value: 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
-option('selinux', type : 'feature', value : 'disabled',
+option('selinux', type: 'feature', value: 'disabled',
description: 'SELinux support')
-option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
- value : 'auto',
+option('ssl', type: 'combo', choices: ['auto', 'none', 'openssl'],
+ value: 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
-option('systemd', type : 'feature', value: 'auto',
+option('systemd', type: 'feature', value: 'auto',
description: 'systemd support')
-option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
- value : 'none',
+option('uuid', type: 'combo', choices: ['none', 'bsd', 'e2fs', 'ossp'],
+ value: 'none',
description: 'Use LIB for contrib/uuid-ossp support')
-option('zlib', type : 'feature', value: 'auto',
+option('zlib', type: 'feature', value: 'auto',
description: 'Enable zlib')
-option('zstd', type : 'feature', value: 'auto',
+option('zstd', type: 'feature', value: 'auto',
description: 'Enable zstd')
# Programs
-option('BISON', type : 'array', value: ['bison', 'win_bison'],
+option('BISON', type: 'array', value: ['bison', 'win_bison'],
description: 'Path to bison binary')
-option('DTRACE', type : 'string', value: 'dtrace',
+option('DTRACE', type: 'string', value: 'dtrace',
description: 'Path to dtrace binary')
-option('FLEX', type : 'array', value: ['flex', 'win_flex'],
+option('FLEX', type: 'array', value: ['flex', 'win_flex'],
description: 'Path to flex binary')
-option('FOP', type : 'string', value: 'fop',
+option('FOP', type: 'string', value: 'fop',
description: 'Path to fop binary')
-option('GZIP', type : 'string', value: 'gzip',
+option('GZIP', type: 'string', value: 'gzip',
description: 'Path to gzip binary')
-option('LZ4', type : 'string', value: 'lz4',
+option('LZ4', type: 'string', value: 'lz4',
description: 'Path to lz4 binary')
-option('OPENSSL', type : 'string', value: 'openssl',
+option('OPENSSL', type: 'string', value: 'openssl',
description: 'Path to openssl binary')
-option('PERL', type : 'string', value: 'perl',
+option('PERL', type: 'string', value: 'perl',
description: 'Path to perl binary')
-option('PROVE', type : 'string', value: 'prove',
+option('PROVE', type: 'string', value: 'prove',
description: 'Path to prove binary')
-option('PYTHON', type : 'array', value: ['python3', 'python'],
+option('PYTHON', type: 'array', value: ['python3', 'python'],
description: 'Path to python binary')
-option('SED', type : 'string', value: 'gsed',
+option('SED', type: 'string', value: 'gsed',
description: 'Path to sed binary')
-option('STRIP', type : 'string', value: 'strip',
+option('STRIP', type: 'string', value: 'strip',
description: 'Path to strip binary, used for PGXS emulation')
-option('TAR', type : 'string', value: 'tar',
+option('TAR', type: 'string', value: 'tar',
description: 'Path to tar binary')
-option('XMLLINT', type : 'string', value: 'xmllint',
+option('XMLLINT', type: 'string', value: 'xmllint',
description: 'Path to xmllint binary')
-option('XSLTPROC', type : 'string', value: 'xsltproc',
+option('XSLTPROC', type: 'string', value: 'xsltproc',
description: 'Path to xsltproc binary')
-option('ZSTD', type : 'string', value: 'zstd',
+option('ZSTD', type: 'string', value: 'zstd',
description: 'Path to zstd binary')
-option('ZIC', type : 'string', value: 'zic',
+option('ZIC', type: 'string', value: 'zic',
description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v1-0005-Use-the-not_found_dep-constant.patchtext/x-patch; charset=utf-8; name=v1-0005-Use-the-not_found_dep-constant.patchDownload
From 3aa4f57021447e57707bb63c80c4dff863a8f2ca Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:33:12 -0500
Subject: [PATCH postgres v1 05/17] Use the not_found_dep constant
Previously in the build description, a not_found_dep was defined. Make
use of it.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 096044628c..d6e415d40a 100644
--- a/meson.build
+++ b/meson.build
@@ -558,7 +558,7 @@ endif
###############################################################
bonjouropt = get_option('bonjour')
-bonjour = dependency('', required : false)
+bonjour = not_found_dep
if cc.check_header('dns_sd.h', required: bonjouropt,
args: test_c_args, include_directories: postgres_inc) and \
cc.has_function('DNSServiceRegister',
--
Tristan Partin
Neon (https://neon.tech)
v1-0006-Remove-old-comment.patchtext/x-patch; charset=utf-8; name=v1-0006-Remove-old-comment.patchDownload
From ed34dc95b979169e50d11353b480e25d7e9af916 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:19:46 -0500
Subject: [PATCH postgres v1 06/17] Remove old comment
That portion of code is not run in the Windows case already given the
structure of the surrounding if statement.
---
meson.build | 2 --
1 file changed, 2 deletions(-)
diff --git a/meson.build b/meson.build
index d6e415d40a..3db70fb8a6 100644
--- a/meson.build
+++ b/meson.build
@@ -722,8 +722,6 @@ choke me
endif
endif
- # XXX: this shouldn't be tested in the windows case, but should be tested in
- # the dependency() success case
if ldap.found() and cc.has_function('ldap_initialize',
dependencies: ldap, args: test_c_args)
cdata.set('HAVE_LDAP_INITIALIZE', 1)
--
Tristan Partin
Neon (https://neon.tech)
v1-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchtext/x-patch; charset=utf-8; name=v1-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchDownload
From 75b30d373c26e01e95d7ec4a87e8a19f91b581db Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:27:06 -0500
Subject: [PATCH postgres v1 07/17] Tie adding C++ support to the llvm Meson
option
In the event the llvm option is defined to be 'auto', it is possible
that the host machine might not have a C++ compiler. If that is the
case, then we shouldn't continue reaching for the llvm dependency.
---
meson.build | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/meson.build b/meson.build
index 3db70fb8a6..d266e2eb1f 100644
--- a/meson.build
+++ b/meson.build
@@ -743,19 +743,20 @@ endif
llvmopt = get_option('llvm')
if not llvmopt.disabled()
- add_languages('cpp', required: true, native: false)
- llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
+ if add_languages('cpp', required: llvmopt, native: false)
+ llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
- if llvm.found()
+ if llvm.found()
- cdata.set('USE_LLVM', 1)
+ cdata.set('USE_LLVM', 1)
- cpp = meson.get_compiler('cpp')
+ cpp = meson.get_compiler('cpp')
- llvm_binpath = llvm.get_variable(configtool: 'bindir')
+ llvm_binpath = llvm.get_variable(configtool: 'bindir')
- ccache = find_program('ccache', native: true, required: false)
- clang = find_program(llvm_binpath / 'clang', required: true)
+ ccache = find_program('ccache', native: true, required: false)
+ clang = find_program(llvm_binpath / 'clang', required: true)
+ endif
endif
else
llvm = not_found_dep
--
Tristan Partin
Neon (https://neon.tech)
v1-0008-Mention-the-correct-way-to-disable-readline-suppo.patchtext/x-patch; charset=utf-8; name=v1-0008-Mention-the-correct-way-to-disable-readline-suppo.patchDownload
From d3b51220c88143cc4a87d23d900c13cf28a0105d Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 10:27:34 -0500
Subject: [PATCH postgres v1 08/17] Mention the correct way to disable readline
support
Using false to disable a feature option is incorrect.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index d266e2eb1f..ca4366988d 100644
--- a/meson.build
+++ b/meson.build
@@ -1132,7 +1132,7 @@ if not get_option('readline').disabled()
error('''readline header not found
If you have @0@ already installed, see meson-log/meson-log.txt for details on the
failure. It is possible the compiler isn't looking in the proper directory.
-Use -Dreadline=false to disable readline support.'''.format(readline_dep))
+Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
endif
check_funcs = [
--
Tristan Partin
Neon (https://neon.tech)
v1-0009-Remove-return-code-check.patchtext/x-patch; charset=utf-8; name=v1-0009-Remove-return-code-check.patchDownload
From 5c3a143dd2a882bdaa3aa2fa4dcb49c39ddc676d Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:30:54 -0500
Subject: [PATCH postgres v1 09/17] Remove return code check
run_command(check: true) will already handle this.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index ca4366988d..592f271711 100644
--- a/meson.build
+++ b/meson.build
@@ -385,7 +385,7 @@ install_files = files('src/tools/install_files')
# https://github.com/mesonbuild/meson/issues/8511
meson_binpath_r = run_command(python, 'src/tools/find_meson', check: true)
-if meson_binpath_r.returncode() != 0 or meson_binpath_r.stdout() == ''
+if meson_binpath_r.stdout() == ''
error('huh, could not run find_meson.\nerrcode: @0@\nstdout: @1@\nstderr: @2@'.format(
meson_binpath_r.returncode(),
meson_binpath_r.stdout(),
--
Tristan Partin
Neon (https://neon.tech)
v1-0010-Fix-some-grammar-usage-in-Meson-comments.patchtext/x-patch; charset=utf-8; name=v1-0010-Fix-some-grammar-usage-in-Meson-comments.patchDownload
From 6f820f240a6d726c639e121f55823341ae1a9abb Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:33:18 -0500
Subject: [PATCH postgres v1 10/17] Fix some grammar usage in Meson comments
---
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 592f271711..e9e03d1ff5 100644
--- a/meson.build
+++ b/meson.build
@@ -150,7 +150,7 @@ cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
cdata.set('PG_MAJORVERSION_NUM', pg_version_major)
cdata.set('PG_MINORVERSION_NUM', pg_version_minor)
cdata.set('PG_VERSION_NUM', pg_version_num)
-# PG_VERSION_STR is built later, it depends compiler test results
+# PG_VERSION_STR is built later, it depends on compiler test results
cdata.set_quoted('CONFIGURE_ARGS', '')
@@ -1675,7 +1675,7 @@ if cc.has_function_attribute('visibility:default') and \
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
- # inlineshidden to C code as well... Any either way, we want to put these
+ # inlineshidden to C code as well... And either way, we want to put these
# flags into exported files (pgxs, .pc files).
cflags_mod += '-fvisibility=hidden'
cxxflags_mod += ['-fvisibility=hidden', '-fvisibility-inlines-hidden']
--
Tristan Partin
Neon (https://neon.tech)
v1-0011-Pass-feature-option-through-to-required-kwarg.patchtext/x-patch; charset=utf-8; name=v1-0011-Pass-feature-option-through-to-required-kwarg.patchDownload
From c89ac6672dd0b914d06f6fe07861300cdf613331 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:38:09 -0500
Subject: [PATCH postgres v1 11/17] Pass feature option through to required
kwarg
Meson understands this already. No need to convert it to a boolean.
---
meson.build | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index e9e03d1ff5..83bc1c7b25 100644
--- a/meson.build
+++ b/meson.build
@@ -770,8 +770,8 @@ endif
icuopt = get_option('icu')
if not icuopt.disabled()
- icu = dependency('icu-uc', required: icuopt.enabled())
- icu_i18n = dependency('icu-i18n', required: icuopt.enabled())
+ icu = dependency('icu-uc', required: icuopt)
+ icu_i18n = dependency('icu-i18n', required: icuopt)
if icu.found()
cdata.set('USE_ICU', 1)
@@ -1080,7 +1080,7 @@ if not get_option('readline').disabled()
readline = dependency(readline_dep, required: false)
if not readline.found()
readline = cc.find_library(readline_dep,
- required: get_option('readline').enabled(),
+ required: get_option('readline'),
dirs: test_lib_d)
endif
if readline.found()
@@ -2540,7 +2540,7 @@ if not nlsopt.disabled()
# otherwise there'd be lots of
# "Gettext not found, all translation (po) targets will be ignored."
# warnings if not found.
- msgfmt = find_program('msgfmt', required: nlsopt.enabled(), native: true)
+ msgfmt = find_program('msgfmt', required: nlsopt, native: true)
# meson 0.59 has this wrapped in dependency('int')
if (msgfmt.found() and
--
Tristan Partin
Neon (https://neon.tech)
v1-0012-Make-finding-pkg-config-python3-more-robust.patchtext/x-patch; charset=utf-8; name=v1-0012-Make-finding-pkg-config-python3-more-robust.patchDownload
From b35ecb2c8dcd71608f98af1e0ec19d965099ceab Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH postgres v1 12/17] Make finding pkg-config(python3) more
robust
It is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.
https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/python.py#L218
---
meson.build | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 83bc1c7b25..8dbd9b660b 100644
--- a/meson.build
+++ b/meson.build
@@ -1053,15 +1053,13 @@ endif
###############################################################
pyopt = get_option('plpython')
+python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
- python3_dep = not_found_dep
+ python3_inst = pm.find_installation(required: pyopt)
+ if python3_inst.found()
+ python3_dep = python3_inst.dependency(embed: true, required: pyopt)
endif
-else
- python3_dep = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v1-0013-Make-some-Meson-style-more-consistent-with-surrou.patchtext/x-patch; charset=utf-8; name=v1-0013-Make-some-Meson-style-more-consistent-with-surrou.patchDownload
From d6e3ba0b2b698b39121bbd58af01b99d616a4f8c Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:43:51 -0500
Subject: [PATCH postgres v1 13/17] Make some Meson style more consistent with
surrounding code
---
meson.build | 17 ++++++++---------
src/include/meson.build | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/meson.build b/meson.build
index 8dbd9b660b..ba158cb635 100644
--- a/meson.build
+++ b/meson.build
@@ -1145,7 +1145,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
foreach func : check_funcs
found = cc.has_function(func, dependencies: [readline],
args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_'+func.to_upper(), found ? 1 : false)
+ cdata.set('HAVE_' + func.to_upper(), found ? 1 : false)
endforeach
check_vars = [
@@ -1155,7 +1155,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
]
foreach var : check_vars
- cdata.set('HAVE_'+var.to_upper(),
+ cdata.set('HAVE_' + var.to_upper(),
cc.has_header_symbol(readline_h, var,
args: test_c_args, include_directories: postgres_inc,
prefix: '#include <stdio.h>',
@@ -1310,7 +1310,7 @@ if sslopt in ['auto', 'openssl']
cdata.set('USE_OPENSSL', 1,
description: 'Define to 1 to build with OpenSSL support. (-Dssl=openssl)')
cdata.set('OPENSSL_API_COMPAT', '0x10001000L',
- description: '''Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.''')
+ description: 'Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.')
ssl_library = 'openssl'
else
ssl = not_found_dep
@@ -1598,8 +1598,7 @@ if cc.links('''
if not buggy_int128
cdata.set('PG_INT128_TYPE', '__int128')
- cdata.set('ALIGNOF_PG_INT128_TYPE', cc.
- alignment('__int128', args: test_c_args))
+ cdata.set('ALIGNOF_PG_INT128_TYPE', cc.alignment('__int128', args: test_c_args))
endif
endif
@@ -1641,8 +1640,8 @@ endif
# We use <stdbool.h> if we have it and it declares type bool as having
# size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
if cc.has_type('_Bool', args: test_c_args) \
- and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
- and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
+ and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
+ and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
cdata.set('HAVE__BOOL', 1)
cdata.set('PG_USE_STDBOOL', 1)
endif
@@ -1669,7 +1668,7 @@ endforeach
if cc.has_function_attribute('visibility:default') and \
- cc.has_function_attribute('visibility:hidden')
+ cc.has_function_attribute('visibility:hidden')
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
@@ -3031,7 +3030,7 @@ meson_install_args = meson_args + ['install'] + {
'muon': []
}[meson_impl]
-# setup tests should be run first,
+# setup tests should be run first,
# so define priority for these
setup_tests_priority = 100
test('tmp_install',
diff --git a/src/include/meson.build b/src/include/meson.build
index 33c0a5562c..d7e1ecd4c9 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -89,7 +89,7 @@ install_headers(
'c.h',
'port.h',
'postgres_fe.h',
- install_dir: dir_include_internal
+ install_dir: dir_include_internal,
)
install_headers(
--
Tristan Partin
Neon (https://neon.tech)
v1-0014-Reduce-branching-on-Meson-version.patchtext/x-patch; charset=utf-8; name=v1-0014-Reduce-branching-on-Meson-version.patchDownload
From 47394ffd113d4170e955bc033841cb7e18fd3ac4 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:44:49 -0500
Subject: [PATCH postgres v1 14/17] Reduce branching on Meson version
This code had a branch depending on Meson version. Instead, we can just
move the system checks to the if statement. I believe this also keeps
selinux and systemd from being looked for on non-Linux systems when
using Meson < 0.59. Before they would be checked, but obviously fail.
---
meson.build | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/meson.build b/meson.build
index ba158cb635..d92c57249d 100644
--- a/meson.build
+++ b/meson.build
@@ -1190,13 +1190,10 @@ endif
###############################################################
selinux = not_found_dep
-selinuxopt = get_option('selinux')
-if meson.version().version_compare('>=0.59')
- selinuxopt = selinuxopt.disable_auto_if(host_system != 'linux')
+if host_system == 'linux'
+ selinux = dependency('libselinux', required: get_option('selinux'), version: '>= 2.1.10')
+ cdata.set('HAVE_LIBSELINUX', selinux.found() ? 1 : false)
endif
-selinux = dependency('libselinux', required: selinuxopt, version: '>= 2.1.10')
-cdata.set('HAVE_LIBSELINUX',
- selinux.found() ? 1 : false)
@@ -1205,12 +1202,10 @@ cdata.set('HAVE_LIBSELINUX',
###############################################################
systemd = not_found_dep
-systemdopt = get_option('systemd')
-if meson.version().version_compare('>=0.59')
- systemdopt = systemdopt.disable_auto_if(host_system != 'linux')
+if host_system == 'linux'
+ systemd = dependency('libsystemd', required: get_option('systemd'))
+ cdata.set('USE_SYSTEMD', systemd.found() ? 1 : false)
endif
-systemd = dependency('libsystemd', required: systemdopt)
-cdata.set('USE_SYSTEMD', systemd.found() ? 1 : false)
--
Tristan Partin
Neon (https://neon.tech)
v1-0015-Use-a-better-error-message-in-an-impossible-case.patchtext/x-patch; charset=utf-8; name=v1-0015-Use-a-better-error-message-in-an-impossible-case.patchDownload
From c88f32e8f0801c57f01dd7b9cdbac1d1e749a5ea Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:48:18 -0500
Subject: [PATCH postgres v1 15/17] Use a better error message in an impossible
case
Meson validates 'choice' options for us, so technically this case is
impossible. A better error message helps people reading the code
understand what is going on in that branch.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index d92c57249d..6981429b20 100644
--- a/meson.build
+++ b/meson.build
@@ -1340,7 +1340,7 @@ if uuidopt != 'none'
uuidfunc = 'uuid_export'
uuidheader = 'uuid.h'
else
- error('huh')
+ error('unknown uuid build option value: @0@'.format(uuidopt))
endif
if not cc.has_header_symbol(uuidheader, uuidfunc, args: test_c_args, dependencies: uuid)
--
Tristan Partin
Neon (https://neon.tech)
v1-0016-Add-Meson-overrides.patchtext/x-patch; charset=utf-8; name=v1-0016-Add-Meson-overrides.patchDownload
From 189d3ac3d5593ce3e475813e4830a29bb4e96f70 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH postgres v1 16/17] Add Meson overrides
Meson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:
[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1
[provide]
dependency_names = libpq
Then in my extension (root project), I can have the following line
snippet:
libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.
I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:
program_names = initdb, postgres, ...
Then in my extension (root project), I can find them with the following
line:
initdb = find_program('initdb')
Again, initdb will be compiled transparently as my extension gets built
if and only if initdb isn't found on the host system.
---
src/backend/meson.build | 2 ++
src/bin/initdb/meson.build | 2 ++
src/bin/pg_amcheck/meson.build | 2 ++
src/bin/pg_archivecleanup/meson.build | 2 ++
src/bin/pg_basebackup/meson.build | 6 ++++++
src/bin/pg_checksums/meson.build | 2 ++
src/bin/pg_config/meson.build | 2 ++
src/bin/pg_controldata/meson.build | 2 ++
src/bin/pg_ctl/meson.build | 2 ++
src/bin/pg_dump/meson.build | 6 ++++++
src/bin/pg_resetwal/meson.build | 2 ++
src/bin/pg_rewind/meson.build | 2 ++
src/bin/pg_test_fsync/meson.build | 2 ++
src/bin/pg_test_timing/meson.build | 2 ++
src/bin/pg_upgrade/meson.build | 2 ++
src/bin/pg_verifybackup/meson.build | 2 ++
src/bin/pg_waldump/meson.build | 2 ++
src/bin/pgbench/meson.build | 2 ++
src/bin/psql/meson.build | 2 ++
src/bin/scripts/meson.build | 6 ++++--
src/interfaces/ecpg/preproc/meson.build | 2 ++
src/interfaces/libpq/meson.build | 2 ++
22 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/src/backend/meson.build b/src/backend/meson.build
index ccfc382fcf..ac2f66d920 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -147,6 +147,8 @@ postgres = executable('postgres',
backend_targets += postgres
+meson.override_find_program('postgres', postgres)
+
pg_mod_c_args = cflags_mod
pg_mod_cpp_args = cxxflags_mod
pg_mod_link_args = ldflags_sl + ldflags_mod
diff --git a/src/bin/initdb/meson.build b/src/bin/initdb/meson.build
index 49743630aa..12b4918e8b 100644
--- a/src/bin/initdb/meson.build
+++ b/src/bin/initdb/meson.build
@@ -23,6 +23,8 @@ initdb = executable('initdb',
)
bin_targets += initdb
+meson.override_find_program('initdb', initdb)
+
tests += {
'name': 'initdb',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_amcheck/meson.build b/src/bin/pg_amcheck/meson.build
index 2ade5aba03..8694abbf07 100644
--- a/src/bin/pg_amcheck/meson.build
+++ b/src/bin/pg_amcheck/meson.build
@@ -17,6 +17,8 @@ pg_amcheck = executable('pg_amcheck',
)
bin_targets += pg_amcheck
+meson.override_find_program('pg_amcheck', pg_amcheck)
+
tests += {
'name': 'pg_amcheck',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_archivecleanup/meson.build b/src/bin/pg_archivecleanup/meson.build
index 28349db58b..6eecb42b05 100644
--- a/src/bin/pg_archivecleanup/meson.build
+++ b/src/bin/pg_archivecleanup/meson.build
@@ -17,6 +17,8 @@ pg_archivecleanup = executable('pg_archivecleanup',
)
bin_targets += pg_archivecleanup
+meson.override_find_program('pg_archivecleanup', pg_archivecleanup)
+
tests += {
'name': 'pg_archivecleanup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build
index c684622bfb..589c664163 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -37,6 +37,8 @@ pg_basebackup = executable('pg_basebackup',
)
bin_targets += pg_basebackup
+meson.override_find_program('pg_basebackup', pg_basebackup)
+
pg_receivewal_sources = files(
'pg_receivewal.c',
@@ -56,6 +58,8 @@ pg_receivewal = executable('pg_receivewal',
)
bin_targets += pg_receivewal
+meson.override_find_program('pg_receivewal', pg_receivewal)
+
pg_recvlogical_sources = files(
'pg_recvlogical.c',
@@ -75,6 +79,8 @@ pg_recvlogical = executable('pg_recvlogical',
)
bin_targets += pg_recvlogical
+meson.override_find_program('pg_recvlogical', pg_recvlogical)
+
tests += {
'name': 'pg_basebackup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_checksums/meson.build b/src/bin/pg_checksums/meson.build
index 5528526094..d54e76ae6c 100644
--- a/src/bin/pg_checksums/meson.build
+++ b/src/bin/pg_checksums/meson.build
@@ -18,6 +18,8 @@ pg_checksums = executable('pg_checksums',
)
bin_targets += pg_checksums
+meson.override_find_program('pg_checksums', pg_checksums)
+
tests += {
'name': 'pg_checksums',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_config/meson.build b/src/bin/pg_config/meson.build
index 7fd7e94e2d..bea966f63e 100644
--- a/src/bin/pg_config/meson.build
+++ b/src/bin/pg_config/meson.build
@@ -17,6 +17,8 @@ pg_config = executable('pg_config',
)
bin_targets += pg_config
+meson.override_find_program('pg_config', pg_config)
+
tests += {
'name': 'pg_config',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_controldata/meson.build b/src/bin/pg_controldata/meson.build
index 03c9d0ae3e..4521828b1f 100644
--- a/src/bin/pg_controldata/meson.build
+++ b/src/bin/pg_controldata/meson.build
@@ -17,6 +17,8 @@ pg_controldata = executable('pg_controldata',
)
bin_targets += pg_controldata
+meson.override_find_program('pg_controldata', pg_controldata)
+
tests += {
'name': 'pg_controldata',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_ctl/meson.build b/src/bin/pg_ctl/meson.build
index 608a52f9fb..b62519c15f 100644
--- a/src/bin/pg_ctl/meson.build
+++ b/src/bin/pg_ctl/meson.build
@@ -17,6 +17,8 @@ pg_ctl = executable('pg_ctl',
)
bin_targets += pg_ctl
+meson.override_find_program('pg_ctl', pg_ctl)
+
tests += {
'name': 'pg_ctl',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_dump/meson.build b/src/bin/pg_dump/meson.build
index 9d59a106f3..ae89758ef6 100644
--- a/src/bin/pg_dump/meson.build
+++ b/src/bin/pg_dump/meson.build
@@ -45,6 +45,8 @@ pg_dump = executable('pg_dump',
)
bin_targets += pg_dump
+meson.override_find_program('pg_dump', pg_dump)
+
pg_dumpall_sources = files(
'pg_dumpall.c',
@@ -64,6 +66,8 @@ pg_dumpall = executable('pg_dumpall',
)
bin_targets += pg_dumpall
+meson.override_find_program('pg_dumpall', pg_dumpall)
+
pg_restore_sources = files(
'pg_restore.c',
@@ -83,6 +87,8 @@ pg_restore = executable('pg_restore',
)
bin_targets += pg_restore
+meson.override_find_program('pg_restore', pg_restore)
+
tests += {
'name': 'pg_dump',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_resetwal/meson.build b/src/bin/pg_resetwal/meson.build
index 3f08a819bb..e7d4ab3fa5 100644
--- a/src/bin/pg_resetwal/meson.build
+++ b/src/bin/pg_resetwal/meson.build
@@ -17,6 +17,8 @@ pg_resetwal = executable('pg_resetwal',
)
bin_targets += pg_resetwal
+meson.override_find_program('pg_resetwal', pg_resetwal)
+
tests += {
'name': 'pg_resetwal',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_rewind/meson.build b/src/bin/pg_rewind/meson.build
index fd22818be4..23d698d8fd 100644
--- a/src/bin/pg_rewind/meson.build
+++ b/src/bin/pg_rewind/meson.build
@@ -27,6 +27,8 @@ pg_rewind = executable('pg_rewind',
)
bin_targets += pg_rewind
+meson.override_find_program('pg_rewind', pg_rewind)
+
tests += {
'name': 'pg_rewind',
diff --git a/src/bin/pg_test_fsync/meson.build b/src/bin/pg_test_fsync/meson.build
index aaf65c310e..3a03156508 100644
--- a/src/bin/pg_test_fsync/meson.build
+++ b/src/bin/pg_test_fsync/meson.build
@@ -17,6 +17,8 @@ pg_test_fsync = executable('pg_test_fsync',
)
bin_targets += pg_test_fsync
+meson.override_find_program('pg_test_fsync', pg_test_fsync)
+
tests += {
'name': 'pg_test_fsync',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_test_timing/meson.build b/src/bin/pg_test_timing/meson.build
index 02f4a5c641..8a5aa29135 100644
--- a/src/bin/pg_test_timing/meson.build
+++ b/src/bin/pg_test_timing/meson.build
@@ -17,6 +17,8 @@ pg_test_timing = executable('pg_test_timing',
)
bin_targets += pg_test_timing
+meson.override_find_program('pg_test_timing', pg_test_timing)
+
tests += {
'name': 'pg_test_timing',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_upgrade/meson.build b/src/bin/pg_upgrade/meson.build
index 12a97f84e2..3046b3f471 100644
--- a/src/bin/pg_upgrade/meson.build
+++ b/src/bin/pg_upgrade/meson.build
@@ -32,6 +32,8 @@ pg_upgrade = executable('pg_upgrade',
)
bin_targets += pg_upgrade
+meson.override_find_program('pg_upgrade', pg_upgrade)
+
tests += {
'name': 'pg_upgrade',
diff --git a/src/bin/pg_verifybackup/meson.build b/src/bin/pg_verifybackup/meson.build
index 9369da1bc6..5b670fd3e5 100644
--- a/src/bin/pg_verifybackup/meson.build
+++ b/src/bin/pg_verifybackup/meson.build
@@ -18,6 +18,8 @@ pg_verifybackup = executable('pg_verifybackup',
)
bin_targets += pg_verifybackup
+meson.override_find_program('pg_verifybackup', pg_verifybackup)
+
tests += {
'name': 'pg_verifybackup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_waldump/meson.build b/src/bin/pg_waldump/meson.build
index ae674d17c3..c03f212842 100644
--- a/src/bin/pg_waldump/meson.build
+++ b/src/bin/pg_waldump/meson.build
@@ -24,6 +24,8 @@ pg_waldump = executable('pg_waldump',
)
bin_targets += pg_waldump
+meson.override_find_program('pg_waldump', pg_waldump)
+
tests += {
'name': 'pg_waldump',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pgbench/meson.build b/src/bin/pgbench/meson.build
index e3c7619cf4..b8b46ef721 100644
--- a/src/bin/pgbench/meson.build
+++ b/src/bin/pgbench/meson.build
@@ -35,6 +35,8 @@ pgbench = executable('pgbench',
)
bin_targets += pgbench
+meson.override_find_program('pgbench', pgbench)
+
tests += {
'name': 'pgbench',
'sd': meson.current_source_dir(),
diff --git a/src/bin/psql/meson.build b/src/bin/psql/meson.build
index a0a4ac7afb..cf20b3a7a4 100644
--- a/src/bin/psql/meson.build
+++ b/src/bin/psql/meson.build
@@ -53,6 +53,8 @@ psql = executable('psql',
)
bin_targets += psql
+meson.override_find_program('psql', psql)
+
install_data('psqlrc.sample',
install_dir: dir_data,
)
diff --git a/src/bin/scripts/meson.build b/src/bin/scripts/meson.build
index 5b4f8a6f85..fa16814710 100644
--- a/src/bin/scripts/meson.build
+++ b/src/bin/scripts/meson.build
@@ -26,13 +26,15 @@ foreach binary : binaries
'--FILEDESC', '@0@ - PostgreSQL utility'.format(binary),])
endif
- binary = executable(binary,
+ exe = executable(binary,
binary_sources,
link_with: [scripts_common],
dependencies: [frontend_code, libpq],
kwargs: default_bin_args,
)
- bin_targets += binary
+ bin_targets += exe
+
+ meson.override_find_program(binary, exe)
endforeach
tests += {
diff --git a/src/interfaces/ecpg/preproc/meson.build b/src/interfaces/ecpg/preproc/meson.build
index 08d772d261..f7c9f79c81 100644
--- a/src/interfaces/ecpg/preproc/meson.build
+++ b/src/interfaces/ecpg/preproc/meson.build
@@ -110,4 +110,6 @@ ecpg_exe = executable('ecpg',
)
ecpg_targets += ecpg_exe
+meson.override_find_program('ecpg', ecpg_exe)
+
subdir('po', if_found: libintl)
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index 80e6a15adf..6d18970e81 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -84,6 +84,8 @@ libpq = declare_dependency(
include_directories: [include_directories('.')]
)
+meson.override_dependency('libpq', libpq)
+
pkgconfig.generate(
name: 'libpq',
description: 'PostgreSQL libpq library',
--
Tristan Partin
Neon (https://neon.tech)
v1-0017-Remove-Meson-program-options-for-specifying-paths.patchtext/x-patch; charset=utf-8; name=v1-0017-Remove-Meson-program-options-for-specifying-paths.patchDownload
From 5ee13f09e4101904dbc9887bd4844eb5f1cb4fea Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:54:53 -0500
Subject: [PATCH postgres v1 17/17] Remove Meson program options for specifying
paths
Meson has a built-in way to override paths without polluting project
build options called machine files.
https://mesonbuild.com/Machine-files.html
To summarize, a replacement for these options would look something like
the following:
[binaries]
bison = 'path/to/bison'
flex = 'path/to/flex'
This tells Meson to use the pre-defined paths for the defined binaries.
This process is very similar for how cross builds are done in Meson too.
To use the native.ini file, all someone compiling Postgres has to do is
pass `--native-file native.ini` to `meson setup`.
---
meson.build | 30 +++++++++++-----------
meson_options.txt | 54 ---------------------------------------
src/makefiles/meson.build | 2 +-
src/timezone/meson.build | 2 +-
4 files changed, 17 insertions(+), 71 deletions(-)
diff --git a/meson.build b/meson.build
index 6981429b20..6d8e34fc29 100644
--- a/meson.build
+++ b/meson.build
@@ -327,22 +327,22 @@ endif
###############################################################
# External programs
-perl = find_program(get_option('PERL'), required: true, native: true)
-python = find_program(get_option('PYTHON'), required: true, native: true)
-flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.35')
-bison = find_program(get_option('BISON'), native: true, version: '>= 2.3')
-sed = find_program(get_option('SED'), 'sed', native: true)
-prove = find_program(get_option('PROVE'), native: true, required: false)
-tar = find_program(get_option('TAR'), native: true)
-gzip = find_program(get_option('GZIP'), native: true)
-program_lz4 = find_program(get_option('LZ4'), native: true, required: false)
-openssl = find_program(get_option('OPENSSL'), native: true, required: false)
-program_zstd = find_program(get_option('ZSTD'), native: true, required: false)
-dtrace = find_program(get_option('DTRACE'), native: true, required: get_option('dtrace'))
+perl = find_program('perl', required: true, native: true)
+python = find_program('python3', 'python', required: true, native: true)
+flex = find_program('flex', 'win_flex', native: true, version: '>= 2.5.35')
+bison = find_program('bison', 'win_bison', native: true, version: '>= 2.3')
+sed = find_program('sed', native: true)
+prove = find_program('prove', native: true, required: false)
+tar = find_program('tar', native: true)
+gzip = find_program('gzip', native: true)
+program_lz4 = find_program('lz4', native: true, required: false)
+openssl = find_program('openssl', native: true, required: false)
+program_zstd = find_program('zstd', native: true, required: false)
+dtrace = find_program('dtrace', native: true, required: get_option('dtrace'))
missing = find_program('config/missing', native: true)
cp = find_program('cp', required: false, native: true)
-xmllint_bin = find_program(get_option('XMLLINT'), native: true, required: false)
-xsltproc_bin = find_program(get_option('XSLTPROC'), native: true, required: false)
+xmllint_bin = find_program('xmllint', native: true, required: false)
+xsltproc_bin = find_program('xlstproc', native: true, required: false)
bison_flags = []
if bison.found()
@@ -592,7 +592,7 @@ endif
docs_pdf_opt = get_option('docs_pdf')
docs_pdf_dep = not_found_dep
if not docs_pdf_opt.disabled()
- fop = find_program(get_option('FOP'), native: true, required: docs_pdf_opt)
+ fop = find_program('fop', native: true, required: docs_pdf_opt)
if xmllint_bin.found() and xsltproc_bin.found() and fop.found()
docs_pdf_dep = declare_dependency()
elif docs_pdf_opt.enabled()
diff --git a/meson_options.txt b/meson_options.txt
index e9ac70766a..1760cf05f9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -155,57 +155,3 @@ option('zlib', type: 'feature', value: 'auto',
option('zstd', type: 'feature', value: 'auto',
description: 'Enable zstd')
-
-
-# Programs
-
-option('BISON', type: 'array', value: ['bison', 'win_bison'],
- description: 'Path to bison binary')
-
-option('DTRACE', type: 'string', value: 'dtrace',
- description: 'Path to dtrace binary')
-
-option('FLEX', type: 'array', value: ['flex', 'win_flex'],
- description: 'Path to flex binary')
-
-option('FOP', type: 'string', value: 'fop',
- description: 'Path to fop binary')
-
-option('GZIP', type: 'string', value: 'gzip',
- description: 'Path to gzip binary')
-
-option('LZ4', type: 'string', value: 'lz4',
- description: 'Path to lz4 binary')
-
-option('OPENSSL', type: 'string', value: 'openssl',
- description: 'Path to openssl binary')
-
-option('PERL', type: 'string', value: 'perl',
- description: 'Path to perl binary')
-
-option('PROVE', type: 'string', value: 'prove',
- description: 'Path to prove binary')
-
-option('PYTHON', type: 'array', value: ['python3', 'python'],
- description: 'Path to python binary')
-
-option('SED', type: 'string', value: 'gsed',
- description: 'Path to sed binary')
-
-option('STRIP', type: 'string', value: 'strip',
- description: 'Path to strip binary, used for PGXS emulation')
-
-option('TAR', type: 'string', value: 'tar',
- description: 'Path to tar binary')
-
-option('XMLLINT', type: 'string', value: 'xmllint',
- description: 'Path to xmllint binary')
-
-option('XSLTPROC', type: 'string', value: 'xsltproc',
- description: 'Path to xsltproc binary')
-
-option('ZSTD', type: 'string', value: 'zstd',
- description: 'Path to zstd binary')
-
-option('ZIC', type: 'string', value: 'zic',
- description: 'Path to zic binary, when cross-compiling')
diff --git a/src/makefiles/meson.build b/src/makefiles/meson.build
index 13045cbd6e..b8ec848d74 100644
--- a/src/makefiles/meson.build
+++ b/src/makefiles/meson.build
@@ -5,7 +5,7 @@
# Emulation of PGAC_CHECK_STRIP
-strip_bin = find_program(get_option('STRIP'), required: false, native: true)
+strip_bin = find_program('strip', required: false, native: true)
strip_cmd = strip_bin.found() ? [strip_bin.path()] : [':']
working_strip = false
diff --git a/src/timezone/meson.build b/src/timezone/meson.build
index 7b85a01c6b..8f6edb5110 100644
--- a/src/timezone/meson.build
+++ b/src/timezone/meson.build
@@ -28,7 +28,7 @@ if get_option('system_tzdata') == ''
# build our zic. But for that we'd need to run a good chunk of the configure
# tests both natively and cross. Unclear if it's worth it.
if meson.is_cross_build()
- zic = find_program(get_option('ZIC'), native: true, required: true)
+ zic = find_program('zic', native: true, required: true)
else
if host_system == 'windows'
zic_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
--
Tristan Partin
Neon (https://neon.tech)
Received a review from a Meson maintainer. Here is a v2.
--
Tristan Partin
Neon (https://neon.tech)
Attachments:
v2-0001-Remove-triple-quoted-strings.patchtext/x-patch; charset=utf-8; name=v2-0001-Remove-triple-quoted-strings.patchDownload
From 1ebd8acb56eb0227b09bd7536e1c88ba0059c7ad Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 07:55:03 -0500
Subject: [PATCH v2 01/17] Remove triple-quoted strings
Triple-quoted strings are for multiline strings in Meson. None of the
descriptions that got changed were multiline and the entire file uses
single-line descriptions.
---
meson_options.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 5b44a8829d..1ea9729dc2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,19 +10,19 @@ option('blocksize', type : 'combo',
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : '''WAL block size, in kilobytes''')
+ description : 'WAL block size, in kilobytes')
option('segsize', type : 'integer', value : 1,
- description : '''Segment size, in gigabytes''')
+ description : 'Segment size, in gigabytes')
option('segsize_blocks', type : 'integer', value: 0,
- description : '''Segment size, in blocks''')
+ description : 'Segment size, in blocks')
# Miscellaneous options
option('krb_srvnam', type : 'string', value : 'postgres',
- description : '''Default Kerberos service principal for GSSAPI''')
+ description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'use system time zone data in specified directory')
@@ -32,7 +32,7 @@ option('system_tzdata', type: 'string', value: '',
option('pgport', type : 'integer', value : 5432,
min: 1, max: 65535,
- description : '''Default port number for server and clients''')
+ description : 'Default port number for server and clients')
# Developer options
--
Tristan Partin
Neon (https://neon.tech)
v2-0002-Use-consistent-casing-in-Meson-option-description.patchtext/x-patch; charset=utf-8; name=v2-0002-Use-consistent-casing-in-Meson-option-description.patchDownload
From ecf70897974b5651575cf7b0f729c99fd436c976 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:03:31 -0500
Subject: [PATCH v2 02/17] Use consistent casing in Meson option descriptions
Meson itself uses capital letters for option descriptions, so follow
that.
---
meson_options.txt | 90 +++++++++++++++++++++++------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 1ea9729dc2..fa823fd088 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'set relation block size in kB')
+ description: 'Set relation block size in kB')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -25,7 +25,7 @@ option('krb_srvnam', type : 'string', value : 'postgres',
description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
- description: 'use system time zone data in specified directory')
+ description: 'Use system time zone data in specified directory')
# Defaults
@@ -38,7 +38,7 @@ option('pgport', type : 'integer', value : 5432,
# Developer options
option('cassert', type : 'boolean', value: false,
- description: 'enable assertion checks (for debugging)')
+ description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
description : 'Whether to enable tap tests')
@@ -47,43 +47,43 @@ option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'whether to use atomic operations')
+ description: 'Whether to use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'whether to use spinlocks')
+ description: 'Whether to use spinlocks')
# Compilation options
option('extra_include_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for headers')
+ description: 'Non-default directories to be searched for headers')
option('extra_lib_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for libs')
+ description: 'Non-default directories to be searched for libs')
option('extra_version', type : 'string', value: '',
- description: 'append STRING to the PostgreSQL version number')
+ description: 'Append STRING to the PostgreSQL version number')
option('darwin_sysroot', type : 'string', value: '',
- description: 'select a non-default sysroot path')
+ description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'whether to embed shared library search path in executables')
+ description: 'Whether to embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'build with Bonjour support')
+ description: 'Build with Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'build with BSD Authentication support')
+ description: 'Build with BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
- description: 'documentation in HTML and man page format')
+ description: 'Documentation in HTML and man page format')
option('docs_pdf', type : 'feature', value: 'auto',
- description: 'documentation in PDF format')
+ description: 'Documentation in PDF format')
option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
@@ -110,102 +110,102 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'whether to use llvm')
+ description: 'Whether to use llvm')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
- description: 'native language support')
+ description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'build with PAM support')
+ description: 'Build with PAM support')
option('plperl', type : 'feature', value: 'auto',
- description: 'build Perl modules (PL/Perl)')
+ description: 'Build Perl modules (PL/Perl)')
option('plpython', type : 'feature', value: 'auto',
- description: 'build Python modules (PL/Python)')
+ description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'build with TCL support')
+ description: 'Build with TCL support')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'specify TCL version')
+ description: 'Specify TCL version')
option('readline', type : 'feature', value : 'auto',
- description: 'use GNU Readline or BSD Libedit for editing')
+ description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'build with SELinux support')
+ description: 'Build with SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
- description: 'use LIB for SSL/TLS support (openssl)')
+ description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'build with systemd support')
+ description: 'Build with systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'build contrib/uuid-ossp using LIB')
+ description: 'Build contrib/uuid-ossp using LIB')
option('zlib', type : 'feature', value: 'auto',
- description: 'whether to use zlib')
+ description: 'Whether to use zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'whether to use zstd')
+ description: 'Whether to use zstd')
# Programs
option('BISON', type : 'array', value: ['bison', 'win_bison'],
- description: 'path to bison binary')
+ description: 'Path to bison binary')
option('DTRACE', type : 'string', value: 'dtrace',
- description: 'path to dtrace binary')
+ description: 'Path to dtrace binary')
option('FLEX', type : 'array', value: ['flex', 'win_flex'],
- description: 'path to flex binary')
+ description: 'Path to flex binary')
option('FOP', type : 'string', value: 'fop',
- description: 'path to fop binary')
+ description: 'Path to fop binary')
option('GZIP', type : 'string', value: 'gzip',
- description: 'path to gzip binary')
+ description: 'Path to gzip binary')
option('LZ4', type : 'string', value: 'lz4',
- description: 'path to lz4 binary')
+ description: 'Path to lz4 binary')
option('OPENSSL', type : 'string', value: 'openssl',
- description: 'path to openssl binary')
+ description: 'Path to openssl binary')
option('PERL', type : 'string', value: 'perl',
- description: 'path to perl binary')
+ description: 'Path to perl binary')
option('PROVE', type : 'string', value: 'prove',
- description: 'path to prove binary')
+ description: 'Path to prove binary')
option('PYTHON', type : 'array', value: ['python3', 'python'],
- description: 'path to python binary')
+ description: 'Path to python binary')
option('SED', type : 'string', value: 'gsed',
- description: 'path to sed binary')
+ description: 'Path to sed binary')
option('STRIP', type : 'string', value: 'strip',
- description: 'path to strip binary, used for PGXS emulation')
+ description: 'Path to strip binary, used for PGXS emulation')
option('TAR', type : 'string', value: 'tar',
- description: 'path to tar binary')
+ description: 'Path to tar binary')
option('XMLLINT', type : 'string', value: 'xmllint',
- description: 'path to xmllint binary')
+ description: 'Path to xmllint binary')
option('XSLTPROC', type : 'string', value: 'xsltproc',
- description: 'path to xsltproc binary')
+ description: 'Path to xsltproc binary')
option('ZSTD', type : 'string', value: 'zstd',
- description: 'path to zstd binary')
+ description: 'Path to zstd binary')
option('ZIC', type : 'string', value: 'zic',
- description: 'path to zic binary, when cross-compiling')
+ description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v2-0003-Use-consistent-Meson-option-description-formats.patchtext/x-patch; charset=utf-8; name=v2-0003-Use-consistent-Meson-option-description-formats.patchDownload
From 0d6ae9591b493d558479f4b6e7e7423a84f2b4aa Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:11:14 -0500
Subject: [PATCH v2 03/17] Use consistent Meson option description formats
---
meson_options.txt | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index fa823fd088..bdc6735332 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'Set relation block size in kB')
+ description: 'Relation block size, in kilobytes')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -41,16 +41,16 @@ option('cassert', type : 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
- description : 'Whether to enable tap tests')
+ description : 'Enable tap tests')
option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'Whether to use atomic operations')
+ description: 'Use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'Whether to use spinlocks')
+ description: 'Use spinlocks')
# Compilation options
@@ -68,16 +68,16 @@ option('darwin_sysroot', type : 'string', value: '',
description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'Whether to embed shared library search path in executables')
+ description: 'Embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'Build with Bonjour support')
+ description: 'Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'Build with BSD Authentication support')
+ description: 'BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
@@ -110,7 +110,7 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'Whether to use llvm')
+ description: 'LLVM support')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
@@ -119,7 +119,7 @@ option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'Build with PAM support')
+ description: 'PAM support')
option('plperl', type : 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
@@ -128,33 +128,33 @@ option('plpython', type : 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'Build with TCL support')
+ description: 'Build with TCL support (PL/TCL)')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'Specify TCL version')
+ description: 'TCL version')
option('readline', type : 'feature', value : 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'Build with SELinux support')
+ description: 'SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'Build with systemd support')
+ description: 'systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'Build contrib/uuid-ossp using LIB')
+ description: 'Use LIB for contrib/uuid-ossp support')
option('zlib', type : 'feature', value: 'auto',
- description: 'Whether to use zlib')
+ description: 'Enable zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'Whether to use zstd')
+ description: 'Enable zstd')
# Programs
--
Tristan Partin
Neon (https://neon.tech)
v2-0004-Attach-colon-to-keyword-argument.patchtext/x-patch; charset=utf-8; name=v2-0004-Attach-colon-to-keyword-argument.patchDownload
From 09361494f3a4828d995f8f5d0e201cfd28ff2690 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:28:48 -0500
Subject: [PATCH v2 04/17] Attach colon to keyword argument
This matches the style found in the rest of the Meson build description.
---
meson_options.txt | 138 +++++++++++++++++++++++-----------------------
1 file changed, 69 insertions(+), 69 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index bdc6735332..e9ac70766a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,27 +2,27 @@
# Data layout influencing options
-option('blocksize', type : 'combo',
- choices : ['1', '2', '4', '8', '16', '32'],
- value : '8',
+option('blocksize', type: 'combo',
+ choices: ['1', '2', '4', '8', '16', '32'],
+ value: '8',
description: 'Relation block size, in kilobytes')
-option('wal_blocksize', type : 'combo',
+option('wal_blocksize', type: 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : 'WAL block size, in kilobytes')
+ description: 'WAL block size, in kilobytes')
-option('segsize', type : 'integer', value : 1,
- description : 'Segment size, in gigabytes')
+option('segsize', type: 'integer', value: 1,
+ description: 'Segment size, in gigabytes')
-option('segsize_blocks', type : 'integer', value: 0,
- description : 'Segment size, in blocks')
+option('segsize_blocks', type: 'integer', value: 0,
+ description: 'Segment size, in blocks')
# Miscellaneous options
-option('krb_srvnam', type : 'string', value : 'postgres',
- description : 'Default Kerberos service principal for GSSAPI')
+option('krb_srvnam', type: 'string', value: 'postgres',
+ description: 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'Use system time zone data in specified directory')
@@ -30,182 +30,182 @@ option('system_tzdata', type: 'string', value: '',
# Defaults
-option('pgport', type : 'integer', value : 5432,
+option('pgport', type: 'integer', value: 5432,
min: 1, max: 65535,
- description : 'Default port number for server and clients')
+ description: 'Default port number for server and clients')
# Developer options
-option('cassert', type : 'boolean', value: false,
+option('cassert', type: 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
-option('tap_tests', type : 'feature', value : 'auto',
- description : 'Enable tap tests')
+option('tap_tests', type: 'feature', value: 'auto',
+ description: 'Enable tap tests')
-option('PG_TEST_EXTRA', type : 'string', value: '',
+option('PG_TEST_EXTRA', type: 'string', value: '',
description: 'Enable selected extra tests')
-option('atomics', type : 'boolean', value: true,
+option('atomics', type: 'boolean', value: true,
description: 'Use atomic operations')
-option('spinlocks', type : 'boolean', value: true,
+option('spinlocks', type: 'boolean', value: true,
description: 'Use spinlocks')
# Compilation options
-option('extra_include_dirs', type : 'array', value: [],
+option('extra_include_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for headers')
-option('extra_lib_dirs', type : 'array', value: [],
+option('extra_lib_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for libs')
-option('extra_version', type : 'string', value: '',
+option('extra_version', type: 'string', value: '',
description: 'Append STRING to the PostgreSQL version number')
-option('darwin_sysroot', type : 'string', value: '',
+option('darwin_sysroot', type: 'string', value: '',
description: 'Select a non-default sysroot path')
-option('rpath', type : 'boolean', value: true,
+option('rpath', type: 'boolean', value: true,
description: 'Embed shared library search path in executables')
# External dependencies
-option('bonjour', type : 'feature', value: 'auto',
+option('bonjour', type: 'feature', value: 'auto',
description: 'Bonjour support')
-option('bsd_auth', type : 'feature', value: 'auto',
+option('bsd_auth', type: 'feature', value: 'auto',
description: 'BSD Authentication support')
-option('docs', type : 'feature', value: 'auto',
+option('docs', type: 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
-option('docs_pdf', type : 'feature', value: 'auto',
+option('docs_pdf', type: 'feature', value: 'auto',
description: 'Documentation in PDF format')
-option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
+option('docs_html_style', type: 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
-option('dtrace', type : 'feature', value: 'disabled',
+option('dtrace', type: 'feature', value: 'disabled',
description: 'DTrace support')
-option('gssapi', type : 'feature', value: 'auto',
+option('gssapi', type: 'feature', value: 'auto',
description: 'GSSAPI support')
-option('icu', type : 'feature', value: 'auto',
+option('icu', type: 'feature', value: 'auto',
description: 'ICU support')
-option('ldap', type : 'feature', value: 'auto',
+option('ldap', type: 'feature', value: 'auto',
description: 'LDAP support')
-option('libedit_preferred', type : 'boolean', value: false,
+option('libedit_preferred', type: 'boolean', value: false,
description: 'Prefer BSD Libedit over GNU Readline')
-option('libxml', type : 'feature', value: 'auto',
+option('libxml', type: 'feature', value: 'auto',
description: 'XML support')
-option('libxslt', type : 'feature', value: 'auto',
+option('libxslt', type: 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
-option('llvm', type : 'feature', value: 'disabled',
+option('llvm', type: 'feature', value: 'disabled',
description: 'LLVM support')
-option('lz4', type : 'feature', value: 'auto',
+option('lz4', type: 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
-option('pam', type : 'feature', value: 'auto',
+option('pam', type: 'feature', value: 'auto',
description: 'PAM support')
-option('plperl', type : 'feature', value: 'auto',
+option('plperl', type: 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
-option('plpython', type : 'feature', value: 'auto',
+option('plpython', type: 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
-option('pltcl', type : 'feature', value: 'auto',
+option('pltcl', type: 'feature', value: 'auto',
description: 'Build with TCL support (PL/TCL)')
-option('tcl_version', type : 'string', value : 'tcl',
+option('tcl_version', type: 'string', value: 'tcl',
description: 'TCL version')
-option('readline', type : 'feature', value : 'auto',
+option('readline', type: 'feature', value: 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
-option('selinux', type : 'feature', value : 'disabled',
+option('selinux', type: 'feature', value: 'disabled',
description: 'SELinux support')
-option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
- value : 'auto',
+option('ssl', type: 'combo', choices: ['auto', 'none', 'openssl'],
+ value: 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
-option('systemd', type : 'feature', value: 'auto',
+option('systemd', type: 'feature', value: 'auto',
description: 'systemd support')
-option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
- value : 'none',
+option('uuid', type: 'combo', choices: ['none', 'bsd', 'e2fs', 'ossp'],
+ value: 'none',
description: 'Use LIB for contrib/uuid-ossp support')
-option('zlib', type : 'feature', value: 'auto',
+option('zlib', type: 'feature', value: 'auto',
description: 'Enable zlib')
-option('zstd', type : 'feature', value: 'auto',
+option('zstd', type: 'feature', value: 'auto',
description: 'Enable zstd')
# Programs
-option('BISON', type : 'array', value: ['bison', 'win_bison'],
+option('BISON', type: 'array', value: ['bison', 'win_bison'],
description: 'Path to bison binary')
-option('DTRACE', type : 'string', value: 'dtrace',
+option('DTRACE', type: 'string', value: 'dtrace',
description: 'Path to dtrace binary')
-option('FLEX', type : 'array', value: ['flex', 'win_flex'],
+option('FLEX', type: 'array', value: ['flex', 'win_flex'],
description: 'Path to flex binary')
-option('FOP', type : 'string', value: 'fop',
+option('FOP', type: 'string', value: 'fop',
description: 'Path to fop binary')
-option('GZIP', type : 'string', value: 'gzip',
+option('GZIP', type: 'string', value: 'gzip',
description: 'Path to gzip binary')
-option('LZ4', type : 'string', value: 'lz4',
+option('LZ4', type: 'string', value: 'lz4',
description: 'Path to lz4 binary')
-option('OPENSSL', type : 'string', value: 'openssl',
+option('OPENSSL', type: 'string', value: 'openssl',
description: 'Path to openssl binary')
-option('PERL', type : 'string', value: 'perl',
+option('PERL', type: 'string', value: 'perl',
description: 'Path to perl binary')
-option('PROVE', type : 'string', value: 'prove',
+option('PROVE', type: 'string', value: 'prove',
description: 'Path to prove binary')
-option('PYTHON', type : 'array', value: ['python3', 'python'],
+option('PYTHON', type: 'array', value: ['python3', 'python'],
description: 'Path to python binary')
-option('SED', type : 'string', value: 'gsed',
+option('SED', type: 'string', value: 'gsed',
description: 'Path to sed binary')
-option('STRIP', type : 'string', value: 'strip',
+option('STRIP', type: 'string', value: 'strip',
description: 'Path to strip binary, used for PGXS emulation')
-option('TAR', type : 'string', value: 'tar',
+option('TAR', type: 'string', value: 'tar',
description: 'Path to tar binary')
-option('XMLLINT', type : 'string', value: 'xmllint',
+option('XMLLINT', type: 'string', value: 'xmllint',
description: 'Path to xmllint binary')
-option('XSLTPROC', type : 'string', value: 'xsltproc',
+option('XSLTPROC', type: 'string', value: 'xsltproc',
description: 'Path to xsltproc binary')
-option('ZSTD', type : 'string', value: 'zstd',
+option('ZSTD', type: 'string', value: 'zstd',
description: 'Path to zstd binary')
-option('ZIC', type : 'string', value: 'zic',
+option('ZIC', type: 'string', value: 'zic',
description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v2-0005-Use-the-not_found_dep-constant.patchtext/x-patch; charset=utf-8; name=v2-0005-Use-the-not_found_dep-constant.patchDownload
From e92e44e1699987730acdfe10bc5c6e6f64d4ce7e Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:33:12 -0500
Subject: [PATCH v2 05/17] Use the not_found_dep constant
Previously in the build description, a not_found_dep was defined. Make
use of it.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 16b2e86646..f608eaed30 100644
--- a/meson.build
+++ b/meson.build
@@ -558,7 +558,7 @@ endif
###############################################################
bonjouropt = get_option('bonjour')
-bonjour = dependency('', required : false)
+bonjour = not_found_dep
if cc.check_header('dns_sd.h', required: bonjouropt,
args: test_c_args, include_directories: postgres_inc) and \
cc.has_function('DNSServiceRegister',
--
Tristan Partin
Neon (https://neon.tech)
v2-0006-Remove-old-comment.patchtext/x-patch; charset=utf-8; name=v2-0006-Remove-old-comment.patchDownload
From d64130b2d3ac760de94fc8854b55331012b5f0f3 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:19:46 -0500
Subject: [PATCH v2 06/17] Remove old comment
That portion of code is not run in the Windows case already given the
structure of the surrounding if statement.
---
meson.build | 2 --
1 file changed, 2 deletions(-)
diff --git a/meson.build b/meson.build
index f608eaed30..42797694f0 100644
--- a/meson.build
+++ b/meson.build
@@ -722,8 +722,6 @@ choke me
endif
endif
- # XXX: this shouldn't be tested in the windows case, but should be tested in
- # the dependency() success case
if ldap.found() and cc.has_function('ldap_initialize',
dependencies: ldap, args: test_c_args)
cdata.set('HAVE_LDAP_INITIALIZE', 1)
--
Tristan Partin
Neon (https://neon.tech)
v2-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchtext/x-patch; charset=utf-8; name=v2-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchDownload
From 2af9455931aca3c50911e65b9cd61b3d75ed5770 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:27:06 -0500
Subject: [PATCH v2 07/17] Tie adding C++ support to the llvm Meson option
In the event the llvm option is defined to be 'auto', it is possible
that the host machine might not have a C++ compiler. If that is the
case, then we shouldn't continue reaching for the llvm dependency.
---
meson.build | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 42797694f0..f18032a66c 100644
--- a/meson.build
+++ b/meson.build
@@ -742,8 +742,8 @@ endif
###############################################################
llvmopt = get_option('llvm')
-if not llvmopt.disabled()
- add_languages('cpp', required: true, native: false)
+llvm = not_found_dep
+if add_languages('cpp', required: llvmopt, native: false)
llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
if llvm.found()
@@ -757,8 +757,6 @@ if not llvmopt.disabled()
ccache = find_program('ccache', native: true, required: false)
clang = find_program(llvm_binpath / 'clang', required: true)
endif
-else
- llvm = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v2-0008-Mention-the-correct-way-to-disable-readline-suppo.patchtext/x-patch; charset=utf-8; name=v2-0008-Mention-the-correct-way-to-disable-readline-suppo.patchDownload
From 6960bfe9b569eefadca8f190b9a172d6cfdfcee3 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 10:27:34 -0500
Subject: [PATCH v2 08/17] Mention the correct way to disable readline support
Using false to disable a feature option is incorrect.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index f18032a66c..061a74b83e 100644
--- a/meson.build
+++ b/meson.build
@@ -1129,7 +1129,7 @@ if not get_option('readline').disabled()
error('''readline header not found
If you have @0@ already installed, see meson-log/meson-log.txt for details on the
failure. It is possible the compiler isn't looking in the proper directory.
-Use -Dreadline=false to disable readline support.'''.format(readline_dep))
+Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
endif
check_funcs = [
--
Tristan Partin
Neon (https://neon.tech)
v2-0009-Remove-return-code-check.patchtext/x-patch; charset=utf-8; name=v2-0009-Remove-return-code-check.patchDownload
From 7b78f9d757c82c6b4f966022cdcdc8f30a95e674 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:30:54 -0500
Subject: [PATCH v2 09/17] Remove return code check
run_command(check: true) will already handle this.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 061a74b83e..a81aaeb8aa 100644
--- a/meson.build
+++ b/meson.build
@@ -385,7 +385,7 @@ install_files = files('src/tools/install_files')
# https://github.com/mesonbuild/meson/issues/8511
meson_binpath_r = run_command(python, 'src/tools/find_meson', check: true)
-if meson_binpath_r.returncode() != 0 or meson_binpath_r.stdout() == ''
+if meson_binpath_r.stdout() == ''
error('huh, could not run find_meson.\nerrcode: @0@\nstdout: @1@\nstderr: @2@'.format(
meson_binpath_r.returncode(),
meson_binpath_r.stdout(),
--
Tristan Partin
Neon (https://neon.tech)
v2-0010-Fix-some-grammar-usage-in-Meson-comments.patchtext/x-patch; charset=utf-8; name=v2-0010-Fix-some-grammar-usage-in-Meson-comments.patchDownload
From 2f7c550b1ed6cdd538a29acb082abd32b1f59503 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:33:18 -0500
Subject: [PATCH v2 10/17] Fix some grammar usage in Meson comments
---
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index a81aaeb8aa..0ab31b3424 100644
--- a/meson.build
+++ b/meson.build
@@ -150,7 +150,7 @@ cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
cdata.set('PG_MAJORVERSION_NUM', pg_version_major)
cdata.set('PG_MINORVERSION_NUM', pg_version_minor)
cdata.set('PG_VERSION_NUM', pg_version_num)
-# PG_VERSION_STR is built later, it depends compiler test results
+# PG_VERSION_STR is built later, it depends on compiler test results
cdata.set_quoted('CONFIGURE_ARGS', '')
@@ -1672,7 +1672,7 @@ if cc.has_function_attribute('visibility:default') and \
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
- # inlineshidden to C code as well... Any either way, we want to put these
+ # inlineshidden to C code as well... And either way, we want to put these
# flags into exported files (pgxs, .pc files).
cflags_mod += '-fvisibility=hidden'
cxxflags_mod += ['-fvisibility=hidden', '-fvisibility-inlines-hidden']
--
Tristan Partin
Neon (https://neon.tech)
v2-0011-Pass-feature-option-through-to-required-kwarg.patchtext/x-patch; charset=utf-8; name=v2-0011-Pass-feature-option-through-to-required-kwarg.patchDownload
From 841f6345c7bec3b8daa0bc2acdb09cd3de06dc41 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:38:09 -0500
Subject: [PATCH v2 11/17] Pass feature option through to required kwarg
Meson understands this already. No need to convert it to a boolean.
---
meson.build | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 0ab31b3424..188dd81243 100644
--- a/meson.build
+++ b/meson.build
@@ -767,8 +767,8 @@ endif
icuopt = get_option('icu')
if not icuopt.disabled()
- icu = dependency('icu-uc', required: icuopt.enabled())
- icu_i18n = dependency('icu-i18n', required: icuopt.enabled())
+ icu = dependency('icu-uc', required: icuopt)
+ icu_i18n = dependency('icu-i18n', required: icuopt)
if icu.found()
cdata.set('USE_ICU', 1)
@@ -1077,7 +1077,7 @@ if not get_option('readline').disabled()
readline = dependency(readline_dep, required: false)
if not readline.found()
readline = cc.find_library(readline_dep,
- required: get_option('readline').enabled(),
+ required: get_option('readline'),
dirs: test_lib_d)
endif
if readline.found()
@@ -2537,7 +2537,7 @@ if not nlsopt.disabled()
# otherwise there'd be lots of
# "Gettext not found, all translation (po) targets will be ignored."
# warnings if not found.
- msgfmt = find_program('msgfmt', required: nlsopt.enabled(), native: true)
+ msgfmt = find_program('msgfmt', required: nlsopt, native: true)
# meson 0.59 has this wrapped in dependency('int')
if (msgfmt.found() and
--
Tristan Partin
Neon (https://neon.tech)
v2-0012-Make-finding-pkg-config-python3-more-robust.patchtext/x-patch; charset=utf-8; name=v2-0012-Make-finding-pkg-config-python3-more-robust.patchDownload
From 5409d4c64c42704d929e895dcf69f1b99597b128 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH v2 12/17] Make finding pkg-config(python3) more robust
It is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.
https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/python.py#L218
---
meson.build | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 188dd81243..7f6cad1908 100644
--- a/meson.build
+++ b/meson.build
@@ -1050,15 +1050,17 @@ endif
###############################################################
pyopt = get_option('plpython')
+python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
- python3_dep = not_found_dep
+ python3_inst = pm.find_installation(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
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
+ python3_dep = not_found_dep
+ endif
endif
-else
- python3_dep = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v2-0013-Make-some-Meson-style-more-consistent-with-surrou.patchtext/x-patch; charset=utf-8; name=v2-0013-Make-some-Meson-style-more-consistent-with-surrou.patchDownload
From 80019f2d4b3f55ee1e911817d7c5e018ca184060 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:43:51 -0500
Subject: [PATCH v2 13/17] Make some Meson style more consistent with
surrounding code
---
meson.build | 17 ++++++++---------
src/include/meson.build | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/meson.build b/meson.build
index 7f6cad1908..79b6aa47ec 100644
--- a/meson.build
+++ b/meson.build
@@ -1146,7 +1146,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
foreach func : check_funcs
found = cc.has_function(func, dependencies: [readline],
args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_'+func.to_upper(), found ? 1 : false)
+ cdata.set('HAVE_' + func.to_upper(), found ? 1 : false)
endforeach
check_vars = [
@@ -1156,7 +1156,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
]
foreach var : check_vars
- cdata.set('HAVE_'+var.to_upper(),
+ cdata.set('HAVE_' + var.to_upper(),
cc.has_header_symbol(readline_h, var,
args: test_c_args, include_directories: postgres_inc,
prefix: '#include <stdio.h>',
@@ -1311,7 +1311,7 @@ if sslopt in ['auto', 'openssl']
cdata.set('USE_OPENSSL', 1,
description: 'Define to 1 to build with OpenSSL support. (-Dssl=openssl)')
cdata.set('OPENSSL_API_COMPAT', '0x10001000L',
- description: '''Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.''')
+ description: 'Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.')
ssl_library = 'openssl'
else
ssl = not_found_dep
@@ -1599,8 +1599,7 @@ if cc.links('''
if not buggy_int128
cdata.set('PG_INT128_TYPE', '__int128')
- cdata.set('ALIGNOF_PG_INT128_TYPE', cc.
- alignment('__int128', args: test_c_args))
+ cdata.set('ALIGNOF_PG_INT128_TYPE', cc.alignment('__int128', args: test_c_args))
endif
endif
@@ -1642,8 +1641,8 @@ endif
# We use <stdbool.h> if we have it and it declares type bool as having
# size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
if cc.has_type('_Bool', args: test_c_args) \
- and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
- and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
+ and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
+ and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
cdata.set('HAVE__BOOL', 1)
cdata.set('PG_USE_STDBOOL', 1)
endif
@@ -1670,7 +1669,7 @@ endforeach
if cc.has_function_attribute('visibility:default') and \
- cc.has_function_attribute('visibility:hidden')
+ cc.has_function_attribute('visibility:hidden')
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
@@ -3032,7 +3031,7 @@ meson_install_args = meson_args + ['install'] + {
'muon': []
}[meson_impl]
-# setup tests should be run first,
+# setup tests should be run first,
# so define priority for these
setup_tests_priority = 100
test('tmp_install',
diff --git a/src/include/meson.build b/src/include/meson.build
index 33c0a5562c..d7e1ecd4c9 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -89,7 +89,7 @@ install_headers(
'c.h',
'port.h',
'postgres_fe.h',
- install_dir: dir_include_internal
+ install_dir: dir_include_internal,
)
install_headers(
--
Tristan Partin
Neon (https://neon.tech)
v2-0014-Reduce-branching-on-Meson-version.patchtext/x-patch; charset=utf-8; name=v2-0014-Reduce-branching-on-Meson-version.patchDownload
From eccd941850e3e2ebdbf929cc1b1a573d1c4457cd Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:44:49 -0500
Subject: [PATCH v2 14/17] Reduce branching on Meson version
This code had a branch depending on Meson version. Instead, we can just
move the system checks to the if statement. I believe this also keeps
selinux and systemd from being looked for on non-Linux systems when
using Meson < 0.59. Before they would be checked, but obviously fail.
---
meson.build | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/meson.build b/meson.build
index 79b6aa47ec..4f13896473 100644
--- a/meson.build
+++ b/meson.build
@@ -1191,13 +1191,10 @@ endif
###############################################################
selinux = not_found_dep
-selinuxopt = get_option('selinux')
-if meson.version().version_compare('>=0.59')
- selinuxopt = selinuxopt.disable_auto_if(host_system != 'linux')
+if host_system == 'linux'
+ selinux = dependency('libselinux', required: get_option('selinux'), version: '>= 2.1.10')
+ cdata.set('HAVE_LIBSELINUX', selinux.found() ? 1 : false)
endif
-selinux = dependency('libselinux', required: selinuxopt, version: '>= 2.1.10')
-cdata.set('HAVE_LIBSELINUX',
- selinux.found() ? 1 : false)
@@ -1206,12 +1203,10 @@ cdata.set('HAVE_LIBSELINUX',
###############################################################
systemd = not_found_dep
-systemdopt = get_option('systemd')
-if meson.version().version_compare('>=0.59')
- systemdopt = systemdopt.disable_auto_if(host_system != 'linux')
+if host_system == 'linux'
+ systemd = dependency('libsystemd', required: get_option('systemd'))
+ cdata.set('USE_SYSTEMD', systemd.found() ? 1 : false)
endif
-systemd = dependency('libsystemd', required: systemdopt)
-cdata.set('USE_SYSTEMD', systemd.found() ? 1 : false)
--
Tristan Partin
Neon (https://neon.tech)
v2-0015-Use-a-better-error-message-in-an-impossible-case.patchtext/x-patch; charset=utf-8; name=v2-0015-Use-a-better-error-message-in-an-impossible-case.patchDownload
From c3f8e7e1fc5760292c03dfa4d4b0d91c86c27d66 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:48:18 -0500
Subject: [PATCH v2 15/17] Use a better error message in an impossible case
Meson validates 'choice' options for us, so technically this case is
impossible. A better error message helps people reading the code
understand what is going on in that branch.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 4f13896473..dd559fa587 100644
--- a/meson.build
+++ b/meson.build
@@ -1341,7 +1341,7 @@ if uuidopt != 'none'
uuidfunc = 'uuid_export'
uuidheader = 'uuid.h'
else
- error('huh')
+ error('unknown uuid build option value: @0@'.format(uuidopt))
endif
if not cc.has_header_symbol(uuidheader, uuidfunc, args: test_c_args, dependencies: uuid)
--
Tristan Partin
Neon (https://neon.tech)
v2-0016-Add-Meson-overrides.patchtext/x-patch; charset=utf-8; name=v2-0016-Add-Meson-overrides.patchDownload
From be4f22cd3c2bed3d288634df77333ed9646989da Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH v2 16/17] Add Meson overrides
Meson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:
[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1
[provide]
dependency_names = libpq
Then in my extension (root project), I can have the following line
snippet:
libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.
I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:
program_names = initdb, postgres, ...
Then in my extension (root project), I can find them with the following
line:
initdb = find_program('initdb')
Again, initdb will be compiled transparently as my extension gets built
if and only if initdb isn't found on the host system.
---
src/backend/meson.build | 2 ++
src/bin/initdb/meson.build | 2 ++
src/bin/pg_amcheck/meson.build | 2 ++
src/bin/pg_archivecleanup/meson.build | 2 ++
src/bin/pg_basebackup/meson.build | 6 ++++++
src/bin/pg_checksums/meson.build | 2 ++
src/bin/pg_config/meson.build | 2 ++
src/bin/pg_controldata/meson.build | 2 ++
src/bin/pg_ctl/meson.build | 2 ++
src/bin/pg_dump/meson.build | 6 ++++++
src/bin/pg_resetwal/meson.build | 2 ++
src/bin/pg_rewind/meson.build | 2 ++
src/bin/pg_test_fsync/meson.build | 2 ++
src/bin/pg_test_timing/meson.build | 2 ++
src/bin/pg_upgrade/meson.build | 2 ++
src/bin/pg_verifybackup/meson.build | 2 ++
src/bin/pg_waldump/meson.build | 2 ++
src/bin/pgbench/meson.build | 2 ++
src/bin/psql/meson.build | 2 ++
src/bin/scripts/meson.build | 6 ++++--
src/interfaces/ecpg/preproc/meson.build | 2 ++
src/interfaces/libpq/meson.build | 2 ++
22 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/src/backend/meson.build b/src/backend/meson.build
index ccfc382fcf..ac2f66d920 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -147,6 +147,8 @@ postgres = executable('postgres',
backend_targets += postgres
+meson.override_find_program('postgres', postgres)
+
pg_mod_c_args = cflags_mod
pg_mod_cpp_args = cxxflags_mod
pg_mod_link_args = ldflags_sl + ldflags_mod
diff --git a/src/bin/initdb/meson.build b/src/bin/initdb/meson.build
index 49743630aa..12b4918e8b 100644
--- a/src/bin/initdb/meson.build
+++ b/src/bin/initdb/meson.build
@@ -23,6 +23,8 @@ initdb = executable('initdb',
)
bin_targets += initdb
+meson.override_find_program('initdb', initdb)
+
tests += {
'name': 'initdb',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_amcheck/meson.build b/src/bin/pg_amcheck/meson.build
index 2ade5aba03..8694abbf07 100644
--- a/src/bin/pg_amcheck/meson.build
+++ b/src/bin/pg_amcheck/meson.build
@@ -17,6 +17,8 @@ pg_amcheck = executable('pg_amcheck',
)
bin_targets += pg_amcheck
+meson.override_find_program('pg_amcheck', pg_amcheck)
+
tests += {
'name': 'pg_amcheck',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_archivecleanup/meson.build b/src/bin/pg_archivecleanup/meson.build
index 28349db58b..6eecb42b05 100644
--- a/src/bin/pg_archivecleanup/meson.build
+++ b/src/bin/pg_archivecleanup/meson.build
@@ -17,6 +17,8 @@ pg_archivecleanup = executable('pg_archivecleanup',
)
bin_targets += pg_archivecleanup
+meson.override_find_program('pg_archivecleanup', pg_archivecleanup)
+
tests += {
'name': 'pg_archivecleanup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build
index c684622bfb..589c664163 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -37,6 +37,8 @@ pg_basebackup = executable('pg_basebackup',
)
bin_targets += pg_basebackup
+meson.override_find_program('pg_basebackup', pg_basebackup)
+
pg_receivewal_sources = files(
'pg_receivewal.c',
@@ -56,6 +58,8 @@ pg_receivewal = executable('pg_receivewal',
)
bin_targets += pg_receivewal
+meson.override_find_program('pg_receivewal', pg_receivewal)
+
pg_recvlogical_sources = files(
'pg_recvlogical.c',
@@ -75,6 +79,8 @@ pg_recvlogical = executable('pg_recvlogical',
)
bin_targets += pg_recvlogical
+meson.override_find_program('pg_recvlogical', pg_recvlogical)
+
tests += {
'name': 'pg_basebackup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_checksums/meson.build b/src/bin/pg_checksums/meson.build
index 5528526094..d54e76ae6c 100644
--- a/src/bin/pg_checksums/meson.build
+++ b/src/bin/pg_checksums/meson.build
@@ -18,6 +18,8 @@ pg_checksums = executable('pg_checksums',
)
bin_targets += pg_checksums
+meson.override_find_program('pg_checksums', pg_checksums)
+
tests += {
'name': 'pg_checksums',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_config/meson.build b/src/bin/pg_config/meson.build
index 7fd7e94e2d..bea966f63e 100644
--- a/src/bin/pg_config/meson.build
+++ b/src/bin/pg_config/meson.build
@@ -17,6 +17,8 @@ pg_config = executable('pg_config',
)
bin_targets += pg_config
+meson.override_find_program('pg_config', pg_config)
+
tests += {
'name': 'pg_config',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_controldata/meson.build b/src/bin/pg_controldata/meson.build
index 03c9d0ae3e..4521828b1f 100644
--- a/src/bin/pg_controldata/meson.build
+++ b/src/bin/pg_controldata/meson.build
@@ -17,6 +17,8 @@ pg_controldata = executable('pg_controldata',
)
bin_targets += pg_controldata
+meson.override_find_program('pg_controldata', pg_controldata)
+
tests += {
'name': 'pg_controldata',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_ctl/meson.build b/src/bin/pg_ctl/meson.build
index 608a52f9fb..b62519c15f 100644
--- a/src/bin/pg_ctl/meson.build
+++ b/src/bin/pg_ctl/meson.build
@@ -17,6 +17,8 @@ pg_ctl = executable('pg_ctl',
)
bin_targets += pg_ctl
+meson.override_find_program('pg_ctl', pg_ctl)
+
tests += {
'name': 'pg_ctl',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_dump/meson.build b/src/bin/pg_dump/meson.build
index 9d59a106f3..ae89758ef6 100644
--- a/src/bin/pg_dump/meson.build
+++ b/src/bin/pg_dump/meson.build
@@ -45,6 +45,8 @@ pg_dump = executable('pg_dump',
)
bin_targets += pg_dump
+meson.override_find_program('pg_dump', pg_dump)
+
pg_dumpall_sources = files(
'pg_dumpall.c',
@@ -64,6 +66,8 @@ pg_dumpall = executable('pg_dumpall',
)
bin_targets += pg_dumpall
+meson.override_find_program('pg_dumpall', pg_dumpall)
+
pg_restore_sources = files(
'pg_restore.c',
@@ -83,6 +87,8 @@ pg_restore = executable('pg_restore',
)
bin_targets += pg_restore
+meson.override_find_program('pg_restore', pg_restore)
+
tests += {
'name': 'pg_dump',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_resetwal/meson.build b/src/bin/pg_resetwal/meson.build
index 3f08a819bb..e7d4ab3fa5 100644
--- a/src/bin/pg_resetwal/meson.build
+++ b/src/bin/pg_resetwal/meson.build
@@ -17,6 +17,8 @@ pg_resetwal = executable('pg_resetwal',
)
bin_targets += pg_resetwal
+meson.override_find_program('pg_resetwal', pg_resetwal)
+
tests += {
'name': 'pg_resetwal',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_rewind/meson.build b/src/bin/pg_rewind/meson.build
index fd22818be4..23d698d8fd 100644
--- a/src/bin/pg_rewind/meson.build
+++ b/src/bin/pg_rewind/meson.build
@@ -27,6 +27,8 @@ pg_rewind = executable('pg_rewind',
)
bin_targets += pg_rewind
+meson.override_find_program('pg_rewind', pg_rewind)
+
tests += {
'name': 'pg_rewind',
diff --git a/src/bin/pg_test_fsync/meson.build b/src/bin/pg_test_fsync/meson.build
index aaf65c310e..3a03156508 100644
--- a/src/bin/pg_test_fsync/meson.build
+++ b/src/bin/pg_test_fsync/meson.build
@@ -17,6 +17,8 @@ pg_test_fsync = executable('pg_test_fsync',
)
bin_targets += pg_test_fsync
+meson.override_find_program('pg_test_fsync', pg_test_fsync)
+
tests += {
'name': 'pg_test_fsync',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_test_timing/meson.build b/src/bin/pg_test_timing/meson.build
index 02f4a5c641..8a5aa29135 100644
--- a/src/bin/pg_test_timing/meson.build
+++ b/src/bin/pg_test_timing/meson.build
@@ -17,6 +17,8 @@ pg_test_timing = executable('pg_test_timing',
)
bin_targets += pg_test_timing
+meson.override_find_program('pg_test_timing', pg_test_timing)
+
tests += {
'name': 'pg_test_timing',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_upgrade/meson.build b/src/bin/pg_upgrade/meson.build
index 12a97f84e2..3046b3f471 100644
--- a/src/bin/pg_upgrade/meson.build
+++ b/src/bin/pg_upgrade/meson.build
@@ -32,6 +32,8 @@ pg_upgrade = executable('pg_upgrade',
)
bin_targets += pg_upgrade
+meson.override_find_program('pg_upgrade', pg_upgrade)
+
tests += {
'name': 'pg_upgrade',
diff --git a/src/bin/pg_verifybackup/meson.build b/src/bin/pg_verifybackup/meson.build
index 9369da1bc6..5b670fd3e5 100644
--- a/src/bin/pg_verifybackup/meson.build
+++ b/src/bin/pg_verifybackup/meson.build
@@ -18,6 +18,8 @@ pg_verifybackup = executable('pg_verifybackup',
)
bin_targets += pg_verifybackup
+meson.override_find_program('pg_verifybackup', pg_verifybackup)
+
tests += {
'name': 'pg_verifybackup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_waldump/meson.build b/src/bin/pg_waldump/meson.build
index ae674d17c3..c03f212842 100644
--- a/src/bin/pg_waldump/meson.build
+++ b/src/bin/pg_waldump/meson.build
@@ -24,6 +24,8 @@ pg_waldump = executable('pg_waldump',
)
bin_targets += pg_waldump
+meson.override_find_program('pg_waldump', pg_waldump)
+
tests += {
'name': 'pg_waldump',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pgbench/meson.build b/src/bin/pgbench/meson.build
index e3c7619cf4..b8b46ef721 100644
--- a/src/bin/pgbench/meson.build
+++ b/src/bin/pgbench/meson.build
@@ -35,6 +35,8 @@ pgbench = executable('pgbench',
)
bin_targets += pgbench
+meson.override_find_program('pgbench', pgbench)
+
tests += {
'name': 'pgbench',
'sd': meson.current_source_dir(),
diff --git a/src/bin/psql/meson.build b/src/bin/psql/meson.build
index a0a4ac7afb..cf20b3a7a4 100644
--- a/src/bin/psql/meson.build
+++ b/src/bin/psql/meson.build
@@ -53,6 +53,8 @@ psql = executable('psql',
)
bin_targets += psql
+meson.override_find_program('psql', psql)
+
install_data('psqlrc.sample',
install_dir: dir_data,
)
diff --git a/src/bin/scripts/meson.build b/src/bin/scripts/meson.build
index 5b4f8a6f85..fa16814710 100644
--- a/src/bin/scripts/meson.build
+++ b/src/bin/scripts/meson.build
@@ -26,13 +26,15 @@ foreach binary : binaries
'--FILEDESC', '@0@ - PostgreSQL utility'.format(binary),])
endif
- binary = executable(binary,
+ exe = executable(binary,
binary_sources,
link_with: [scripts_common],
dependencies: [frontend_code, libpq],
kwargs: default_bin_args,
)
- bin_targets += binary
+ bin_targets += exe
+
+ meson.override_find_program(binary, exe)
endforeach
tests += {
diff --git a/src/interfaces/ecpg/preproc/meson.build b/src/interfaces/ecpg/preproc/meson.build
index 08d772d261..f7c9f79c81 100644
--- a/src/interfaces/ecpg/preproc/meson.build
+++ b/src/interfaces/ecpg/preproc/meson.build
@@ -110,4 +110,6 @@ ecpg_exe = executable('ecpg',
)
ecpg_targets += ecpg_exe
+meson.override_find_program('ecpg', ecpg_exe)
+
subdir('po', if_found: libintl)
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index 80e6a15adf..6d18970e81 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -84,6 +84,8 @@ libpq = declare_dependency(
include_directories: [include_directories('.')]
)
+meson.override_dependency('libpq', libpq)
+
pkgconfig.generate(
name: 'libpq',
description: 'PostgreSQL libpq library',
--
Tristan Partin
Neon (https://neon.tech)
v2-0017-Remove-Meson-program-options-for-specifying-paths.patchtext/x-patch; charset=utf-8; name=v2-0017-Remove-Meson-program-options-for-specifying-paths.patchDownload
From 673f15e1723d172e502cbfdea2b69699802ec914 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:54:53 -0500
Subject: [PATCH v2 17/17] Remove Meson program options for specifying paths
Meson has a built-in way to override paths without polluting project
build options called machine files.
https://mesonbuild.com/Machine-files.html
To summarize, a replacement for these options would look something like
the following:
[binaries]
bison = 'path/to/bison'
flex = 'path/to/flex'
This tells Meson to use the pre-defined paths for the defined binaries.
This process is very similar for how cross builds are done in Meson too.
To use the native.ini file, all someone compiling Postgres has to do is
pass `--native-file native.ini` to `meson setup`.
---
meson.build | 30 +++++++++++-----------
meson_options.txt | 54 ---------------------------------------
src/makefiles/meson.build | 2 +-
src/timezone/meson.build | 2 +-
4 files changed, 17 insertions(+), 71 deletions(-)
diff --git a/meson.build b/meson.build
index dd559fa587..a9639007d8 100644
--- a/meson.build
+++ b/meson.build
@@ -327,22 +327,22 @@ endif
###############################################################
# External programs
-perl = find_program(get_option('PERL'), required: true, native: true)
-python = find_program(get_option('PYTHON'), required: true, native: true)
-flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.35')
-bison = find_program(get_option('BISON'), native: true, version: '>= 2.3')
-sed = find_program(get_option('SED'), 'sed', native: true)
-prove = find_program(get_option('PROVE'), native: true, required: false)
-tar = find_program(get_option('TAR'), native: true)
-gzip = find_program(get_option('GZIP'), native: true)
-program_lz4 = find_program(get_option('LZ4'), native: true, required: false)
-openssl = find_program(get_option('OPENSSL'), native: true, required: false)
-program_zstd = find_program(get_option('ZSTD'), native: true, required: false)
-dtrace = find_program(get_option('DTRACE'), native: true, required: get_option('dtrace'))
+perl = find_program('perl', required: true, native: true)
+python = find_program('python3', 'python', required: true, native: true)
+flex = find_program('flex', 'win_flex', native: true, version: '>= 2.5.35')
+bison = find_program('bison', 'win_bison', native: true, version: '>= 2.3')
+sed = find_program('sed', native: true)
+prove = find_program('prove', native: true, required: false)
+tar = find_program('tar', native: true)
+gzip = find_program('gzip', native: true)
+program_lz4 = find_program('lz4', native: true, required: false)
+openssl = find_program('openssl', native: true, required: false)
+program_zstd = find_program('zstd', native: true, required: false)
+dtrace = find_program('dtrace', native: true, required: get_option('dtrace'))
missing = find_program('config/missing', native: true)
cp = find_program('cp', required: false, native: true)
-xmllint_bin = find_program(get_option('XMLLINT'), native: true, required: false)
-xsltproc_bin = find_program(get_option('XSLTPROC'), native: true, required: false)
+xmllint_bin = find_program('xmllint', native: true, required: false)
+xsltproc_bin = find_program('xlstproc', native: true, required: false)
bison_flags = []
if bison.found()
@@ -592,7 +592,7 @@ endif
docs_pdf_opt = get_option('docs_pdf')
docs_pdf_dep = not_found_dep
if not docs_pdf_opt.disabled()
- fop = find_program(get_option('FOP'), native: true, required: docs_pdf_opt)
+ fop = find_program('fop', native: true, required: docs_pdf_opt)
if xmllint_bin.found() and xsltproc_bin.found() and fop.found()
docs_pdf_dep = declare_dependency()
elif docs_pdf_opt.enabled()
diff --git a/meson_options.txt b/meson_options.txt
index e9ac70766a..1760cf05f9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -155,57 +155,3 @@ option('zlib', type: 'feature', value: 'auto',
option('zstd', type: 'feature', value: 'auto',
description: 'Enable zstd')
-
-
-# Programs
-
-option('BISON', type: 'array', value: ['bison', 'win_bison'],
- description: 'Path to bison binary')
-
-option('DTRACE', type: 'string', value: 'dtrace',
- description: 'Path to dtrace binary')
-
-option('FLEX', type: 'array', value: ['flex', 'win_flex'],
- description: 'Path to flex binary')
-
-option('FOP', type: 'string', value: 'fop',
- description: 'Path to fop binary')
-
-option('GZIP', type: 'string', value: 'gzip',
- description: 'Path to gzip binary')
-
-option('LZ4', type: 'string', value: 'lz4',
- description: 'Path to lz4 binary')
-
-option('OPENSSL', type: 'string', value: 'openssl',
- description: 'Path to openssl binary')
-
-option('PERL', type: 'string', value: 'perl',
- description: 'Path to perl binary')
-
-option('PROVE', type: 'string', value: 'prove',
- description: 'Path to prove binary')
-
-option('PYTHON', type: 'array', value: ['python3', 'python'],
- description: 'Path to python binary')
-
-option('SED', type: 'string', value: 'gsed',
- description: 'Path to sed binary')
-
-option('STRIP', type: 'string', value: 'strip',
- description: 'Path to strip binary, used for PGXS emulation')
-
-option('TAR', type: 'string', value: 'tar',
- description: 'Path to tar binary')
-
-option('XMLLINT', type: 'string', value: 'xmllint',
- description: 'Path to xmllint binary')
-
-option('XSLTPROC', type: 'string', value: 'xsltproc',
- description: 'Path to xsltproc binary')
-
-option('ZSTD', type: 'string', value: 'zstd',
- description: 'Path to zstd binary')
-
-option('ZIC', type: 'string', value: 'zic',
- description: 'Path to zic binary, when cross-compiling')
diff --git a/src/makefiles/meson.build b/src/makefiles/meson.build
index 13045cbd6e..b8ec848d74 100644
--- a/src/makefiles/meson.build
+++ b/src/makefiles/meson.build
@@ -5,7 +5,7 @@
# Emulation of PGAC_CHECK_STRIP
-strip_bin = find_program(get_option('STRIP'), required: false, native: true)
+strip_bin = find_program('strip', required: false, native: true)
strip_cmd = strip_bin.found() ? [strip_bin.path()] : [':']
working_strip = false
diff --git a/src/timezone/meson.build b/src/timezone/meson.build
index 7b85a01c6b..8f6edb5110 100644
--- a/src/timezone/meson.build
+++ b/src/timezone/meson.build
@@ -28,7 +28,7 @@ if get_option('system_tzdata') == ''
# build our zic. But for that we'd need to run a good chunk of the configure
# tests both natively and cross. Unclear if it's worth it.
if meson.is_cross_build()
- zic = find_program(get_option('ZIC'), native: true, required: true)
+ zic = find_program('zic', native: true, required: true)
else
if host_system == 'windows'
zic_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-05-18 10:36:59 -0500, Tristan Partin wrote:
I took some time to look at the Meson build for Postgres. I contribute
some of the time to Meson, itself. Within this patchset you will find
pretty small changes. Most of the commits are attempting to create more
consistency with the surrounding code. I think there is more that can be
done to improve the build a bit like including subprojects for optional
dependencies like lz4, zstd, etc.
Thanks for looking over these!
From b35ecb2c8dcd71608f98af1e0ec19d965099ceab Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH postgres v1 12/17] Make finding pkg-config(python3) more
robustIt is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.
That's not what I saw - we had cases where Python.h was missing, but the
python dependency was found. It's possible that this is dependent on the
meson version.
From 47394ffd113d4170e955bc033841cb7e18fd3ac4 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:44:49 -0500
Subject: [PATCH postgres v1 14/17] Reduce branching on Meson versionThis code had a branch depending on Meson version. Instead, we can just
move the system checks to the if statement. I believe this also keeps
selinux and systemd from being looked for on non-Linux systems when
using Meson < 0.59. Before they would be checked, but obviously fail.
I like the current version better - depending on the meson version makes it
easy to find what needs to be removed when we upgrade the meson minimum
version.
From 189d3ac3d5593ce3e475813e4830a29bb4e96f70 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH postgres v1 16/17] Add Meson overridesMeson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1[provide]
dependency_names = libpqThen in my extension (root project), I can have the following line
snippet:libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:
I think adding more boilerplate to all these places does have some cost. So
I'm not really convinced this is worth doign.
From 5ee13f09e4101904dbc9887bd4844eb5f1cb4fea Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:54:53 -0500
Subject: [PATCH postgres v1 17/17] Remove Meson program options for specifying
pathsMeson has a built-in way to override paths without polluting project
build options called machine files.
I think meson machine files are just about unusable. For one, you can't
actually change any of the options without creating a new build dir. For
another, it's not something that easily can be done on the commandline.
So I really don't want to remove these options.
Greetings,
Andres Freund
On Fri Jun 9, 2023 at 11:41 AM CDT, Andres Freund wrote:
Hi,
On 2023-05-18 10:36:59 -0500, Tristan Partin wrote:
From b35ecb2c8dcd71608f98af1e0ec19d965099ceab Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH postgres v1 12/17] Make finding pkg-config(python3) more
robustIt is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.That's not what I saw - we had cases where Python.h was missing, but the
python dependency was found. It's possible that this is dependent on the
meson version.
Eli corrected me on this. Please see version 2 of the patchset.
From 47394ffd113d4170e955bc033841cb7e18fd3ac4 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:44:49 -0500
Subject: [PATCH postgres v1 14/17] Reduce branching on Meson versionThis code had a branch depending on Meson version. Instead, we can just
move the system checks to the if statement. I believe this also keeps
selinux and systemd from being looked for on non-Linux systems when
using Meson < 0.59. Before they would be checked, but obviously fail.I like the current version better - depending on the meson version makes it
easy to find what needs to be removed when we upgrade the meson minimum
version.
I think the savings of not looking up selinux/systemd on non-Linux
systems is pretty big. Would you accept a change of something like:
if meson.version().version_compare('>=0.59')
# do old stuff
else if host_system == 'linux'
# do new stuff
endif
Otherwise, I am happy to remove the patch.
From 189d3ac3d5593ce3e475813e4830a29bb4e96f70 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH postgres v1 16/17] Add Meson overridesMeson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1[provide]
dependency_names = libpqThen in my extension (root project), I can have the following line
snippet:libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:I think adding more boilerplate to all these places does have some cost. So
I'm not really convinced this is worth doign.
Could you explain more about what costs you foresee? I thought this was
a pretty free change :). Most of the meson.build files seems to be
pretty much copy/pastes of each other, so if a new executable came
around, then someone would just get the override line for essentially
free, minus changing the binary name/executable name.
From 5ee13f09e4101904dbc9887bd4844eb5f1cb4fea Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:54:53 -0500
Subject: [PATCH postgres v1 17/17] Remove Meson program options for specifying
pathsMeson has a built-in way to override paths without polluting project
build options called machine files.I think meson machine files are just about unusable. For one, you can't
actually change any of the options without creating a new build dir. For
another, it's not something that easily can be done on the commandline.So I really don't want to remove these options.
I felt like this would be the most controversial change. What could be
done in upstream Meson to make this a more enjoyable experience? I do
however disagree with the usability of machine files. Could you add a
little context about what you find unusable about them?
Happy to revert the change after continuing the discussion, of course.
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-06-09 13:15:27 -0500, Tristan Partin wrote:
On Fri Jun 9, 2023 at 11:41 AM CDT, Andres Freund wrote:
I like the current version better - depending on the meson version makes it
easy to find what needs to be removed when we upgrade the meson minimum
version.I think the savings of not looking up selinux/systemd on non-Linux
systems is pretty big. Would you accept a change of something like:
For selinux it's default disabled, so it doesn't make a practical
difference. Outside of linux newer versions of meson are more common IME, so
I'm not really worried about it for systemd.
if meson.version().version_compare('>=0.59')
# do old stuff
else if host_system == 'linux'
# do new stuff
endifOtherwise, I am happy to remove the patch.
Hm, I don't quite know how this would end up looking like.
From 189d3ac3d5593ce3e475813e4830a29bb4e96f70 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH postgres v1 16/17] Add Meson overridesMeson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1[provide]
dependency_names = libpqThen in my extension (root project), I can have the following line
snippet:libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:I think adding more boilerplate to all these places does have some cost. So
I'm not really convinced this is worth doign.Could you explain more about what costs you foresee?
Repetitive code that needs to be added to each further binary we add. I don't
mind doing that if it has a use case, but I'm not sure I see the use case for
random binaries...
From 5ee13f09e4101904dbc9887bd4844eb5f1cb4fea Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:54:53 -0500
Subject: [PATCH postgres v1 17/17] Remove Meson program options for specifying
pathsMeson has a built-in way to override paths without polluting project
build options called machine files.I think meson machine files are just about unusable. For one, you can't
actually change any of the options without creating a new build dir. For
another, it's not something that easily can be done on the commandline.So I really don't want to remove these options.
I felt like this would be the most controversial change. What could be
done in upstream Meson to make this a more enjoyable experience?
I think *requiring* separate files is a really poor experience when you come
from some other system, where those could trivially be overwritten on the
commandline.
The biggest change to make them more usable would be to properly reconfigure
when the contents of machine file change. IIRC configure is rerun, but the
changes aren't taken into account.
I do however disagree with the usability of machine files. Could you add a
little context about what you find unusable about them?
I can quickly change a meson option and run a build and tests. Trivially
scriptable. Whereas with a machine file I need to write code to edit a machine
file, re-configure from scratch, and only then can build / run tests.
It's particularly bad for cross builds, where unfortunately cross files can't
be avoided. It's imo the one area where autoconf beats meson handily.
--host=x86_64-w64-mingw32 works for autoconf. Whereas for meson I need to
manually write a cross file with a bunch of binaries set.
https://github.com/anarazel/postgres/commit/ae53f21d06b4dadf8e6b90df84000fad9a769eaf#diff-3420ebab4f1dbe2ba7102565b0b84e4d6d01fb8b3c1e375bd439eed604e743f8R1
There's some helpers aiming to generate cross files, but I've not been able to
generate something useful for cross compiling to windows, for example.
I've been unable to generate something like referenced in the above commit in
a reasonably concise way with env2mfile.
In the end, I also just don't see a meaningful benefit in forcing the use of
machine files.
Greetings,
Andres Freund
On Fri Jun 9, 2023 at 1:36 PM CDT, Andres Freund wrote:
Hi,
On 2023-06-09 13:15:27 -0500, Tristan Partin wrote:
On Fri Jun 9, 2023 at 11:41 AM CDT, Andres Freund wrote:
I like the current version better - depending on the meson version makes it
easy to find what needs to be removed when we upgrade the meson minimum
version.I think the savings of not looking up selinux/systemd on non-Linux
systems is pretty big. Would you accept a change of something like:For selinux it's default disabled, so it doesn't make a practical
difference. Outside of linux newer versions of meson are more common IME, so
I'm not really worried about it for systemd.if meson.version().version_compare('>=0.59')
# do old stuff
else if host_system == 'linux'
# do new stuff
endifOtherwise, I am happy to remove the patch.
Hm, I don't quite know how this would end up looking like.
Actually, nevermind. I don't know what I was talking about. I will just
go ahead and remove this patch from the set.
From 189d3ac3d5593ce3e475813e4830a29bb4e96f70 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH postgres v1 16/17] Add Meson overridesMeson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1[provide]
dependency_names = libpqThen in my extension (root project), I can have the following line
snippet:libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:I think adding more boilerplate to all these places does have some cost. So
I'm not really convinced this is worth doign.Could you explain more about what costs you foresee?
Repetitive code that needs to be added to each further binary we add. I don't
mind doing that if it has a use case, but I'm not sure I see the use case for
random binaries...
I want to make sure I am only adding it to things that are user-facing.
So if I have added the line to executables that are for internal use
only, please correct me. In general, I override for all user-facing
programs/dependencies because I never know how some end-user might use
the binaries.
Perhaps what might sway you is that the old method (libpq = libpq_dep)
is very error prone because variable names become part of the public API
of your build description which no one likes. In the new way, which is
only possible when specifying overrides, as long as binary names or
pkg-config names don't change, you get stability no matter how you name
your variables.
From 5ee13f09e4101904dbc9887bd4844eb5f1cb4fea Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:54:53 -0500
Subject: [PATCH postgres v1 17/17] Remove Meson program options for specifying
pathsMeson has a built-in way to override paths without polluting project
build options called machine files.I think meson machine files are just about unusable. For one, you can't
actually change any of the options without creating a new build dir. For
another, it's not something that easily can be done on the commandline.So I really don't want to remove these options.
I felt like this would be the most controversial change. What could be
done in upstream Meson to make this a more enjoyable experience?I think *requiring* separate files is a really poor experience when you come
from some other system, where those could trivially be overwritten on the
commandline.
Hmm. I could maybe ask around for a --program command line option. Could
you provide the syntax for what autotools does? That way I can come to
the discussion in the Meson channel with prior art. I personally don't
find the files that annoying, but to each their own.
The biggest change to make them more usable would be to properly reconfigure
when the contents of machine file change. IIRC configure is rerun, but the
changes aren't taken into account.
I could not reproduce this. Perhaps you were testing with an older Meson
where that was the case
# meson.build
project('mytest')
myprog = find_program('myprog')
message(myprog.full_path())
test('dummy', find_program('echo'), args: [myprog.full_path()])
# file.ini
[binaries]
myprog = '/usr/bin/python3'
# CLI
meson setup build
meson test -C build
sed -i 's/python3/python2/' file.ini
meson test -C build
I do however disagree with the usability of machine files. Could you add a
little context about what you find unusable about them?I can quickly change a meson option and run a build and tests. Trivially
scriptable. Whereas with a machine file I need to write code to edit a machine
file, re-configure from scratch, and only then can build / run tests.It's particularly bad for cross builds, where unfortunately cross files can't
be avoided. It's imo the one area where autoconf beats meson handily.
--host=x86_64-w64-mingw32 works for autoconf. Whereas for meson I need to
manually write a cross file with a bunch of binaries set.
https://github.com/anarazel/postgres/commit/ae53f21d06b4dadf8e6b90df84000fad9a769eaf#diff-3420ebab4f1dbe2ba7102565b0b84e4d6d01fb8b3c1e375bd439eed604e743f8R1
One thing that would help you with cross files is to use constants[0]https://mesonbuild.com/Machine-files.html#constants.
There's some helpers aiming to generate cross files, but I've not been able to
generate something useful for cross compiling to windows, for example.I've been unable to generate something like referenced in the above commit in
a reasonably concise way with env2mfile.
I, too, could not generate anything meaningful with the following
command line.
CC=testcc CXX=testcxx AR=testar STRIP=teststrip \
PKGCONFIG=testpkgconfig WINDRES=testwindres meson env2mfile \
--cross --system windows --cpu x86_64 --cpu-family x86_64 \
--endian little -o windows.ini
[binaries]
# Compilers
c = ['testcc']
cpp = ['testcxx']
# Other binaries
[properties]
[host_machine]
cpu = 'x86_64'
cpu_family = 'x86_64'
endian = 'little'
system = 'windows'
In the end, I also just don't see a meaningful benefit in forcing the use of
machine files.
I think it is best to use patterns tools want you to use. If aren't moved at
all by the reconfigure behavior actually working, I will drop the patch.
[0]: https://mesonbuild.com/Machine-files.html#constants
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-06-12 11:54:42 -0500, Tristan Partin wrote:
On Fri Jun 9, 2023 at 1:36 PM CDT, Andres Freund wrote:
The biggest change to make them more usable would be to properly reconfigure
when the contents of machine file change. IIRC configure is rerun, but the
changes aren't taken into account.I could not reproduce this. Perhaps you were testing with an older Meson
where that was the case# meson.build
project('mytest')myprog = find_program('myprog')
message(myprog.full_path())test('dummy', find_program('echo'), args: [myprog.full_path()])
# file.ini
[binaries]
myprog = '/usr/bin/python3'# CLI
meson setup build
meson test -C build
sed -i 's/python3/python2/' file.ini
meson test -C build
It's possible that it doesn't happen in all contexts. I just reproduced the
problem I had, changing
[binaries]
llvm-config = '/usr/bin/llvm-config-13'
to
[binaries]
llvm-config = '/usr/bin/llvm-config-14'
does not change which version is used in an existing build tree, but does
change what's used in a new build tree.
Same with e.g. changing the C compiler version in a machine file. That also
only takes effect in a new tree.
This is with meson HEAD, updated earlier today.
In the end, I also just don't see a meaningful benefit in forcing the use of
machine files.I think it is best to use patterns tools want you to use.
Sometimes. I'd perhaps have a different view if we weren't migrating from
autoconf, where overwriting binaries was trivially possible...
Greetings,
Andres Freund
On Mon Jun 12, 2023 at 12:20 PM CDT, Andres Freund wrote:
Hi,
On 2023-06-12 11:54:42 -0500, Tristan Partin wrote:
On Fri Jun 9, 2023 at 1:36 PM CDT, Andres Freund wrote:
The biggest change to make them more usable would be to properly reconfigure
when the contents of machine file change. IIRC configure is rerun, but the
changes aren't taken into account.I could not reproduce this. Perhaps you were testing with an older Meson
where that was the case# meson.build
project('mytest')myprog = find_program('myprog')
message(myprog.full_path())test('dummy', find_program('echo'), args: [myprog.full_path()])
# file.ini
[binaries]
myprog = '/usr/bin/python3'# CLI
meson setup build
meson test -C build
sed -i 's/python3/python2/' file.ini
meson test -C buildIt's possible that it doesn't happen in all contexts. I just reproduced the
problem I had, changing[binaries]
llvm-config = '/usr/bin/llvm-config-13'to
[binaries]
llvm-config = '/usr/bin/llvm-config-14'does not change which version is used in an existing build tree, but does
change what's used in a new build tree.Same with e.g. changing the C compiler version in a machine file. That also
only takes effect in a new tree.This is with meson HEAD, updated earlier today.
Mind opening a Meson issue if one doesn't exist already?
In the end, I also just don't see a meaningful benefit in forcing the use of
machine files.I think it is best to use patterns tools want you to use.
Sometimes. I'd perhaps have a different view if we weren't migrating from
autoconf, where overwriting binaries was trivially possible...
I'll see what I can advocate for, regardless. The following things seem
relevant. Might be useful to track in your meta issue on your fork.
https://github.com/mesonbuild/meson/issues/7755
https://github.com/mesonbuild/meson/pull/11561
https://github.com/mesonbuild/meson/issues/6180
https://github.com/mesonbuild/meson/issues/11294
Attached you will find a v3 with the offending commits removed. I did
leave the overrides in since you didn't mention it in your last email.
--
Tristan Partin
Neon (https://neon.tech)
Attachments:
v3-0001-Remove-triple-quoted-strings.patchtext/x-patch; charset=utf-8; name=v3-0001-Remove-triple-quoted-strings.patchDownload
From 3467aa4c4f9a239d349d84f26f4662fd37ec605f Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 07:55:03 -0500
Subject: [PATCH v3 01/15] Remove triple-quoted strings
Triple-quoted strings are for multiline strings in Meson. None of the
descriptions that got changed were multiline and the entire file uses
single-line descriptions.
---
meson_options.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 5b44a8829d..1ea9729dc2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,19 +10,19 @@ option('blocksize', type : 'combo',
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : '''WAL block size, in kilobytes''')
+ description : 'WAL block size, in kilobytes')
option('segsize', type : 'integer', value : 1,
- description : '''Segment size, in gigabytes''')
+ description : 'Segment size, in gigabytes')
option('segsize_blocks', type : 'integer', value: 0,
- description : '''Segment size, in blocks''')
+ description : 'Segment size, in blocks')
# Miscellaneous options
option('krb_srvnam', type : 'string', value : 'postgres',
- description : '''Default Kerberos service principal for GSSAPI''')
+ description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'use system time zone data in specified directory')
@@ -32,7 +32,7 @@ option('system_tzdata', type: 'string', value: '',
option('pgport', type : 'integer', value : 5432,
min: 1, max: 65535,
- description : '''Default port number for server and clients''')
+ description : 'Default port number for server and clients')
# Developer options
--
Tristan Partin
Neon (https://neon.tech)
v3-0002-Use-consistent-casing-in-Meson-option-description.patchtext/x-patch; charset=utf-8; name=v3-0002-Use-consistent-casing-in-Meson-option-description.patchDownload
From 8e911a487443b0fa40c5e7033746d97ee9a741f1 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:03:31 -0500
Subject: [PATCH v3 02/15] Use consistent casing in Meson option descriptions
Meson itself uses capital letters for option descriptions, so follow
that.
---
meson_options.txt | 90 +++++++++++++++++++++++------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 1ea9729dc2..fa823fd088 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'set relation block size in kB')
+ description: 'Set relation block size in kB')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -25,7 +25,7 @@ option('krb_srvnam', type : 'string', value : 'postgres',
description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
- description: 'use system time zone data in specified directory')
+ description: 'Use system time zone data in specified directory')
# Defaults
@@ -38,7 +38,7 @@ option('pgport', type : 'integer', value : 5432,
# Developer options
option('cassert', type : 'boolean', value: false,
- description: 'enable assertion checks (for debugging)')
+ description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
description : 'Whether to enable tap tests')
@@ -47,43 +47,43 @@ option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'whether to use atomic operations')
+ description: 'Whether to use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'whether to use spinlocks')
+ description: 'Whether to use spinlocks')
# Compilation options
option('extra_include_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for headers')
+ description: 'Non-default directories to be searched for headers')
option('extra_lib_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for libs')
+ description: 'Non-default directories to be searched for libs')
option('extra_version', type : 'string', value: '',
- description: 'append STRING to the PostgreSQL version number')
+ description: 'Append STRING to the PostgreSQL version number')
option('darwin_sysroot', type : 'string', value: '',
- description: 'select a non-default sysroot path')
+ description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'whether to embed shared library search path in executables')
+ description: 'Whether to embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'build with Bonjour support')
+ description: 'Build with Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'build with BSD Authentication support')
+ description: 'Build with BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
- description: 'documentation in HTML and man page format')
+ description: 'Documentation in HTML and man page format')
option('docs_pdf', type : 'feature', value: 'auto',
- description: 'documentation in PDF format')
+ description: 'Documentation in PDF format')
option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
@@ -110,102 +110,102 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'whether to use llvm')
+ description: 'Whether to use llvm')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
- description: 'native language support')
+ description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'build with PAM support')
+ description: 'Build with PAM support')
option('plperl', type : 'feature', value: 'auto',
- description: 'build Perl modules (PL/Perl)')
+ description: 'Build Perl modules (PL/Perl)')
option('plpython', type : 'feature', value: 'auto',
- description: 'build Python modules (PL/Python)')
+ description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'build with TCL support')
+ description: 'Build with TCL support')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'specify TCL version')
+ description: 'Specify TCL version')
option('readline', type : 'feature', value : 'auto',
- description: 'use GNU Readline or BSD Libedit for editing')
+ description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'build with SELinux support')
+ description: 'Build with SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
- description: 'use LIB for SSL/TLS support (openssl)')
+ description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'build with systemd support')
+ description: 'Build with systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'build contrib/uuid-ossp using LIB')
+ description: 'Build contrib/uuid-ossp using LIB')
option('zlib', type : 'feature', value: 'auto',
- description: 'whether to use zlib')
+ description: 'Whether to use zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'whether to use zstd')
+ description: 'Whether to use zstd')
# Programs
option('BISON', type : 'array', value: ['bison', 'win_bison'],
- description: 'path to bison binary')
+ description: 'Path to bison binary')
option('DTRACE', type : 'string', value: 'dtrace',
- description: 'path to dtrace binary')
+ description: 'Path to dtrace binary')
option('FLEX', type : 'array', value: ['flex', 'win_flex'],
- description: 'path to flex binary')
+ description: 'Path to flex binary')
option('FOP', type : 'string', value: 'fop',
- description: 'path to fop binary')
+ description: 'Path to fop binary')
option('GZIP', type : 'string', value: 'gzip',
- description: 'path to gzip binary')
+ description: 'Path to gzip binary')
option('LZ4', type : 'string', value: 'lz4',
- description: 'path to lz4 binary')
+ description: 'Path to lz4 binary')
option('OPENSSL', type : 'string', value: 'openssl',
- description: 'path to openssl binary')
+ description: 'Path to openssl binary')
option('PERL', type : 'string', value: 'perl',
- description: 'path to perl binary')
+ description: 'Path to perl binary')
option('PROVE', type : 'string', value: 'prove',
- description: 'path to prove binary')
+ description: 'Path to prove binary')
option('PYTHON', type : 'array', value: ['python3', 'python'],
- description: 'path to python binary')
+ description: 'Path to python binary')
option('SED', type : 'string', value: 'gsed',
- description: 'path to sed binary')
+ description: 'Path to sed binary')
option('STRIP', type : 'string', value: 'strip',
- description: 'path to strip binary, used for PGXS emulation')
+ description: 'Path to strip binary, used for PGXS emulation')
option('TAR', type : 'string', value: 'tar',
- description: 'path to tar binary')
+ description: 'Path to tar binary')
option('XMLLINT', type : 'string', value: 'xmllint',
- description: 'path to xmllint binary')
+ description: 'Path to xmllint binary')
option('XSLTPROC', type : 'string', value: 'xsltproc',
- description: 'path to xsltproc binary')
+ description: 'Path to xsltproc binary')
option('ZSTD', type : 'string', value: 'zstd',
- description: 'path to zstd binary')
+ description: 'Path to zstd binary')
option('ZIC', type : 'string', value: 'zic',
- description: 'path to zic binary, when cross-compiling')
+ description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v3-0003-Use-consistent-Meson-option-description-formats.patchtext/x-patch; charset=utf-8; name=v3-0003-Use-consistent-Meson-option-description-formats.patchDownload
From 193faf593b47cbb820ad2a7492d32ba50a054607 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:11:14 -0500
Subject: [PATCH v3 03/15] Use consistent Meson option description formats
---
meson_options.txt | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index fa823fd088..bdc6735332 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'Set relation block size in kB')
+ description: 'Relation block size, in kilobytes')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -41,16 +41,16 @@ option('cassert', type : 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
- description : 'Whether to enable tap tests')
+ description : 'Enable tap tests')
option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'Whether to use atomic operations')
+ description: 'Use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'Whether to use spinlocks')
+ description: 'Use spinlocks')
# Compilation options
@@ -68,16 +68,16 @@ option('darwin_sysroot', type : 'string', value: '',
description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'Whether to embed shared library search path in executables')
+ description: 'Embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'Build with Bonjour support')
+ description: 'Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'Build with BSD Authentication support')
+ description: 'BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
@@ -110,7 +110,7 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'Whether to use llvm')
+ description: 'LLVM support')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
@@ -119,7 +119,7 @@ option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'Build with PAM support')
+ description: 'PAM support')
option('plperl', type : 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
@@ -128,33 +128,33 @@ option('plpython', type : 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'Build with TCL support')
+ description: 'Build with TCL support (PL/TCL)')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'Specify TCL version')
+ description: 'TCL version')
option('readline', type : 'feature', value : 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'Build with SELinux support')
+ description: 'SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'Build with systemd support')
+ description: 'systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'Build contrib/uuid-ossp using LIB')
+ description: 'Use LIB for contrib/uuid-ossp support')
option('zlib', type : 'feature', value: 'auto',
- description: 'Whether to use zlib')
+ description: 'Enable zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'Whether to use zstd')
+ description: 'Enable zstd')
# Programs
--
Tristan Partin
Neon (https://neon.tech)
v3-0004-Attach-colon-to-keyword-argument.patchtext/x-patch; charset=utf-8; name=v3-0004-Attach-colon-to-keyword-argument.patchDownload
From 702588e79b858d0e70fe2202840b00d23eb6814d Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:28:48 -0500
Subject: [PATCH v3 04/15] Attach colon to keyword argument
This matches the style found in the rest of the Meson build description.
---
meson_options.txt | 138 +++++++++++++++++++++++-----------------------
1 file changed, 69 insertions(+), 69 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index bdc6735332..e9ac70766a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,27 +2,27 @@
# Data layout influencing options
-option('blocksize', type : 'combo',
- choices : ['1', '2', '4', '8', '16', '32'],
- value : '8',
+option('blocksize', type: 'combo',
+ choices: ['1', '2', '4', '8', '16', '32'],
+ value: '8',
description: 'Relation block size, in kilobytes')
-option('wal_blocksize', type : 'combo',
+option('wal_blocksize', type: 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : 'WAL block size, in kilobytes')
+ description: 'WAL block size, in kilobytes')
-option('segsize', type : 'integer', value : 1,
- description : 'Segment size, in gigabytes')
+option('segsize', type: 'integer', value: 1,
+ description: 'Segment size, in gigabytes')
-option('segsize_blocks', type : 'integer', value: 0,
- description : 'Segment size, in blocks')
+option('segsize_blocks', type: 'integer', value: 0,
+ description: 'Segment size, in blocks')
# Miscellaneous options
-option('krb_srvnam', type : 'string', value : 'postgres',
- description : 'Default Kerberos service principal for GSSAPI')
+option('krb_srvnam', type: 'string', value: 'postgres',
+ description: 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'Use system time zone data in specified directory')
@@ -30,182 +30,182 @@ option('system_tzdata', type: 'string', value: '',
# Defaults
-option('pgport', type : 'integer', value : 5432,
+option('pgport', type: 'integer', value: 5432,
min: 1, max: 65535,
- description : 'Default port number for server and clients')
+ description: 'Default port number for server and clients')
# Developer options
-option('cassert', type : 'boolean', value: false,
+option('cassert', type: 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
-option('tap_tests', type : 'feature', value : 'auto',
- description : 'Enable tap tests')
+option('tap_tests', type: 'feature', value: 'auto',
+ description: 'Enable tap tests')
-option('PG_TEST_EXTRA', type : 'string', value: '',
+option('PG_TEST_EXTRA', type: 'string', value: '',
description: 'Enable selected extra tests')
-option('atomics', type : 'boolean', value: true,
+option('atomics', type: 'boolean', value: true,
description: 'Use atomic operations')
-option('spinlocks', type : 'boolean', value: true,
+option('spinlocks', type: 'boolean', value: true,
description: 'Use spinlocks')
# Compilation options
-option('extra_include_dirs', type : 'array', value: [],
+option('extra_include_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for headers')
-option('extra_lib_dirs', type : 'array', value: [],
+option('extra_lib_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for libs')
-option('extra_version', type : 'string', value: '',
+option('extra_version', type: 'string', value: '',
description: 'Append STRING to the PostgreSQL version number')
-option('darwin_sysroot', type : 'string', value: '',
+option('darwin_sysroot', type: 'string', value: '',
description: 'Select a non-default sysroot path')
-option('rpath', type : 'boolean', value: true,
+option('rpath', type: 'boolean', value: true,
description: 'Embed shared library search path in executables')
# External dependencies
-option('bonjour', type : 'feature', value: 'auto',
+option('bonjour', type: 'feature', value: 'auto',
description: 'Bonjour support')
-option('bsd_auth', type : 'feature', value: 'auto',
+option('bsd_auth', type: 'feature', value: 'auto',
description: 'BSD Authentication support')
-option('docs', type : 'feature', value: 'auto',
+option('docs', type: 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
-option('docs_pdf', type : 'feature', value: 'auto',
+option('docs_pdf', type: 'feature', value: 'auto',
description: 'Documentation in PDF format')
-option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
+option('docs_html_style', type: 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
-option('dtrace', type : 'feature', value: 'disabled',
+option('dtrace', type: 'feature', value: 'disabled',
description: 'DTrace support')
-option('gssapi', type : 'feature', value: 'auto',
+option('gssapi', type: 'feature', value: 'auto',
description: 'GSSAPI support')
-option('icu', type : 'feature', value: 'auto',
+option('icu', type: 'feature', value: 'auto',
description: 'ICU support')
-option('ldap', type : 'feature', value: 'auto',
+option('ldap', type: 'feature', value: 'auto',
description: 'LDAP support')
-option('libedit_preferred', type : 'boolean', value: false,
+option('libedit_preferred', type: 'boolean', value: false,
description: 'Prefer BSD Libedit over GNU Readline')
-option('libxml', type : 'feature', value: 'auto',
+option('libxml', type: 'feature', value: 'auto',
description: 'XML support')
-option('libxslt', type : 'feature', value: 'auto',
+option('libxslt', type: 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
-option('llvm', type : 'feature', value: 'disabled',
+option('llvm', type: 'feature', value: 'disabled',
description: 'LLVM support')
-option('lz4', type : 'feature', value: 'auto',
+option('lz4', type: 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
-option('pam', type : 'feature', value: 'auto',
+option('pam', type: 'feature', value: 'auto',
description: 'PAM support')
-option('plperl', type : 'feature', value: 'auto',
+option('plperl', type: 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
-option('plpython', type : 'feature', value: 'auto',
+option('plpython', type: 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
-option('pltcl', type : 'feature', value: 'auto',
+option('pltcl', type: 'feature', value: 'auto',
description: 'Build with TCL support (PL/TCL)')
-option('tcl_version', type : 'string', value : 'tcl',
+option('tcl_version', type: 'string', value: 'tcl',
description: 'TCL version')
-option('readline', type : 'feature', value : 'auto',
+option('readline', type: 'feature', value: 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
-option('selinux', type : 'feature', value : 'disabled',
+option('selinux', type: 'feature', value: 'disabled',
description: 'SELinux support')
-option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
- value : 'auto',
+option('ssl', type: 'combo', choices: ['auto', 'none', 'openssl'],
+ value: 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
-option('systemd', type : 'feature', value: 'auto',
+option('systemd', type: 'feature', value: 'auto',
description: 'systemd support')
-option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
- value : 'none',
+option('uuid', type: 'combo', choices: ['none', 'bsd', 'e2fs', 'ossp'],
+ value: 'none',
description: 'Use LIB for contrib/uuid-ossp support')
-option('zlib', type : 'feature', value: 'auto',
+option('zlib', type: 'feature', value: 'auto',
description: 'Enable zlib')
-option('zstd', type : 'feature', value: 'auto',
+option('zstd', type: 'feature', value: 'auto',
description: 'Enable zstd')
# Programs
-option('BISON', type : 'array', value: ['bison', 'win_bison'],
+option('BISON', type: 'array', value: ['bison', 'win_bison'],
description: 'Path to bison binary')
-option('DTRACE', type : 'string', value: 'dtrace',
+option('DTRACE', type: 'string', value: 'dtrace',
description: 'Path to dtrace binary')
-option('FLEX', type : 'array', value: ['flex', 'win_flex'],
+option('FLEX', type: 'array', value: ['flex', 'win_flex'],
description: 'Path to flex binary')
-option('FOP', type : 'string', value: 'fop',
+option('FOP', type: 'string', value: 'fop',
description: 'Path to fop binary')
-option('GZIP', type : 'string', value: 'gzip',
+option('GZIP', type: 'string', value: 'gzip',
description: 'Path to gzip binary')
-option('LZ4', type : 'string', value: 'lz4',
+option('LZ4', type: 'string', value: 'lz4',
description: 'Path to lz4 binary')
-option('OPENSSL', type : 'string', value: 'openssl',
+option('OPENSSL', type: 'string', value: 'openssl',
description: 'Path to openssl binary')
-option('PERL', type : 'string', value: 'perl',
+option('PERL', type: 'string', value: 'perl',
description: 'Path to perl binary')
-option('PROVE', type : 'string', value: 'prove',
+option('PROVE', type: 'string', value: 'prove',
description: 'Path to prove binary')
-option('PYTHON', type : 'array', value: ['python3', 'python'],
+option('PYTHON', type: 'array', value: ['python3', 'python'],
description: 'Path to python binary')
-option('SED', type : 'string', value: 'gsed',
+option('SED', type: 'string', value: 'gsed',
description: 'Path to sed binary')
-option('STRIP', type : 'string', value: 'strip',
+option('STRIP', type: 'string', value: 'strip',
description: 'Path to strip binary, used for PGXS emulation')
-option('TAR', type : 'string', value: 'tar',
+option('TAR', type: 'string', value: 'tar',
description: 'Path to tar binary')
-option('XMLLINT', type : 'string', value: 'xmllint',
+option('XMLLINT', type: 'string', value: 'xmllint',
description: 'Path to xmllint binary')
-option('XSLTPROC', type : 'string', value: 'xsltproc',
+option('XSLTPROC', type: 'string', value: 'xsltproc',
description: 'Path to xsltproc binary')
-option('ZSTD', type : 'string', value: 'zstd',
+option('ZSTD', type: 'string', value: 'zstd',
description: 'Path to zstd binary')
-option('ZIC', type : 'string', value: 'zic',
+option('ZIC', type: 'string', value: 'zic',
description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v3-0005-Use-the-not_found_dep-constant.patchtext/x-patch; charset=utf-8; name=v3-0005-Use-the-not_found_dep-constant.patchDownload
From 475f2544fcf86c8b34f0ed18a19c1dadec88f2c9 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:33:12 -0500
Subject: [PATCH v3 05/15] Use the not_found_dep constant
Previously in the build description, a not_found_dep was defined. Make
use of it.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 16b2e86646..f608eaed30 100644
--- a/meson.build
+++ b/meson.build
@@ -558,7 +558,7 @@ endif
###############################################################
bonjouropt = get_option('bonjour')
-bonjour = dependency('', required : false)
+bonjour = not_found_dep
if cc.check_header('dns_sd.h', required: bonjouropt,
args: test_c_args, include_directories: postgres_inc) and \
cc.has_function('DNSServiceRegister',
--
Tristan Partin
Neon (https://neon.tech)
v3-0006-Remove-old-comment.patchtext/x-patch; charset=utf-8; name=v3-0006-Remove-old-comment.patchDownload
From 7392390eea304f3d4961a8f24ee51ed388ca8c1e Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:19:46 -0500
Subject: [PATCH v3 06/15] Remove old comment
That portion of code is not run in the Windows case already given the
structure of the surrounding if statement.
---
meson.build | 2 --
1 file changed, 2 deletions(-)
diff --git a/meson.build b/meson.build
index f608eaed30..42797694f0 100644
--- a/meson.build
+++ b/meson.build
@@ -722,8 +722,6 @@ choke me
endif
endif
- # XXX: this shouldn't be tested in the windows case, but should be tested in
- # the dependency() success case
if ldap.found() and cc.has_function('ldap_initialize',
dependencies: ldap, args: test_c_args)
cdata.set('HAVE_LDAP_INITIALIZE', 1)
--
Tristan Partin
Neon (https://neon.tech)
v3-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchtext/x-patch; charset=utf-8; name=v3-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchDownload
From f8c2da5d2f1f13021cd44838ca9f8d9c83ef673b Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:27:06 -0500
Subject: [PATCH v3 07/15] Tie adding C++ support to the llvm Meson option
In the event the llvm option is defined to be 'auto', it is possible
that the host machine might not have a C++ compiler. If that is the
case, then we shouldn't continue reaching for the llvm dependency.
---
meson.build | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 42797694f0..f18032a66c 100644
--- a/meson.build
+++ b/meson.build
@@ -742,8 +742,8 @@ endif
###############################################################
llvmopt = get_option('llvm')
-if not llvmopt.disabled()
- add_languages('cpp', required: true, native: false)
+llvm = not_found_dep
+if add_languages('cpp', required: llvmopt, native: false)
llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
if llvm.found()
@@ -757,8 +757,6 @@ if not llvmopt.disabled()
ccache = find_program('ccache', native: true, required: false)
clang = find_program(llvm_binpath / 'clang', required: true)
endif
-else
- llvm = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v3-0008-Mention-the-correct-way-to-disable-readline-suppo.patchtext/x-patch; charset=utf-8; name=v3-0008-Mention-the-correct-way-to-disable-readline-suppo.patchDownload
From a0fad88aa088768383ef23a43676b439673fe0b9 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 10:27:34 -0500
Subject: [PATCH v3 08/15] Mention the correct way to disable readline support
Using false to disable a feature option is incorrect.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index f18032a66c..061a74b83e 100644
--- a/meson.build
+++ b/meson.build
@@ -1129,7 +1129,7 @@ if not get_option('readline').disabled()
error('''readline header not found
If you have @0@ already installed, see meson-log/meson-log.txt for details on the
failure. It is possible the compiler isn't looking in the proper directory.
-Use -Dreadline=false to disable readline support.'''.format(readline_dep))
+Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
endif
check_funcs = [
--
Tristan Partin
Neon (https://neon.tech)
v3-0009-Remove-return-code-check.patchtext/x-patch; charset=utf-8; name=v3-0009-Remove-return-code-check.patchDownload
From a87561d27dcfd4a5581a51bd2b1d8d229a1b3f4a Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:30:54 -0500
Subject: [PATCH v3 09/15] Remove return code check
run_command(check: true) will already handle this.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 061a74b83e..a81aaeb8aa 100644
--- a/meson.build
+++ b/meson.build
@@ -385,7 +385,7 @@ install_files = files('src/tools/install_files')
# https://github.com/mesonbuild/meson/issues/8511
meson_binpath_r = run_command(python, 'src/tools/find_meson', check: true)
-if meson_binpath_r.returncode() != 0 or meson_binpath_r.stdout() == ''
+if meson_binpath_r.stdout() == ''
error('huh, could not run find_meson.\nerrcode: @0@\nstdout: @1@\nstderr: @2@'.format(
meson_binpath_r.returncode(),
meson_binpath_r.stdout(),
--
Tristan Partin
Neon (https://neon.tech)
v3-0010-Fix-some-grammar-usage-in-Meson-comments.patchtext/x-patch; charset=utf-8; name=v3-0010-Fix-some-grammar-usage-in-Meson-comments.patchDownload
From 0d859e0d6c8a76dc18fd51b63f7d4d9bcf06c008 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:33:18 -0500
Subject: [PATCH v3 10/15] Fix some grammar usage in Meson comments
---
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index a81aaeb8aa..0ab31b3424 100644
--- a/meson.build
+++ b/meson.build
@@ -150,7 +150,7 @@ cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
cdata.set('PG_MAJORVERSION_NUM', pg_version_major)
cdata.set('PG_MINORVERSION_NUM', pg_version_minor)
cdata.set('PG_VERSION_NUM', pg_version_num)
-# PG_VERSION_STR is built later, it depends compiler test results
+# PG_VERSION_STR is built later, it depends on compiler test results
cdata.set_quoted('CONFIGURE_ARGS', '')
@@ -1672,7 +1672,7 @@ if cc.has_function_attribute('visibility:default') and \
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
- # inlineshidden to C code as well... Any either way, we want to put these
+ # inlineshidden to C code as well... And either way, we want to put these
# flags into exported files (pgxs, .pc files).
cflags_mod += '-fvisibility=hidden'
cxxflags_mod += ['-fvisibility=hidden', '-fvisibility-inlines-hidden']
--
Tristan Partin
Neon (https://neon.tech)
v3-0011-Pass-feature-option-through-to-required-kwarg.patchtext/x-patch; charset=utf-8; name=v3-0011-Pass-feature-option-through-to-required-kwarg.patchDownload
From ae741c434aef202917acd159422a8f7123b64575 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:38:09 -0500
Subject: [PATCH v3 11/15] Pass feature option through to required kwarg
Meson understands this already. No need to convert it to a boolean.
---
meson.build | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 0ab31b3424..188dd81243 100644
--- a/meson.build
+++ b/meson.build
@@ -767,8 +767,8 @@ endif
icuopt = get_option('icu')
if not icuopt.disabled()
- icu = dependency('icu-uc', required: icuopt.enabled())
- icu_i18n = dependency('icu-i18n', required: icuopt.enabled())
+ icu = dependency('icu-uc', required: icuopt)
+ icu_i18n = dependency('icu-i18n', required: icuopt)
if icu.found()
cdata.set('USE_ICU', 1)
@@ -1077,7 +1077,7 @@ if not get_option('readline').disabled()
readline = dependency(readline_dep, required: false)
if not readline.found()
readline = cc.find_library(readline_dep,
- required: get_option('readline').enabled(),
+ required: get_option('readline'),
dirs: test_lib_d)
endif
if readline.found()
@@ -2537,7 +2537,7 @@ if not nlsopt.disabled()
# otherwise there'd be lots of
# "Gettext not found, all translation (po) targets will be ignored."
# warnings if not found.
- msgfmt = find_program('msgfmt', required: nlsopt.enabled(), native: true)
+ msgfmt = find_program('msgfmt', required: nlsopt, native: true)
# meson 0.59 has this wrapped in dependency('int')
if (msgfmt.found() and
--
Tristan Partin
Neon (https://neon.tech)
v3-0012-Make-finding-pkg-config-python3-more-robust.patchtext/x-patch; charset=utf-8; name=v3-0012-Make-finding-pkg-config-python3-more-robust.patchDownload
From 5221313935b078feac8e929acad39f95ac1c3e7d Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH v3 12/15] Make finding pkg-config(python3) more robust
It is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.
https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/python.py#L218
---
meson.build | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 188dd81243..7f6cad1908 100644
--- a/meson.build
+++ b/meson.build
@@ -1050,15 +1050,17 @@ endif
###############################################################
pyopt = get_option('plpython')
+python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
- python3_dep = not_found_dep
+ python3_inst = pm.find_installation(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
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
+ python3_dep = not_found_dep
+ endif
endif
-else
- python3_dep = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v3-0013-Make-some-Meson-style-more-consistent-with-surrou.patchtext/x-patch; charset=utf-8; name=v3-0013-Make-some-Meson-style-more-consistent-with-surrou.patchDownload
From ddbef71047fe7e9e5cb5585923901f4ac5fd6ae3 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:43:51 -0500
Subject: [PATCH v3 13/15] Make some Meson style more consistent with
surrounding code
---
meson.build | 17 ++++++++---------
src/include/meson.build | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/meson.build b/meson.build
index 7f6cad1908..79b6aa47ec 100644
--- a/meson.build
+++ b/meson.build
@@ -1146,7 +1146,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
foreach func : check_funcs
found = cc.has_function(func, dependencies: [readline],
args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_'+func.to_upper(), found ? 1 : false)
+ cdata.set('HAVE_' + func.to_upper(), found ? 1 : false)
endforeach
check_vars = [
@@ -1156,7 +1156,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
]
foreach var : check_vars
- cdata.set('HAVE_'+var.to_upper(),
+ cdata.set('HAVE_' + var.to_upper(),
cc.has_header_symbol(readline_h, var,
args: test_c_args, include_directories: postgres_inc,
prefix: '#include <stdio.h>',
@@ -1311,7 +1311,7 @@ if sslopt in ['auto', 'openssl']
cdata.set('USE_OPENSSL', 1,
description: 'Define to 1 to build with OpenSSL support. (-Dssl=openssl)')
cdata.set('OPENSSL_API_COMPAT', '0x10001000L',
- description: '''Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.''')
+ description: 'Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.')
ssl_library = 'openssl'
else
ssl = not_found_dep
@@ -1599,8 +1599,7 @@ if cc.links('''
if not buggy_int128
cdata.set('PG_INT128_TYPE', '__int128')
- cdata.set('ALIGNOF_PG_INT128_TYPE', cc.
- alignment('__int128', args: test_c_args))
+ cdata.set('ALIGNOF_PG_INT128_TYPE', cc.alignment('__int128', args: test_c_args))
endif
endif
@@ -1642,8 +1641,8 @@ endif
# We use <stdbool.h> if we have it and it declares type bool as having
# size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
if cc.has_type('_Bool', args: test_c_args) \
- and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
- and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
+ and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
+ and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
cdata.set('HAVE__BOOL', 1)
cdata.set('PG_USE_STDBOOL', 1)
endif
@@ -1670,7 +1669,7 @@ endforeach
if cc.has_function_attribute('visibility:default') and \
- cc.has_function_attribute('visibility:hidden')
+ cc.has_function_attribute('visibility:hidden')
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
@@ -3032,7 +3031,7 @@ meson_install_args = meson_args + ['install'] + {
'muon': []
}[meson_impl]
-# setup tests should be run first,
+# setup tests should be run first,
# so define priority for these
setup_tests_priority = 100
test('tmp_install',
diff --git a/src/include/meson.build b/src/include/meson.build
index 33c0a5562c..d7e1ecd4c9 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -89,7 +89,7 @@ install_headers(
'c.h',
'port.h',
'postgres_fe.h',
- install_dir: dir_include_internal
+ install_dir: dir_include_internal,
)
install_headers(
--
Tristan Partin
Neon (https://neon.tech)
v3-0014-Use-a-better-error-message-in-an-impossible-case.patchtext/x-patch; charset=utf-8; name=v3-0014-Use-a-better-error-message-in-an-impossible-case.patchDownload
From 585a2741d08daf7165ed75551867ffa32c93594d Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:48:18 -0500
Subject: [PATCH v3 14/15] Use a better error message in an impossible case
Meson validates 'choice' options for us, so technically this case is
impossible. A better error message helps people reading the code
understand what is going on in that branch.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 79b6aa47ec..127d266095 100644
--- a/meson.build
+++ b/meson.build
@@ -1346,7 +1346,7 @@ if uuidopt != 'none'
uuidfunc = 'uuid_export'
uuidheader = 'uuid.h'
else
- error('huh')
+ error('unknown uuid build option value: @0@'.format(uuidopt))
endif
if not cc.has_header_symbol(uuidheader, uuidfunc, args: test_c_args, dependencies: uuid)
--
Tristan Partin
Neon (https://neon.tech)
v3-0015-Add-Meson-overrides.patchtext/x-patch; charset=utf-8; name=v3-0015-Add-Meson-overrides.patchDownload
From c3a2e8f46760f86cf9d2bafe4f3777e103701e0f Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH v3 15/15] Add Meson overrides
Meson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:
[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1
[provide]
dependency_names = libpq
Then in my extension (root project), I can have the following line
snippet:
libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.
I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:
program_names = initdb, postgres, ...
Then in my extension (root project), I can find them with the following
line:
initdb = find_program('initdb')
Again, initdb will be compiled transparently as my extension gets built
if and only if initdb isn't found on the host system.
---
src/backend/meson.build | 2 ++
src/bin/initdb/meson.build | 2 ++
src/bin/pg_amcheck/meson.build | 2 ++
src/bin/pg_archivecleanup/meson.build | 2 ++
src/bin/pg_basebackup/meson.build | 6 ++++++
src/bin/pg_checksums/meson.build | 2 ++
src/bin/pg_config/meson.build | 2 ++
src/bin/pg_controldata/meson.build | 2 ++
src/bin/pg_ctl/meson.build | 2 ++
src/bin/pg_dump/meson.build | 6 ++++++
src/bin/pg_resetwal/meson.build | 2 ++
src/bin/pg_rewind/meson.build | 2 ++
src/bin/pg_test_fsync/meson.build | 2 ++
src/bin/pg_test_timing/meson.build | 2 ++
src/bin/pg_upgrade/meson.build | 2 ++
src/bin/pg_verifybackup/meson.build | 2 ++
src/bin/pg_waldump/meson.build | 2 ++
src/bin/pgbench/meson.build | 2 ++
src/bin/psql/meson.build | 2 ++
src/bin/scripts/meson.build | 6 ++++--
src/interfaces/ecpg/preproc/meson.build | 2 ++
src/interfaces/libpq/meson.build | 2 ++
22 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/src/backend/meson.build b/src/backend/meson.build
index ccfc382fcf..ac2f66d920 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -147,6 +147,8 @@ postgres = executable('postgres',
backend_targets += postgres
+meson.override_find_program('postgres', postgres)
+
pg_mod_c_args = cflags_mod
pg_mod_cpp_args = cxxflags_mod
pg_mod_link_args = ldflags_sl + ldflags_mod
diff --git a/src/bin/initdb/meson.build b/src/bin/initdb/meson.build
index 49743630aa..12b4918e8b 100644
--- a/src/bin/initdb/meson.build
+++ b/src/bin/initdb/meson.build
@@ -23,6 +23,8 @@ initdb = executable('initdb',
)
bin_targets += initdb
+meson.override_find_program('initdb', initdb)
+
tests += {
'name': 'initdb',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_amcheck/meson.build b/src/bin/pg_amcheck/meson.build
index 2ade5aba03..8694abbf07 100644
--- a/src/bin/pg_amcheck/meson.build
+++ b/src/bin/pg_amcheck/meson.build
@@ -17,6 +17,8 @@ pg_amcheck = executable('pg_amcheck',
)
bin_targets += pg_amcheck
+meson.override_find_program('pg_amcheck', pg_amcheck)
+
tests += {
'name': 'pg_amcheck',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_archivecleanup/meson.build b/src/bin/pg_archivecleanup/meson.build
index 28349db58b..6eecb42b05 100644
--- a/src/bin/pg_archivecleanup/meson.build
+++ b/src/bin/pg_archivecleanup/meson.build
@@ -17,6 +17,8 @@ pg_archivecleanup = executable('pg_archivecleanup',
)
bin_targets += pg_archivecleanup
+meson.override_find_program('pg_archivecleanup', pg_archivecleanup)
+
tests += {
'name': 'pg_archivecleanup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build
index c684622bfb..589c664163 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -37,6 +37,8 @@ pg_basebackup = executable('pg_basebackup',
)
bin_targets += pg_basebackup
+meson.override_find_program('pg_basebackup', pg_basebackup)
+
pg_receivewal_sources = files(
'pg_receivewal.c',
@@ -56,6 +58,8 @@ pg_receivewal = executable('pg_receivewal',
)
bin_targets += pg_receivewal
+meson.override_find_program('pg_receivewal', pg_receivewal)
+
pg_recvlogical_sources = files(
'pg_recvlogical.c',
@@ -75,6 +79,8 @@ pg_recvlogical = executable('pg_recvlogical',
)
bin_targets += pg_recvlogical
+meson.override_find_program('pg_recvlogical', pg_recvlogical)
+
tests += {
'name': 'pg_basebackup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_checksums/meson.build b/src/bin/pg_checksums/meson.build
index 5528526094..d54e76ae6c 100644
--- a/src/bin/pg_checksums/meson.build
+++ b/src/bin/pg_checksums/meson.build
@@ -18,6 +18,8 @@ pg_checksums = executable('pg_checksums',
)
bin_targets += pg_checksums
+meson.override_find_program('pg_checksums', pg_checksums)
+
tests += {
'name': 'pg_checksums',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_config/meson.build b/src/bin/pg_config/meson.build
index 7fd7e94e2d..bea966f63e 100644
--- a/src/bin/pg_config/meson.build
+++ b/src/bin/pg_config/meson.build
@@ -17,6 +17,8 @@ pg_config = executable('pg_config',
)
bin_targets += pg_config
+meson.override_find_program('pg_config', pg_config)
+
tests += {
'name': 'pg_config',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_controldata/meson.build b/src/bin/pg_controldata/meson.build
index 03c9d0ae3e..4521828b1f 100644
--- a/src/bin/pg_controldata/meson.build
+++ b/src/bin/pg_controldata/meson.build
@@ -17,6 +17,8 @@ pg_controldata = executable('pg_controldata',
)
bin_targets += pg_controldata
+meson.override_find_program('pg_controldata', pg_controldata)
+
tests += {
'name': 'pg_controldata',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_ctl/meson.build b/src/bin/pg_ctl/meson.build
index 608a52f9fb..b62519c15f 100644
--- a/src/bin/pg_ctl/meson.build
+++ b/src/bin/pg_ctl/meson.build
@@ -17,6 +17,8 @@ pg_ctl = executable('pg_ctl',
)
bin_targets += pg_ctl
+meson.override_find_program('pg_ctl', pg_ctl)
+
tests += {
'name': 'pg_ctl',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_dump/meson.build b/src/bin/pg_dump/meson.build
index 9d59a106f3..ae89758ef6 100644
--- a/src/bin/pg_dump/meson.build
+++ b/src/bin/pg_dump/meson.build
@@ -45,6 +45,8 @@ pg_dump = executable('pg_dump',
)
bin_targets += pg_dump
+meson.override_find_program('pg_dump', pg_dump)
+
pg_dumpall_sources = files(
'pg_dumpall.c',
@@ -64,6 +66,8 @@ pg_dumpall = executable('pg_dumpall',
)
bin_targets += pg_dumpall
+meson.override_find_program('pg_dumpall', pg_dumpall)
+
pg_restore_sources = files(
'pg_restore.c',
@@ -83,6 +87,8 @@ pg_restore = executable('pg_restore',
)
bin_targets += pg_restore
+meson.override_find_program('pg_restore', pg_restore)
+
tests += {
'name': 'pg_dump',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_resetwal/meson.build b/src/bin/pg_resetwal/meson.build
index 3f08a819bb..e7d4ab3fa5 100644
--- a/src/bin/pg_resetwal/meson.build
+++ b/src/bin/pg_resetwal/meson.build
@@ -17,6 +17,8 @@ pg_resetwal = executable('pg_resetwal',
)
bin_targets += pg_resetwal
+meson.override_find_program('pg_resetwal', pg_resetwal)
+
tests += {
'name': 'pg_resetwal',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_rewind/meson.build b/src/bin/pg_rewind/meson.build
index fd22818be4..23d698d8fd 100644
--- a/src/bin/pg_rewind/meson.build
+++ b/src/bin/pg_rewind/meson.build
@@ -27,6 +27,8 @@ pg_rewind = executable('pg_rewind',
)
bin_targets += pg_rewind
+meson.override_find_program('pg_rewind', pg_rewind)
+
tests += {
'name': 'pg_rewind',
diff --git a/src/bin/pg_test_fsync/meson.build b/src/bin/pg_test_fsync/meson.build
index aaf65c310e..3a03156508 100644
--- a/src/bin/pg_test_fsync/meson.build
+++ b/src/bin/pg_test_fsync/meson.build
@@ -17,6 +17,8 @@ pg_test_fsync = executable('pg_test_fsync',
)
bin_targets += pg_test_fsync
+meson.override_find_program('pg_test_fsync', pg_test_fsync)
+
tests += {
'name': 'pg_test_fsync',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_test_timing/meson.build b/src/bin/pg_test_timing/meson.build
index 02f4a5c641..8a5aa29135 100644
--- a/src/bin/pg_test_timing/meson.build
+++ b/src/bin/pg_test_timing/meson.build
@@ -17,6 +17,8 @@ pg_test_timing = executable('pg_test_timing',
)
bin_targets += pg_test_timing
+meson.override_find_program('pg_test_timing', pg_test_timing)
+
tests += {
'name': 'pg_test_timing',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_upgrade/meson.build b/src/bin/pg_upgrade/meson.build
index 12a97f84e2..3046b3f471 100644
--- a/src/bin/pg_upgrade/meson.build
+++ b/src/bin/pg_upgrade/meson.build
@@ -32,6 +32,8 @@ pg_upgrade = executable('pg_upgrade',
)
bin_targets += pg_upgrade
+meson.override_find_program('pg_upgrade', pg_upgrade)
+
tests += {
'name': 'pg_upgrade',
diff --git a/src/bin/pg_verifybackup/meson.build b/src/bin/pg_verifybackup/meson.build
index 9369da1bc6..5b670fd3e5 100644
--- a/src/bin/pg_verifybackup/meson.build
+++ b/src/bin/pg_verifybackup/meson.build
@@ -18,6 +18,8 @@ pg_verifybackup = executable('pg_verifybackup',
)
bin_targets += pg_verifybackup
+meson.override_find_program('pg_verifybackup', pg_verifybackup)
+
tests += {
'name': 'pg_verifybackup',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pg_waldump/meson.build b/src/bin/pg_waldump/meson.build
index ae674d17c3..c03f212842 100644
--- a/src/bin/pg_waldump/meson.build
+++ b/src/bin/pg_waldump/meson.build
@@ -24,6 +24,8 @@ pg_waldump = executable('pg_waldump',
)
bin_targets += pg_waldump
+meson.override_find_program('pg_waldump', pg_waldump)
+
tests += {
'name': 'pg_waldump',
'sd': meson.current_source_dir(),
diff --git a/src/bin/pgbench/meson.build b/src/bin/pgbench/meson.build
index e3c7619cf4..b8b46ef721 100644
--- a/src/bin/pgbench/meson.build
+++ b/src/bin/pgbench/meson.build
@@ -35,6 +35,8 @@ pgbench = executable('pgbench',
)
bin_targets += pgbench
+meson.override_find_program('pgbench', pgbench)
+
tests += {
'name': 'pgbench',
'sd': meson.current_source_dir(),
diff --git a/src/bin/psql/meson.build b/src/bin/psql/meson.build
index a0a4ac7afb..cf20b3a7a4 100644
--- a/src/bin/psql/meson.build
+++ b/src/bin/psql/meson.build
@@ -53,6 +53,8 @@ psql = executable('psql',
)
bin_targets += psql
+meson.override_find_program('psql', psql)
+
install_data('psqlrc.sample',
install_dir: dir_data,
)
diff --git a/src/bin/scripts/meson.build b/src/bin/scripts/meson.build
index 5b4f8a6f85..fa16814710 100644
--- a/src/bin/scripts/meson.build
+++ b/src/bin/scripts/meson.build
@@ -26,13 +26,15 @@ foreach binary : binaries
'--FILEDESC', '@0@ - PostgreSQL utility'.format(binary),])
endif
- binary = executable(binary,
+ exe = executable(binary,
binary_sources,
link_with: [scripts_common],
dependencies: [frontend_code, libpq],
kwargs: default_bin_args,
)
- bin_targets += binary
+ bin_targets += exe
+
+ meson.override_find_program(binary, exe)
endforeach
tests += {
diff --git a/src/interfaces/ecpg/preproc/meson.build b/src/interfaces/ecpg/preproc/meson.build
index 08d772d261..f7c9f79c81 100644
--- a/src/interfaces/ecpg/preproc/meson.build
+++ b/src/interfaces/ecpg/preproc/meson.build
@@ -110,4 +110,6 @@ ecpg_exe = executable('ecpg',
)
ecpg_targets += ecpg_exe
+meson.override_find_program('ecpg', ecpg_exe)
+
subdir('po', if_found: libintl)
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index 80e6a15adf..6d18970e81 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -84,6 +84,8 @@ libpq = declare_dependency(
include_directories: [include_directories('.')]
)
+meson.override_dependency('libpq', libpq)
+
pkgconfig.generate(
name: 'libpq',
description: 'PostgreSQL libpq library',
--
Tristan Partin
Neon (https://neon.tech)
On 12.06.23 20:48, Tristan Partin wrote:
Attached you will find a v3 with the offending commits removed. I did
leave the overrides in since you didn't mention it in your last email.
Patches 1-14 look ok to me. (But I didn't test anything, so some
caveats about whether the non-cosmetic patches actually work apply.) If
we're fine-tuning the capitalization the options descriptions, let's
also turn "tap tests" into "TAP tests" and "TCL" into "Tcl".
Patch 15 about the wrap integration, I'm not sure. I share the concerns
about whether this is worth maintaining. Maybe put this patch into the
commitfest separately, to allow for further study and testing. (The
other patches, if they are acceptable, ought to go into PG16, I think.)
On Mon Jun 12, 2023 at 4:24 PM CDT, Peter Eisentraut wrote:
On 12.06.23 20:48, Tristan Partin wrote:
Attached you will find a v3 with the offending commits removed. I did
leave the overrides in since you didn't mention it in your last email.Patches 1-14 look ok to me. (But I didn't test anything, so some
caveats about whether the non-cosmetic patches actually work apply.) If
we're fine-tuning the capitalization the options descriptions, let's
also turn "tap tests" into "TAP tests" and "TCL" into "Tcl".
I'll get to that.
Patch 15 about the wrap integration, I'm not sure. I share the concerns
about whether this is worth maintaining. Maybe put this patch into the
commitfest separately, to allow for further study and testing. (The
other patches, if they are acceptable, ought to go into PG16, I think.)
Ok. I will split it off for further discussion. Expect a v4 tomorrow
with a few extra changes with regard to another review from a Meson
maintainer.
--
Tristan Partin
Neon (https://neon.tech)
On Fri Jun 9, 2023 at 1:36 PM CDT, Andres Freund wrote:
On 2023-06-09 13:15:27 -0500, Tristan Partin wrote:
On Fri Jun 9, 2023 at 11:41 AM CDT, Andres Freund wrote:
From 189d3ac3d5593ce3e475813e4830a29bb4e96f70 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH postgres v1 16/17] Add Meson overridesMeson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1[provide]
dependency_names = libpqThen in my extension (root project), I can have the following line
snippet:libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.I have also added overrides for the various public-facing exectuables.
Though I don't expect them to get much usage, might as well go ahead and
override them. They can be used by adding the following line to the
aforementioned wrap file:I think adding more boilerplate to all these places does have some cost. So
I'm not really convinced this is worth doign.Could you explain more about what costs you foresee?
Repetitive code that needs to be added to each further binary we add. I don't
mind doing that if it has a use case, but I'm not sure I see the use case for
random binaries...
I was thinking today. When you initially wrote the build, did you try
using the src/bin/meson.build file as the place where all the binaries
were built? As you say, most of the src/bin/xxx/meson.build files are
extrememly reptitive.
We had a similar-ish issue in my last project which I solved like:
https://github.com/hse-project/hse/blob/master/tools/meson.build#L20-L405
This is a pattern I used quite frequently in that project. One benefit
of this approach is that the binaries all end up next to each other in
the build tree which is eventually how they'll be laid out in the
install destination. The other benefit is of course reducing reptitive
code.
- ./build/src/bin/psql/psql
+ ./build/src/bin/psql
Let me know what you think.
--
Tristan Partin
Neon (https://neon.tech)
On Mon Jun 12, 2023 at 4:43 PM CDT, Tristan Partin wrote:
On Mon Jun 12, 2023 at 4:24 PM CDT, Peter Eisentraut wrote:
On 12.06.23 20:48, Tristan Partin wrote:
Attached you will find a v3 with the offending commits removed. I did
leave the overrides in since you didn't mention it in your last email.Patches 1-14 look ok to me. (But I didn't test anything, so some
caveats about whether the non-cosmetic patches actually work apply.) If
we're fine-tuning the capitalization the options descriptions, let's
also turn "tap tests" into "TAP tests" and "TCL" into "Tcl".I'll get to that.
Done.
Patch 15 about the wrap integration, I'm not sure. I share the concerns
about whether this is worth maintaining. Maybe put this patch into the
commitfest separately, to allow for further study and testing. (The
other patches, if they are acceptable, ought to go into PG16, I think.)Ok. I will split it off for further discussion. Expect a v4 tomorrow
with a few extra changes with regard to another review from a Meson
maintainer.
Attached. I did have an idea to help with repetitive build descriptions
in:
/messages/by-id/CTBSCT2V1TVP.2AUJVJLNWQVG3@gonk.
I kind of want to see Andres' response, before this gets merged. But
that could also be a follow on commit if he likes the idea. I'll leave
it up to you to decide.
--
Tristan Partin
Neon (https://neon.tech)
Wow. I didn't attach them...
--
Tristan Partin
Neon (https://neon.tech)
Attachments:
v4-0001-Remove-triple-quoted-strings.patchtext/x-patch; charset=utf-8; name=v4-0001-Remove-triple-quoted-strings.patchDownload
From c20ece79c625c8ca33fee26791ab40c311a5c97e Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 07:55:03 -0500
Subject: [PATCH v4 01/14] Remove triple-quoted strings
Triple-quoted strings are for multiline strings in Meson. None of the
descriptions that got changed were multiline and the entire file uses
single-line descriptions.
---
meson_options.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 5b44a8829d..1ea9729dc2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,19 +10,19 @@ option('blocksize', type : 'combo',
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : '''WAL block size, in kilobytes''')
+ description : 'WAL block size, in kilobytes')
option('segsize', type : 'integer', value : 1,
- description : '''Segment size, in gigabytes''')
+ description : 'Segment size, in gigabytes')
option('segsize_blocks', type : 'integer', value: 0,
- description : '''Segment size, in blocks''')
+ description : 'Segment size, in blocks')
# Miscellaneous options
option('krb_srvnam', type : 'string', value : 'postgres',
- description : '''Default Kerberos service principal for GSSAPI''')
+ description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'use system time zone data in specified directory')
@@ -32,7 +32,7 @@ option('system_tzdata', type: 'string', value: '',
option('pgport', type : 'integer', value : 5432,
min: 1, max: 65535,
- description : '''Default port number for server and clients''')
+ description : 'Default port number for server and clients')
# Developer options
--
Tristan Partin
Neon (https://neon.tech)
v4-0002-Use-consistent-casing-in-Meson-option-description.patchtext/x-patch; charset=utf-8; name=v4-0002-Use-consistent-casing-in-Meson-option-description.patchDownload
From 230bfbb6029e520fc980ad9c0e6ff7369ca0f939 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:03:31 -0500
Subject: [PATCH v4 02/14] Use consistent casing in Meson option descriptions
Meson itself uses capital letters for option descriptions, so follow
that.
---
meson_options.txt | 90 +++++++++++++++++++++++------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 1ea9729dc2..fa823fd088 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'set relation block size in kB')
+ description: 'Set relation block size in kB')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -25,7 +25,7 @@ option('krb_srvnam', type : 'string', value : 'postgres',
description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
- description: 'use system time zone data in specified directory')
+ description: 'Use system time zone data in specified directory')
# Defaults
@@ -38,7 +38,7 @@ option('pgport', type : 'integer', value : 5432,
# Developer options
option('cassert', type : 'boolean', value: false,
- description: 'enable assertion checks (for debugging)')
+ description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
description : 'Whether to enable tap tests')
@@ -47,43 +47,43 @@ option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'whether to use atomic operations')
+ description: 'Whether to use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'whether to use spinlocks')
+ description: 'Whether to use spinlocks')
# Compilation options
option('extra_include_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for headers')
+ description: 'Non-default directories to be searched for headers')
option('extra_lib_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for libs')
+ description: 'Non-default directories to be searched for libs')
option('extra_version', type : 'string', value: '',
- description: 'append STRING to the PostgreSQL version number')
+ description: 'Append STRING to the PostgreSQL version number')
option('darwin_sysroot', type : 'string', value: '',
- description: 'select a non-default sysroot path')
+ description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'whether to embed shared library search path in executables')
+ description: 'Whether to embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'build with Bonjour support')
+ description: 'Build with Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'build with BSD Authentication support')
+ description: 'Build with BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
- description: 'documentation in HTML and man page format')
+ description: 'Documentation in HTML and man page format')
option('docs_pdf', type : 'feature', value: 'auto',
- description: 'documentation in PDF format')
+ description: 'Documentation in PDF format')
option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
@@ -110,102 +110,102 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'whether to use llvm')
+ description: 'Whether to use llvm')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
- description: 'native language support')
+ description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'build with PAM support')
+ description: 'Build with PAM support')
option('plperl', type : 'feature', value: 'auto',
- description: 'build Perl modules (PL/Perl)')
+ description: 'Build Perl modules (PL/Perl)')
option('plpython', type : 'feature', value: 'auto',
- description: 'build Python modules (PL/Python)')
+ description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'build with TCL support')
+ description: 'Build with TCL support')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'specify TCL version')
+ description: 'Specify TCL version')
option('readline', type : 'feature', value : 'auto',
- description: 'use GNU Readline or BSD Libedit for editing')
+ description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'build with SELinux support')
+ description: 'Build with SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
- description: 'use LIB for SSL/TLS support (openssl)')
+ description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'build with systemd support')
+ description: 'Build with systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'build contrib/uuid-ossp using LIB')
+ description: 'Build contrib/uuid-ossp using LIB')
option('zlib', type : 'feature', value: 'auto',
- description: 'whether to use zlib')
+ description: 'Whether to use zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'whether to use zstd')
+ description: 'Whether to use zstd')
# Programs
option('BISON', type : 'array', value: ['bison', 'win_bison'],
- description: 'path to bison binary')
+ description: 'Path to bison binary')
option('DTRACE', type : 'string', value: 'dtrace',
- description: 'path to dtrace binary')
+ description: 'Path to dtrace binary')
option('FLEX', type : 'array', value: ['flex', 'win_flex'],
- description: 'path to flex binary')
+ description: 'Path to flex binary')
option('FOP', type : 'string', value: 'fop',
- description: 'path to fop binary')
+ description: 'Path to fop binary')
option('GZIP', type : 'string', value: 'gzip',
- description: 'path to gzip binary')
+ description: 'Path to gzip binary')
option('LZ4', type : 'string', value: 'lz4',
- description: 'path to lz4 binary')
+ description: 'Path to lz4 binary')
option('OPENSSL', type : 'string', value: 'openssl',
- description: 'path to openssl binary')
+ description: 'Path to openssl binary')
option('PERL', type : 'string', value: 'perl',
- description: 'path to perl binary')
+ description: 'Path to perl binary')
option('PROVE', type : 'string', value: 'prove',
- description: 'path to prove binary')
+ description: 'Path to prove binary')
option('PYTHON', type : 'array', value: ['python3', 'python'],
- description: 'path to python binary')
+ description: 'Path to python binary')
option('SED', type : 'string', value: 'gsed',
- description: 'path to sed binary')
+ description: 'Path to sed binary')
option('STRIP', type : 'string', value: 'strip',
- description: 'path to strip binary, used for PGXS emulation')
+ description: 'Path to strip binary, used for PGXS emulation')
option('TAR', type : 'string', value: 'tar',
- description: 'path to tar binary')
+ description: 'Path to tar binary')
option('XMLLINT', type : 'string', value: 'xmllint',
- description: 'path to xmllint binary')
+ description: 'Path to xmllint binary')
option('XSLTPROC', type : 'string', value: 'xsltproc',
- description: 'path to xsltproc binary')
+ description: 'Path to xsltproc binary')
option('ZSTD', type : 'string', value: 'zstd',
- description: 'path to zstd binary')
+ description: 'Path to zstd binary')
option('ZIC', type : 'string', value: 'zic',
- description: 'path to zic binary, when cross-compiling')
+ description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v4-0003-Use-consistent-Meson-option-description-formats.patchtext/x-patch; charset=utf-8; name=v4-0003-Use-consistent-Meson-option-description-formats.patchDownload
From 365871a337fe05fedca4b845d5b4625a2616d137 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:11:14 -0500
Subject: [PATCH v4 03/14] Use consistent Meson option description formats
---
meson_options.txt | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index fa823fd088..ac7bcd366e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'Set relation block size in kB')
+ description: 'Relation block size, in kilobytes')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -41,16 +41,16 @@ option('cassert', type : 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
- description : 'Whether to enable tap tests')
+ description : 'Enable TAP tests')
option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'Whether to use atomic operations')
+ description: 'Use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'Whether to use spinlocks')
+ description: 'Use spinlocks')
# Compilation options
@@ -68,16 +68,16 @@ option('darwin_sysroot', type : 'string', value: '',
description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'Whether to embed shared library search path in executables')
+ description: 'Embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'Build with Bonjour support')
+ description: 'Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'Build with BSD Authentication support')
+ description: 'BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
@@ -110,7 +110,7 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'Whether to use llvm')
+ description: 'LLVM support')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
@@ -119,7 +119,7 @@ option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'Build with PAM support')
+ description: 'PAM support')
option('plperl', type : 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
@@ -128,33 +128,33 @@ option('plpython', type : 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'Build with TCL support')
+ description: 'Build with Tcl support (PL/Tcl)')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'Specify TCL version')
+ description: 'Tcl version')
option('readline', type : 'feature', value : 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'Build with SELinux support')
+ description: 'SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'Build with systemd support')
+ description: 'systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'Build contrib/uuid-ossp using LIB')
+ description: 'Use LIB for contrib/uuid-ossp support')
option('zlib', type : 'feature', value: 'auto',
- description: 'Whether to use zlib')
+ description: 'Enable zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'Whether to use zstd')
+ description: 'Enable zstd')
# Programs
--
Tristan Partin
Neon (https://neon.tech)
v4-0004-Attach-colon-to-keyword-argument.patchtext/x-patch; charset=utf-8; name=v4-0004-Attach-colon-to-keyword-argument.patchDownload
From 317c3e213c250d2bdb7aae7433fe9a8c2305fb4b Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:28:48 -0500
Subject: [PATCH v4 04/14] Attach colon to keyword argument
This matches the style found in the rest of the Meson build description.
---
meson_options.txt | 138 +++++++++++++++++++++++-----------------------
1 file changed, 69 insertions(+), 69 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index ac7bcd366e..d2f95cfec3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,27 +2,27 @@
# Data layout influencing options
-option('blocksize', type : 'combo',
- choices : ['1', '2', '4', '8', '16', '32'],
- value : '8',
+option('blocksize', type: 'combo',
+ choices: ['1', '2', '4', '8', '16', '32'],
+ value: '8',
description: 'Relation block size, in kilobytes')
-option('wal_blocksize', type : 'combo',
+option('wal_blocksize', type: 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : 'WAL block size, in kilobytes')
+ description: 'WAL block size, in kilobytes')
-option('segsize', type : 'integer', value : 1,
- description : 'Segment size, in gigabytes')
+option('segsize', type: 'integer', value: 1,
+ description: 'Segment size, in gigabytes')
-option('segsize_blocks', type : 'integer', value: 0,
- description : 'Segment size, in blocks')
+option('segsize_blocks', type: 'integer', value: 0,
+ description: 'Segment size, in blocks')
# Miscellaneous options
-option('krb_srvnam', type : 'string', value : 'postgres',
- description : 'Default Kerberos service principal for GSSAPI')
+option('krb_srvnam', type: 'string', value: 'postgres',
+ description: 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'Use system time zone data in specified directory')
@@ -30,182 +30,182 @@ option('system_tzdata', type: 'string', value: '',
# Defaults
-option('pgport', type : 'integer', value : 5432,
+option('pgport', type: 'integer', value: 5432,
min: 1, max: 65535,
- description : 'Default port number for server and clients')
+ description: 'Default port number for server and clients')
# Developer options
-option('cassert', type : 'boolean', value: false,
+option('cassert', type: 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
-option('tap_tests', type : 'feature', value : 'auto',
- description : 'Enable TAP tests')
+option('tap_tests', type: 'feature', value: 'auto',
+ description: 'Enable TAP tests')
-option('PG_TEST_EXTRA', type : 'string', value: '',
+option('PG_TEST_EXTRA', type: 'string', value: '',
description: 'Enable selected extra tests')
-option('atomics', type : 'boolean', value: true,
+option('atomics', type: 'boolean', value: true,
description: 'Use atomic operations')
-option('spinlocks', type : 'boolean', value: true,
+option('spinlocks', type: 'boolean', value: true,
description: 'Use spinlocks')
# Compilation options
-option('extra_include_dirs', type : 'array', value: [],
+option('extra_include_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for headers')
-option('extra_lib_dirs', type : 'array', value: [],
+option('extra_lib_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for libs')
-option('extra_version', type : 'string', value: '',
+option('extra_version', type: 'string', value: '',
description: 'Append STRING to the PostgreSQL version number')
-option('darwin_sysroot', type : 'string', value: '',
+option('darwin_sysroot', type: 'string', value: '',
description: 'Select a non-default sysroot path')
-option('rpath', type : 'boolean', value: true,
+option('rpath', type: 'boolean', value: true,
description: 'Embed shared library search path in executables')
# External dependencies
-option('bonjour', type : 'feature', value: 'auto',
+option('bonjour', type: 'feature', value: 'auto',
description: 'Bonjour support')
-option('bsd_auth', type : 'feature', value: 'auto',
+option('bsd_auth', type: 'feature', value: 'auto',
description: 'BSD Authentication support')
-option('docs', type : 'feature', value: 'auto',
+option('docs', type: 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
-option('docs_pdf', type : 'feature', value: 'auto',
+option('docs_pdf', type: 'feature', value: 'auto',
description: 'Documentation in PDF format')
-option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
+option('docs_html_style', type: 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
-option('dtrace', type : 'feature', value: 'disabled',
+option('dtrace', type: 'feature', value: 'disabled',
description: 'DTrace support')
-option('gssapi', type : 'feature', value: 'auto',
+option('gssapi', type: 'feature', value: 'auto',
description: 'GSSAPI support')
-option('icu', type : 'feature', value: 'auto',
+option('icu', type: 'feature', value: 'auto',
description: 'ICU support')
-option('ldap', type : 'feature', value: 'auto',
+option('ldap', type: 'feature', value: 'auto',
description: 'LDAP support')
-option('libedit_preferred', type : 'boolean', value: false,
+option('libedit_preferred', type: 'boolean', value: false,
description: 'Prefer BSD Libedit over GNU Readline')
-option('libxml', type : 'feature', value: 'auto',
+option('libxml', type: 'feature', value: 'auto',
description: 'XML support')
-option('libxslt', type : 'feature', value: 'auto',
+option('libxslt', type: 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
-option('llvm', type : 'feature', value: 'disabled',
+option('llvm', type: 'feature', value: 'disabled',
description: 'LLVM support')
-option('lz4', type : 'feature', value: 'auto',
+option('lz4', type: 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
-option('pam', type : 'feature', value: 'auto',
+option('pam', type: 'feature', value: 'auto',
description: 'PAM support')
-option('plperl', type : 'feature', value: 'auto',
+option('plperl', type: 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
-option('plpython', type : 'feature', value: 'auto',
+option('plpython', type: 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
-option('pltcl', type : 'feature', value: 'auto',
+option('pltcl', type: 'feature', value: 'auto',
description: 'Build with Tcl support (PL/Tcl)')
-option('tcl_version', type : 'string', value : 'tcl',
+option('tcl_version', type: 'string', value: 'tcl',
description: 'Tcl version')
-option('readline', type : 'feature', value : 'auto',
+option('readline', type: 'feature', value: 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
-option('selinux', type : 'feature', value : 'disabled',
+option('selinux', type: 'feature', value: 'disabled',
description: 'SELinux support')
-option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
- value : 'auto',
+option('ssl', type: 'combo', choices: ['auto', 'none', 'openssl'],
+ value: 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
-option('systemd', type : 'feature', value: 'auto',
+option('systemd', type: 'feature', value: 'auto',
description: 'systemd support')
-option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
- value : 'none',
+option('uuid', type: 'combo', choices: ['none', 'bsd', 'e2fs', 'ossp'],
+ value: 'none',
description: 'Use LIB for contrib/uuid-ossp support')
-option('zlib', type : 'feature', value: 'auto',
+option('zlib', type: 'feature', value: 'auto',
description: 'Enable zlib')
-option('zstd', type : 'feature', value: 'auto',
+option('zstd', type: 'feature', value: 'auto',
description: 'Enable zstd')
# Programs
-option('BISON', type : 'array', value: ['bison', 'win_bison'],
+option('BISON', type: 'array', value: ['bison', 'win_bison'],
description: 'Path to bison binary')
-option('DTRACE', type : 'string', value: 'dtrace',
+option('DTRACE', type: 'string', value: 'dtrace',
description: 'Path to dtrace binary')
-option('FLEX', type : 'array', value: ['flex', 'win_flex'],
+option('FLEX', type: 'array', value: ['flex', 'win_flex'],
description: 'Path to flex binary')
-option('FOP', type : 'string', value: 'fop',
+option('FOP', type: 'string', value: 'fop',
description: 'Path to fop binary')
-option('GZIP', type : 'string', value: 'gzip',
+option('GZIP', type: 'string', value: 'gzip',
description: 'Path to gzip binary')
-option('LZ4', type : 'string', value: 'lz4',
+option('LZ4', type: 'string', value: 'lz4',
description: 'Path to lz4 binary')
-option('OPENSSL', type : 'string', value: 'openssl',
+option('OPENSSL', type: 'string', value: 'openssl',
description: 'Path to openssl binary')
-option('PERL', type : 'string', value: 'perl',
+option('PERL', type: 'string', value: 'perl',
description: 'Path to perl binary')
-option('PROVE', type : 'string', value: 'prove',
+option('PROVE', type: 'string', value: 'prove',
description: 'Path to prove binary')
-option('PYTHON', type : 'array', value: ['python3', 'python'],
+option('PYTHON', type: 'array', value: ['python3', 'python'],
description: 'Path to python binary')
-option('SED', type : 'string', value: 'gsed',
+option('SED', type: 'string', value: 'gsed',
description: 'Path to sed binary')
-option('STRIP', type : 'string', value: 'strip',
+option('STRIP', type: 'string', value: 'strip',
description: 'Path to strip binary, used for PGXS emulation')
-option('TAR', type : 'string', value: 'tar',
+option('TAR', type: 'string', value: 'tar',
description: 'Path to tar binary')
-option('XMLLINT', type : 'string', value: 'xmllint',
+option('XMLLINT', type: 'string', value: 'xmllint',
description: 'Path to xmllint binary')
-option('XSLTPROC', type : 'string', value: 'xsltproc',
+option('XSLTPROC', type: 'string', value: 'xsltproc',
description: 'Path to xsltproc binary')
-option('ZSTD', type : 'string', value: 'zstd',
+option('ZSTD', type: 'string', value: 'zstd',
description: 'Path to zstd binary')
-option('ZIC', type : 'string', value: 'zic',
+option('ZIC', type: 'string', value: 'zic',
description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v4-0005-Use-the-not_found_dep-constant.patchtext/x-patch; charset=utf-8; name=v4-0005-Use-the-not_found_dep-constant.patchDownload
From 3070be8a712cf447d598d15928128560225d96b4 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:33:12 -0500
Subject: [PATCH v4 05/14] Use the not_found_dep constant
Previously in the build description, a not_found_dep was defined. Make
use of it.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 82f2782673..c2b100bcb5 100644
--- a/meson.build
+++ b/meson.build
@@ -558,7 +558,7 @@ endif
###############################################################
bonjouropt = get_option('bonjour')
-bonjour = dependency('', required : false)
+bonjour = not_found_dep
if cc.check_header('dns_sd.h', required: bonjouropt,
args: test_c_args, include_directories: postgres_inc) and \
cc.has_function('DNSServiceRegister',
--
Tristan Partin
Neon (https://neon.tech)
v4-0006-Remove-old-comment.patchtext/x-patch; charset=utf-8; name=v4-0006-Remove-old-comment.patchDownload
From e275e82caa100cb0d199eebd522dd705be6ad8d4 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:19:46 -0500
Subject: [PATCH v4 06/14] Remove old comment
That portion of code is not run in the Windows case already given the
structure of the surrounding if statement.
---
meson.build | 2 --
1 file changed, 2 deletions(-)
diff --git a/meson.build b/meson.build
index c2b100bcb5..121126a7da 100644
--- a/meson.build
+++ b/meson.build
@@ -722,8 +722,6 @@ choke me
endif
endif
- # XXX: this shouldn't be tested in the windows case, but should be tested in
- # the dependency() success case
if ldap.found() and cc.has_function('ldap_initialize',
dependencies: ldap, args: test_c_args)
cdata.set('HAVE_LDAP_INITIALIZE', 1)
--
Tristan Partin
Neon (https://neon.tech)
v4-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchtext/x-patch; charset=utf-8; name=v4-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchDownload
From 4e4934ee125c06d639de43c8e1f46b63b93813b9 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:27:06 -0500
Subject: [PATCH v4 07/14] Tie adding C++ support to the llvm Meson option
In the event the llvm option is defined to be 'auto', it is possible
that the host machine might not have a C++ compiler. If that is the
case, then we shouldn't continue reaching for the llvm dependency.
---
meson.build | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 121126a7da..52c4b9bba8 100644
--- a/meson.build
+++ b/meson.build
@@ -742,8 +742,8 @@ endif
###############################################################
llvmopt = get_option('llvm')
-if not llvmopt.disabled()
- add_languages('cpp', required: true, native: false)
+llvm = not_found_dep
+if add_languages('cpp', required: llvmopt, native: false)
llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
if llvm.found()
@@ -757,8 +757,6 @@ if not llvmopt.disabled()
ccache = find_program('ccache', native: true, required: false)
clang = find_program(llvm_binpath / 'clang', required: true)
endif
-else
- llvm = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v4-0008-Mention-the-correct-way-to-disable-readline-suppo.patchtext/x-patch; charset=utf-8; name=v4-0008-Mention-the-correct-way-to-disable-readline-suppo.patchDownload
From c01828eed1cc8e9ceec55076aa2cd816d6bb31d7 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 10:27:34 -0500
Subject: [PATCH v4 08/14] Mention the correct way to disable readline support
Using false to disable a feature option is incorrect.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 52c4b9bba8..161513bab3 100644
--- a/meson.build
+++ b/meson.build
@@ -1129,7 +1129,7 @@ if not get_option('readline').disabled()
error('''readline header not found
If you have @0@ already installed, see meson-log/meson-log.txt for details on the
failure. It is possible the compiler isn't looking in the proper directory.
-Use -Dreadline=false to disable readline support.'''.format(readline_dep))
+Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
endif
check_funcs = [
--
Tristan Partin
Neon (https://neon.tech)
v4-0009-Remove-return-code-check.patchtext/x-patch; charset=utf-8; name=v4-0009-Remove-return-code-check.patchDownload
From 21eacba1bf4146ad4fb8bf12069f3bbb583197a3 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:30:54 -0500
Subject: [PATCH v4 09/14] Remove return code check
run_command(check: true) will already handle this.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 161513bab3..94d68a5d94 100644
--- a/meson.build
+++ b/meson.build
@@ -385,7 +385,7 @@ install_files = files('src/tools/install_files')
# https://github.com/mesonbuild/meson/issues/8511
meson_binpath_r = run_command(python, 'src/tools/find_meson', check: true)
-if meson_binpath_r.returncode() != 0 or meson_binpath_r.stdout() == ''
+if meson_binpath_r.stdout() == ''
error('huh, could not run find_meson.\nerrcode: @0@\nstdout: @1@\nstderr: @2@'.format(
meson_binpath_r.returncode(),
meson_binpath_r.stdout(),
--
Tristan Partin
Neon (https://neon.tech)
v4-0010-Fix-some-grammar-usage-in-Meson-comments.patchtext/x-patch; charset=utf-8; name=v4-0010-Fix-some-grammar-usage-in-Meson-comments.patchDownload
From 7ef201bba7476d094ff6bc10b6d971038f08dccc Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:33:18 -0500
Subject: [PATCH v4 10/14] Fix some grammar usage in Meson comments
---
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 94d68a5d94..4b91b75930 100644
--- a/meson.build
+++ b/meson.build
@@ -150,7 +150,7 @@ cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
cdata.set('PG_MAJORVERSION_NUM', pg_version_major)
cdata.set('PG_MINORVERSION_NUM', pg_version_minor)
cdata.set('PG_VERSION_NUM', pg_version_num)
-# PG_VERSION_STR is built later, it depends compiler test results
+# PG_VERSION_STR is built later, it depends on compiler test results
cdata.set_quoted('CONFIGURE_ARGS', '')
@@ -1672,7 +1672,7 @@ if cc.has_function_attribute('visibility:default') and \
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
- # inlineshidden to C code as well... Any either way, we want to put these
+ # inlineshidden to C code as well... And either way, we want to put these
# flags into exported files (pgxs, .pc files).
cflags_mod += '-fvisibility=hidden'
cxxflags_mod += ['-fvisibility=hidden', '-fvisibility-inlines-hidden']
--
Tristan Partin
Neon (https://neon.tech)
v4-0011-Pass-feature-option-through-to-required-kwarg.patchtext/x-patch; charset=utf-8; name=v4-0011-Pass-feature-option-through-to-required-kwarg.patchDownload
From a1986738af20e1cae1ee172427fd5740f207724b Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:38:09 -0500
Subject: [PATCH v4 11/14] Pass feature option through to required kwarg
Meson understands this already. No need to convert it to a boolean.
---
meson.build | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 4b91b75930..5806463138 100644
--- a/meson.build
+++ b/meson.build
@@ -767,8 +767,8 @@ endif
icuopt = get_option('icu')
if not icuopt.disabled()
- icu = dependency('icu-uc', required: icuopt.enabled())
- icu_i18n = dependency('icu-i18n', required: icuopt.enabled())
+ icu = dependency('icu-uc', required: icuopt)
+ icu_i18n = dependency('icu-i18n', required: icuopt)
if icu.found()
cdata.set('USE_ICU', 1)
@@ -1077,7 +1077,7 @@ if not get_option('readline').disabled()
readline = dependency(readline_dep, required: false)
if not readline.found()
readline = cc.find_library(readline_dep,
- required: get_option('readline').enabled(),
+ required: get_option('readline'),
dirs: test_lib_d)
endif
if readline.found()
@@ -2537,7 +2537,7 @@ if not nlsopt.disabled()
# otherwise there'd be lots of
# "Gettext not found, all translation (po) targets will be ignored."
# warnings if not found.
- msgfmt = find_program('msgfmt', required: nlsopt.enabled(), native: true)
+ msgfmt = find_program('msgfmt', required: nlsopt, native: true)
# meson 0.59 has this wrapped in dependency('int')
if (msgfmt.found() and
--
Tristan Partin
Neon (https://neon.tech)
v4-0012-Make-finding-pkg-config-python3-more-robust.patchtext/x-patch; charset=utf-8; name=v4-0012-Make-finding-pkg-config-python3-more-robust.patchDownload
From 56b43d0d66a8aaf057f9c2bc0c0e70e874f9c305 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH v4 12/14] Make finding pkg-config(python3) more robust
It is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.
https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/python.py#L218
---
meson.build | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 5806463138..7c50c7567d 100644
--- a/meson.build
+++ b/meson.build
@@ -1050,15 +1050,17 @@ endif
###############################################################
pyopt = get_option('plpython')
+python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
- python3_dep = not_found_dep
+ python3_inst = pm.find_installation(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
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
+ python3_dep = not_found_dep
+ endif
endif
-else
- python3_dep = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v4-0013-Make-some-Meson-style-more-consistent-with-surrou.patchtext/x-patch; charset=utf-8; name=v4-0013-Make-some-Meson-style-more-consistent-with-surrou.patchDownload
From 917f4b02875c2b076e3f0aede0581b502d574f4a Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:43:51 -0500
Subject: [PATCH v4 13/14] Make some Meson style more consistent with
surrounding code
---
meson.build | 17 ++++++++---------
src/include/meson.build | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/meson.build b/meson.build
index 7c50c7567d..843161d5ee 100644
--- a/meson.build
+++ b/meson.build
@@ -1146,7 +1146,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
foreach func : check_funcs
found = cc.has_function(func, dependencies: [readline],
args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_'+func.to_upper(), found ? 1 : false)
+ cdata.set('HAVE_' + func.to_upper(), found ? 1 : false)
endforeach
check_vars = [
@@ -1156,7 +1156,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
]
foreach var : check_vars
- cdata.set('HAVE_'+var.to_upper(),
+ cdata.set('HAVE_' + var.to_upper(),
cc.has_header_symbol(readline_h, var,
args: test_c_args, include_directories: postgres_inc,
prefix: '#include <stdio.h>',
@@ -1311,7 +1311,7 @@ if sslopt in ['auto', 'openssl']
cdata.set('USE_OPENSSL', 1,
description: 'Define to 1 to build with OpenSSL support. (-Dssl=openssl)')
cdata.set('OPENSSL_API_COMPAT', '0x10001000L',
- description: '''Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.''')
+ description: 'Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.')
ssl_library = 'openssl'
else
ssl = not_found_dep
@@ -1599,8 +1599,7 @@ if cc.links('''
if not buggy_int128
cdata.set('PG_INT128_TYPE', '__int128')
- cdata.set('ALIGNOF_PG_INT128_TYPE', cc.
- alignment('__int128', args: test_c_args))
+ cdata.set('ALIGNOF_PG_INT128_TYPE', cc.alignment('__int128', args: test_c_args))
endif
endif
@@ -1642,8 +1641,8 @@ endif
# We use <stdbool.h> if we have it and it declares type bool as having
# size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
if cc.has_type('_Bool', args: test_c_args) \
- and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
- and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
+ and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
+ and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
cdata.set('HAVE__BOOL', 1)
cdata.set('PG_USE_STDBOOL', 1)
endif
@@ -1670,7 +1669,7 @@ endforeach
if cc.has_function_attribute('visibility:default') and \
- cc.has_function_attribute('visibility:hidden')
+ cc.has_function_attribute('visibility:hidden')
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
@@ -3046,7 +3045,7 @@ meson_install_args = meson_args + ['install'] + {
'muon': []
}[meson_impl]
-# setup tests should be run first,
+# setup tests should be run first,
# so define priority for these
setup_tests_priority = 100
test('tmp_install',
diff --git a/src/include/meson.build b/src/include/meson.build
index 33c0a5562c..d7e1ecd4c9 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -89,7 +89,7 @@ install_headers(
'c.h',
'port.h',
'postgres_fe.h',
- install_dir: dir_include_internal
+ install_dir: dir_include_internal,
)
install_headers(
--
Tristan Partin
Neon (https://neon.tech)
v4-0014-Use-a-better-error-message-in-an-impossible-case.patchtext/x-patch; charset=utf-8; name=v4-0014-Use-a-better-error-message-in-an-impossible-case.patchDownload
From e0aa122ac46a34d02384eed27b6c5598b5e8e16a Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:48:18 -0500
Subject: [PATCH v4 14/14] Use a better error message in an impossible case
Meson validates 'choice' options for us, so technically this case is
impossible. A better error message helps people reading the code
understand what is going on in that branch.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 843161d5ee..0e0bdaddc5 100644
--- a/meson.build
+++ b/meson.build
@@ -1346,7 +1346,7 @@ if uuidopt != 'none'
uuidfunc = 'uuid_export'
uuidheader = 'uuid.h'
else
- error('huh')
+ error('unknown uuid build option value: @0@'.format(uuidopt))
endif
if not cc.has_header_symbol(uuidheader, uuidfunc, args: test_c_args, dependencies: uuid)
--
Tristan Partin
Neon (https://neon.tech)
Forgot that I had gotten a review from a Meson maintainer. The last two
patches in this set are new. One is just a simple spelling correction.
--
Tristan Partin
Neon (https://neon.tech)
Attachments:
v5-0001-Remove-triple-quoted-strings.patchtext/x-patch; charset=utf-8; name=v5-0001-Remove-triple-quoted-strings.patchDownload
From c20ece79c625c8ca33fee26791ab40c311a5c97e Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 07:55:03 -0500
Subject: [PATCH v5 01/16] Remove triple-quoted strings
Triple-quoted strings are for multiline strings in Meson. None of the
descriptions that got changed were multiline and the entire file uses
single-line descriptions.
---
meson_options.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 5b44a8829d..1ea9729dc2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,19 +10,19 @@ option('blocksize', type : 'combo',
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : '''WAL block size, in kilobytes''')
+ description : 'WAL block size, in kilobytes')
option('segsize', type : 'integer', value : 1,
- description : '''Segment size, in gigabytes''')
+ description : 'Segment size, in gigabytes')
option('segsize_blocks', type : 'integer', value: 0,
- description : '''Segment size, in blocks''')
+ description : 'Segment size, in blocks')
# Miscellaneous options
option('krb_srvnam', type : 'string', value : 'postgres',
- description : '''Default Kerberos service principal for GSSAPI''')
+ description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'use system time zone data in specified directory')
@@ -32,7 +32,7 @@ option('system_tzdata', type: 'string', value: '',
option('pgport', type : 'integer', value : 5432,
min: 1, max: 65535,
- description : '''Default port number for server and clients''')
+ description : 'Default port number for server and clients')
# Developer options
--
Tristan Partin
Neon (https://neon.tech)
v5-0002-Use-consistent-casing-in-Meson-option-description.patchtext/x-patch; charset=utf-8; name=v5-0002-Use-consistent-casing-in-Meson-option-description.patchDownload
From 230bfbb6029e520fc980ad9c0e6ff7369ca0f939 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:03:31 -0500
Subject: [PATCH v5 02/16] Use consistent casing in Meson option descriptions
Meson itself uses capital letters for option descriptions, so follow
that.
---
meson_options.txt | 90 +++++++++++++++++++++++------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 1ea9729dc2..fa823fd088 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'set relation block size in kB')
+ description: 'Set relation block size in kB')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -25,7 +25,7 @@ option('krb_srvnam', type : 'string', value : 'postgres',
description : 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
- description: 'use system time zone data in specified directory')
+ description: 'Use system time zone data in specified directory')
# Defaults
@@ -38,7 +38,7 @@ option('pgport', type : 'integer', value : 5432,
# Developer options
option('cassert', type : 'boolean', value: false,
- description: 'enable assertion checks (for debugging)')
+ description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
description : 'Whether to enable tap tests')
@@ -47,43 +47,43 @@ option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'whether to use atomic operations')
+ description: 'Whether to use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'whether to use spinlocks')
+ description: 'Whether to use spinlocks')
# Compilation options
option('extra_include_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for headers')
+ description: 'Non-default directories to be searched for headers')
option('extra_lib_dirs', type : 'array', value: [],
- description: 'non-default directories to be searched for libs')
+ description: 'Non-default directories to be searched for libs')
option('extra_version', type : 'string', value: '',
- description: 'append STRING to the PostgreSQL version number')
+ description: 'Append STRING to the PostgreSQL version number')
option('darwin_sysroot', type : 'string', value: '',
- description: 'select a non-default sysroot path')
+ description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'whether to embed shared library search path in executables')
+ description: 'Whether to embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'build with Bonjour support')
+ description: 'Build with Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'build with BSD Authentication support')
+ description: 'Build with BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
- description: 'documentation in HTML and man page format')
+ description: 'Documentation in HTML and man page format')
option('docs_pdf', type : 'feature', value: 'auto',
- description: 'documentation in PDF format')
+ description: 'Documentation in PDF format')
option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
@@ -110,102 +110,102 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'whether to use llvm')
+ description: 'Whether to use llvm')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
- description: 'native language support')
+ description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'build with PAM support')
+ description: 'Build with PAM support')
option('plperl', type : 'feature', value: 'auto',
- description: 'build Perl modules (PL/Perl)')
+ description: 'Build Perl modules (PL/Perl)')
option('plpython', type : 'feature', value: 'auto',
- description: 'build Python modules (PL/Python)')
+ description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'build with TCL support')
+ description: 'Build with TCL support')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'specify TCL version')
+ description: 'Specify TCL version')
option('readline', type : 'feature', value : 'auto',
- description: 'use GNU Readline or BSD Libedit for editing')
+ description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'build with SELinux support')
+ description: 'Build with SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
- description: 'use LIB for SSL/TLS support (openssl)')
+ description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'build with systemd support')
+ description: 'Build with systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'build contrib/uuid-ossp using LIB')
+ description: 'Build contrib/uuid-ossp using LIB')
option('zlib', type : 'feature', value: 'auto',
- description: 'whether to use zlib')
+ description: 'Whether to use zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'whether to use zstd')
+ description: 'Whether to use zstd')
# Programs
option('BISON', type : 'array', value: ['bison', 'win_bison'],
- description: 'path to bison binary')
+ description: 'Path to bison binary')
option('DTRACE', type : 'string', value: 'dtrace',
- description: 'path to dtrace binary')
+ description: 'Path to dtrace binary')
option('FLEX', type : 'array', value: ['flex', 'win_flex'],
- description: 'path to flex binary')
+ description: 'Path to flex binary')
option('FOP', type : 'string', value: 'fop',
- description: 'path to fop binary')
+ description: 'Path to fop binary')
option('GZIP', type : 'string', value: 'gzip',
- description: 'path to gzip binary')
+ description: 'Path to gzip binary')
option('LZ4', type : 'string', value: 'lz4',
- description: 'path to lz4 binary')
+ description: 'Path to lz4 binary')
option('OPENSSL', type : 'string', value: 'openssl',
- description: 'path to openssl binary')
+ description: 'Path to openssl binary')
option('PERL', type : 'string', value: 'perl',
- description: 'path to perl binary')
+ description: 'Path to perl binary')
option('PROVE', type : 'string', value: 'prove',
- description: 'path to prove binary')
+ description: 'Path to prove binary')
option('PYTHON', type : 'array', value: ['python3', 'python'],
- description: 'path to python binary')
+ description: 'Path to python binary')
option('SED', type : 'string', value: 'gsed',
- description: 'path to sed binary')
+ description: 'Path to sed binary')
option('STRIP', type : 'string', value: 'strip',
- description: 'path to strip binary, used for PGXS emulation')
+ description: 'Path to strip binary, used for PGXS emulation')
option('TAR', type : 'string', value: 'tar',
- description: 'path to tar binary')
+ description: 'Path to tar binary')
option('XMLLINT', type : 'string', value: 'xmllint',
- description: 'path to xmllint binary')
+ description: 'Path to xmllint binary')
option('XSLTPROC', type : 'string', value: 'xsltproc',
- description: 'path to xsltproc binary')
+ description: 'Path to xsltproc binary')
option('ZSTD', type : 'string', value: 'zstd',
- description: 'path to zstd binary')
+ description: 'Path to zstd binary')
option('ZIC', type : 'string', value: 'zic',
- description: 'path to zic binary, when cross-compiling')
+ description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v5-0003-Use-consistent-Meson-option-description-formats.patchtext/x-patch; charset=utf-8; name=v5-0003-Use-consistent-Meson-option-description-formats.patchDownload
From 365871a337fe05fedca4b845d5b4625a2616d137 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:11:14 -0500
Subject: [PATCH v5 03/16] Use consistent Meson option description formats
---
meson_options.txt | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index fa823fd088..ac7bcd366e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,7 @@
option('blocksize', type : 'combo',
choices : ['1', '2', '4', '8', '16', '32'],
value : '8',
- description: 'Set relation block size in kB')
+ description: 'Relation block size, in kilobytes')
option('wal_blocksize', type : 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
@@ -41,16 +41,16 @@ option('cassert', type : 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
option('tap_tests', type : 'feature', value : 'auto',
- description : 'Whether to enable tap tests')
+ description : 'Enable TAP tests')
option('PG_TEST_EXTRA', type : 'string', value: '',
description: 'Enable selected extra tests')
option('atomics', type : 'boolean', value: true,
- description: 'Whether to use atomic operations')
+ description: 'Use atomic operations')
option('spinlocks', type : 'boolean', value: true,
- description: 'Whether to use spinlocks')
+ description: 'Use spinlocks')
# Compilation options
@@ -68,16 +68,16 @@ option('darwin_sysroot', type : 'string', value: '',
description: 'Select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
- description: 'Whether to embed shared library search path in executables')
+ description: 'Embed shared library search path in executables')
# External dependencies
option('bonjour', type : 'feature', value: 'auto',
- description: 'Build with Bonjour support')
+ description: 'Bonjour support')
option('bsd_auth', type : 'feature', value: 'auto',
- description: 'Build with BSD Authentication support')
+ description: 'BSD Authentication support')
option('docs', type : 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
@@ -110,7 +110,7 @@ option('libxslt', type : 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
option('llvm', type : 'feature', value: 'disabled',
- description: 'Whether to use llvm')
+ description: 'LLVM support')
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
@@ -119,7 +119,7 @@ option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
option('pam', type : 'feature', value: 'auto',
- description: 'Build with PAM support')
+ description: 'PAM support')
option('plperl', type : 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
@@ -128,33 +128,33 @@ option('plpython', type : 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
option('pltcl', type : 'feature', value: 'auto',
- description: 'Build with TCL support')
+ description: 'Build with Tcl support (PL/Tcl)')
option('tcl_version', type : 'string', value : 'tcl',
- description: 'Specify TCL version')
+ description: 'Tcl version')
option('readline', type : 'feature', value : 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
option('selinux', type : 'feature', value : 'disabled',
- description: 'Build with SELinux support')
+ description: 'SELinux support')
option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
value : 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
option('systemd', type : 'feature', value: 'auto',
- description: 'Build with systemd support')
+ description: 'systemd support')
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
value : 'none',
- description: 'Build contrib/uuid-ossp using LIB')
+ description: 'Use LIB for contrib/uuid-ossp support')
option('zlib', type : 'feature', value: 'auto',
- description: 'Whether to use zlib')
+ description: 'Enable zlib')
option('zstd', type : 'feature', value: 'auto',
- description: 'Whether to use zstd')
+ description: 'Enable zstd')
# Programs
--
Tristan Partin
Neon (https://neon.tech)
v5-0004-Attach-colon-to-keyword-argument.patchtext/x-patch; charset=utf-8; name=v5-0004-Attach-colon-to-keyword-argument.patchDownload
From 317c3e213c250d2bdb7aae7433fe9a8c2305fb4b Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:28:48 -0500
Subject: [PATCH v5 04/16] Attach colon to keyword argument
This matches the style found in the rest of the Meson build description.
---
meson_options.txt | 138 +++++++++++++++++++++++-----------------------
1 file changed, 69 insertions(+), 69 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index ac7bcd366e..d2f95cfec3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,27 +2,27 @@
# Data layout influencing options
-option('blocksize', type : 'combo',
- choices : ['1', '2', '4', '8', '16', '32'],
- value : '8',
+option('blocksize', type: 'combo',
+ choices: ['1', '2', '4', '8', '16', '32'],
+ value: '8',
description: 'Relation block size, in kilobytes')
-option('wal_blocksize', type : 'combo',
+option('wal_blocksize', type: 'combo',
choices: ['1', '2', '4', '8', '16', '32', '64'],
value: '8',
- description : 'WAL block size, in kilobytes')
+ description: 'WAL block size, in kilobytes')
-option('segsize', type : 'integer', value : 1,
- description : 'Segment size, in gigabytes')
+option('segsize', type: 'integer', value: 1,
+ description: 'Segment size, in gigabytes')
-option('segsize_blocks', type : 'integer', value: 0,
- description : 'Segment size, in blocks')
+option('segsize_blocks', type: 'integer', value: 0,
+ description: 'Segment size, in blocks')
# Miscellaneous options
-option('krb_srvnam', type : 'string', value : 'postgres',
- description : 'Default Kerberos service principal for GSSAPI')
+option('krb_srvnam', type: 'string', value: 'postgres',
+ description: 'Default Kerberos service principal for GSSAPI')
option('system_tzdata', type: 'string', value: '',
description: 'Use system time zone data in specified directory')
@@ -30,182 +30,182 @@ option('system_tzdata', type: 'string', value: '',
# Defaults
-option('pgport', type : 'integer', value : 5432,
+option('pgport', type: 'integer', value: 5432,
min: 1, max: 65535,
- description : 'Default port number for server and clients')
+ description: 'Default port number for server and clients')
# Developer options
-option('cassert', type : 'boolean', value: false,
+option('cassert', type: 'boolean', value: false,
description: 'Enable assertion checks (for debugging)')
-option('tap_tests', type : 'feature', value : 'auto',
- description : 'Enable TAP tests')
+option('tap_tests', type: 'feature', value: 'auto',
+ description: 'Enable TAP tests')
-option('PG_TEST_EXTRA', type : 'string', value: '',
+option('PG_TEST_EXTRA', type: 'string', value: '',
description: 'Enable selected extra tests')
-option('atomics', type : 'boolean', value: true,
+option('atomics', type: 'boolean', value: true,
description: 'Use atomic operations')
-option('spinlocks', type : 'boolean', value: true,
+option('spinlocks', type: 'boolean', value: true,
description: 'Use spinlocks')
# Compilation options
-option('extra_include_dirs', type : 'array', value: [],
+option('extra_include_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for headers')
-option('extra_lib_dirs', type : 'array', value: [],
+option('extra_lib_dirs', type: 'array', value: [],
description: 'Non-default directories to be searched for libs')
-option('extra_version', type : 'string', value: '',
+option('extra_version', type: 'string', value: '',
description: 'Append STRING to the PostgreSQL version number')
-option('darwin_sysroot', type : 'string', value: '',
+option('darwin_sysroot', type: 'string', value: '',
description: 'Select a non-default sysroot path')
-option('rpath', type : 'boolean', value: true,
+option('rpath', type: 'boolean', value: true,
description: 'Embed shared library search path in executables')
# External dependencies
-option('bonjour', type : 'feature', value: 'auto',
+option('bonjour', type: 'feature', value: 'auto',
description: 'Bonjour support')
-option('bsd_auth', type : 'feature', value: 'auto',
+option('bsd_auth', type: 'feature', value: 'auto',
description: 'BSD Authentication support')
-option('docs', type : 'feature', value: 'auto',
+option('docs', type: 'feature', value: 'auto',
description: 'Documentation in HTML and man page format')
-option('docs_pdf', type : 'feature', value: 'auto',
+option('docs_pdf', type: 'feature', value: 'auto',
description: 'Documentation in PDF format')
-option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
+option('docs_html_style', type: 'combo', choices: ['simple', 'website'],
description: 'CSS stylesheet for HTML documentation')
-option('dtrace', type : 'feature', value: 'disabled',
+option('dtrace', type: 'feature', value: 'disabled',
description: 'DTrace support')
-option('gssapi', type : 'feature', value: 'auto',
+option('gssapi', type: 'feature', value: 'auto',
description: 'GSSAPI support')
-option('icu', type : 'feature', value: 'auto',
+option('icu', type: 'feature', value: 'auto',
description: 'ICU support')
-option('ldap', type : 'feature', value: 'auto',
+option('ldap', type: 'feature', value: 'auto',
description: 'LDAP support')
-option('libedit_preferred', type : 'boolean', value: false,
+option('libedit_preferred', type: 'boolean', value: false,
description: 'Prefer BSD Libedit over GNU Readline')
-option('libxml', type : 'feature', value: 'auto',
+option('libxml', type: 'feature', value: 'auto',
description: 'XML support')
-option('libxslt', type : 'feature', value: 'auto',
+option('libxslt', type: 'feature', value: 'auto',
description: 'XSLT support in contrib/xml2')
-option('llvm', type : 'feature', value: 'disabled',
+option('llvm', type: 'feature', value: 'disabled',
description: 'LLVM support')
-option('lz4', type : 'feature', value: 'auto',
+option('lz4', type: 'feature', value: 'auto',
description: 'LZ4 support')
option('nls', type: 'feature', value: 'auto',
description: 'Native language support')
-option('pam', type : 'feature', value: 'auto',
+option('pam', type: 'feature', value: 'auto',
description: 'PAM support')
-option('plperl', type : 'feature', value: 'auto',
+option('plperl', type: 'feature', value: 'auto',
description: 'Build Perl modules (PL/Perl)')
-option('plpython', type : 'feature', value: 'auto',
+option('plpython', type: 'feature', value: 'auto',
description: 'Build Python modules (PL/Python)')
-option('pltcl', type : 'feature', value: 'auto',
+option('pltcl', type: 'feature', value: 'auto',
description: 'Build with Tcl support (PL/Tcl)')
-option('tcl_version', type : 'string', value : 'tcl',
+option('tcl_version', type: 'string', value: 'tcl',
description: 'Tcl version')
-option('readline', type : 'feature', value : 'auto',
+option('readline', type: 'feature', value: 'auto',
description: 'Use GNU Readline or BSD Libedit for editing')
-option('selinux', type : 'feature', value : 'disabled',
+option('selinux', type: 'feature', value: 'disabled',
description: 'SELinux support')
-option('ssl', type : 'combo', choices : ['auto', 'none', 'openssl'],
- value : 'auto',
+option('ssl', type: 'combo', choices: ['auto', 'none', 'openssl'],
+ value: 'auto',
description: 'Use LIB for SSL/TLS support (openssl)')
-option('systemd', type : 'feature', value: 'auto',
+option('systemd', type: 'feature', value: 'auto',
description: 'systemd support')
-option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
- value : 'none',
+option('uuid', type: 'combo', choices: ['none', 'bsd', 'e2fs', 'ossp'],
+ value: 'none',
description: 'Use LIB for contrib/uuid-ossp support')
-option('zlib', type : 'feature', value: 'auto',
+option('zlib', type: 'feature', value: 'auto',
description: 'Enable zlib')
-option('zstd', type : 'feature', value: 'auto',
+option('zstd', type: 'feature', value: 'auto',
description: 'Enable zstd')
# Programs
-option('BISON', type : 'array', value: ['bison', 'win_bison'],
+option('BISON', type: 'array', value: ['bison', 'win_bison'],
description: 'Path to bison binary')
-option('DTRACE', type : 'string', value: 'dtrace',
+option('DTRACE', type: 'string', value: 'dtrace',
description: 'Path to dtrace binary')
-option('FLEX', type : 'array', value: ['flex', 'win_flex'],
+option('FLEX', type: 'array', value: ['flex', 'win_flex'],
description: 'Path to flex binary')
-option('FOP', type : 'string', value: 'fop',
+option('FOP', type: 'string', value: 'fop',
description: 'Path to fop binary')
-option('GZIP', type : 'string', value: 'gzip',
+option('GZIP', type: 'string', value: 'gzip',
description: 'Path to gzip binary')
-option('LZ4', type : 'string', value: 'lz4',
+option('LZ4', type: 'string', value: 'lz4',
description: 'Path to lz4 binary')
-option('OPENSSL', type : 'string', value: 'openssl',
+option('OPENSSL', type: 'string', value: 'openssl',
description: 'Path to openssl binary')
-option('PERL', type : 'string', value: 'perl',
+option('PERL', type: 'string', value: 'perl',
description: 'Path to perl binary')
-option('PROVE', type : 'string', value: 'prove',
+option('PROVE', type: 'string', value: 'prove',
description: 'Path to prove binary')
-option('PYTHON', type : 'array', value: ['python3', 'python'],
+option('PYTHON', type: 'array', value: ['python3', 'python'],
description: 'Path to python binary')
-option('SED', type : 'string', value: 'gsed',
+option('SED', type: 'string', value: 'gsed',
description: 'Path to sed binary')
-option('STRIP', type : 'string', value: 'strip',
+option('STRIP', type: 'string', value: 'strip',
description: 'Path to strip binary, used for PGXS emulation')
-option('TAR', type : 'string', value: 'tar',
+option('TAR', type: 'string', value: 'tar',
description: 'Path to tar binary')
-option('XMLLINT', type : 'string', value: 'xmllint',
+option('XMLLINT', type: 'string', value: 'xmllint',
description: 'Path to xmllint binary')
-option('XSLTPROC', type : 'string', value: 'xsltproc',
+option('XSLTPROC', type: 'string', value: 'xsltproc',
description: 'Path to xsltproc binary')
-option('ZSTD', type : 'string', value: 'zstd',
+option('ZSTD', type: 'string', value: 'zstd',
description: 'Path to zstd binary')
-option('ZIC', type : 'string', value: 'zic',
+option('ZIC', type: 'string', value: 'zic',
description: 'Path to zic binary, when cross-compiling')
--
Tristan Partin
Neon (https://neon.tech)
v5-0005-Use-the-not_found_dep-constant.patchtext/x-patch; charset=utf-8; name=v5-0005-Use-the-not_found_dep-constant.patchDownload
From 3070be8a712cf447d598d15928128560225d96b4 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 08:33:12 -0500
Subject: [PATCH v5 05/16] Use the not_found_dep constant
Previously in the build description, a not_found_dep was defined. Make
use of it.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 82f2782673..c2b100bcb5 100644
--- a/meson.build
+++ b/meson.build
@@ -558,7 +558,7 @@ endif
###############################################################
bonjouropt = get_option('bonjour')
-bonjour = dependency('', required : false)
+bonjour = not_found_dep
if cc.check_header('dns_sd.h', required: bonjouropt,
args: test_c_args, include_directories: postgres_inc) and \
cc.has_function('DNSServiceRegister',
--
Tristan Partin
Neon (https://neon.tech)
v5-0006-Remove-old-comment.patchtext/x-patch; charset=utf-8; name=v5-0006-Remove-old-comment.patchDownload
From e275e82caa100cb0d199eebd522dd705be6ad8d4 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:19:46 -0500
Subject: [PATCH v5 06/16] Remove old comment
That portion of code is not run in the Windows case already given the
structure of the surrounding if statement.
---
meson.build | 2 --
1 file changed, 2 deletions(-)
diff --git a/meson.build b/meson.build
index c2b100bcb5..121126a7da 100644
--- a/meson.build
+++ b/meson.build
@@ -722,8 +722,6 @@ choke me
endif
endif
- # XXX: this shouldn't be tested in the windows case, but should be tested in
- # the dependency() success case
if ldap.found() and cc.has_function('ldap_initialize',
dependencies: ldap, args: test_c_args)
cdata.set('HAVE_LDAP_INITIALIZE', 1)
--
Tristan Partin
Neon (https://neon.tech)
v5-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchtext/x-patch; charset=utf-8; name=v5-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patchDownload
From 4e4934ee125c06d639de43c8e1f46b63b93813b9 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 09:27:06 -0500
Subject: [PATCH v5 07/16] Tie adding C++ support to the llvm Meson option
In the event the llvm option is defined to be 'auto', it is possible
that the host machine might not have a C++ compiler. If that is the
case, then we shouldn't continue reaching for the llvm dependency.
---
meson.build | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 121126a7da..52c4b9bba8 100644
--- a/meson.build
+++ b/meson.build
@@ -742,8 +742,8 @@ endif
###############################################################
llvmopt = get_option('llvm')
-if not llvmopt.disabled()
- add_languages('cpp', required: true, native: false)
+llvm = not_found_dep
+if add_languages('cpp', required: llvmopt, native: false)
llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
if llvm.found()
@@ -757,8 +757,6 @@ if not llvmopt.disabled()
ccache = find_program('ccache', native: true, required: false)
clang = find_program(llvm_binpath / 'clang', required: true)
endif
-else
- llvm = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v5-0008-Mention-the-correct-way-to-disable-readline-suppo.patchtext/x-patch; charset=utf-8; name=v5-0008-Mention-the-correct-way-to-disable-readline-suppo.patchDownload
From c01828eed1cc8e9ceec55076aa2cd816d6bb31d7 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 16 May 2023 10:27:34 -0500
Subject: [PATCH v5 08/16] Mention the correct way to disable readline support
Using false to disable a feature option is incorrect.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 52c4b9bba8..161513bab3 100644
--- a/meson.build
+++ b/meson.build
@@ -1129,7 +1129,7 @@ if not get_option('readline').disabled()
error('''readline header not found
If you have @0@ already installed, see meson-log/meson-log.txt for details on the
failure. It is possible the compiler isn't looking in the proper directory.
-Use -Dreadline=false to disable readline support.'''.format(readline_dep))
+Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
endif
check_funcs = [
--
Tristan Partin
Neon (https://neon.tech)
v5-0009-Remove-return-code-check.patchtext/x-patch; charset=utf-8; name=v5-0009-Remove-return-code-check.patchDownload
From 21eacba1bf4146ad4fb8bf12069f3bbb583197a3 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:30:54 -0500
Subject: [PATCH v5 09/16] Remove return code check
run_command(check: true) will already handle this.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 161513bab3..94d68a5d94 100644
--- a/meson.build
+++ b/meson.build
@@ -385,7 +385,7 @@ install_files = files('src/tools/install_files')
# https://github.com/mesonbuild/meson/issues/8511
meson_binpath_r = run_command(python, 'src/tools/find_meson', check: true)
-if meson_binpath_r.returncode() != 0 or meson_binpath_r.stdout() == ''
+if meson_binpath_r.stdout() == ''
error('huh, could not run find_meson.\nerrcode: @0@\nstdout: @1@\nstderr: @2@'.format(
meson_binpath_r.returncode(),
meson_binpath_r.stdout(),
--
Tristan Partin
Neon (https://neon.tech)
v5-0010-Fix-some-grammar-usage-in-Meson-comments.patchtext/x-patch; charset=utf-8; name=v5-0010-Fix-some-grammar-usage-in-Meson-comments.patchDownload
From 7ef201bba7476d094ff6bc10b6d971038f08dccc Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:33:18 -0500
Subject: [PATCH v5 10/16] Fix some grammar usage in Meson comments
---
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 94d68a5d94..4b91b75930 100644
--- a/meson.build
+++ b/meson.build
@@ -150,7 +150,7 @@ cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
cdata.set('PG_MAJORVERSION_NUM', pg_version_major)
cdata.set('PG_MINORVERSION_NUM', pg_version_minor)
cdata.set('PG_VERSION_NUM', pg_version_num)
-# PG_VERSION_STR is built later, it depends compiler test results
+# PG_VERSION_STR is built later, it depends on compiler test results
cdata.set_quoted('CONFIGURE_ARGS', '')
@@ -1672,7 +1672,7 @@ if cc.has_function_attribute('visibility:default') and \
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
- # inlineshidden to C code as well... Any either way, we want to put these
+ # inlineshidden to C code as well... And either way, we want to put these
# flags into exported files (pgxs, .pc files).
cflags_mod += '-fvisibility=hidden'
cxxflags_mod += ['-fvisibility=hidden', '-fvisibility-inlines-hidden']
--
Tristan Partin
Neon (https://neon.tech)
v5-0011-Pass-feature-option-through-to-required-kwarg.patchtext/x-patch; charset=utf-8; name=v5-0011-Pass-feature-option-through-to-required-kwarg.patchDownload
From a1986738af20e1cae1ee172427fd5740f207724b Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:38:09 -0500
Subject: [PATCH v5 11/16] Pass feature option through to required kwarg
Meson understands this already. No need to convert it to a boolean.
---
meson.build | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 4b91b75930..5806463138 100644
--- a/meson.build
+++ b/meson.build
@@ -767,8 +767,8 @@ endif
icuopt = get_option('icu')
if not icuopt.disabled()
- icu = dependency('icu-uc', required: icuopt.enabled())
- icu_i18n = dependency('icu-i18n', required: icuopt.enabled())
+ icu = dependency('icu-uc', required: icuopt)
+ icu_i18n = dependency('icu-i18n', required: icuopt)
if icu.found()
cdata.set('USE_ICU', 1)
@@ -1077,7 +1077,7 @@ if not get_option('readline').disabled()
readline = dependency(readline_dep, required: false)
if not readline.found()
readline = cc.find_library(readline_dep,
- required: get_option('readline').enabled(),
+ required: get_option('readline'),
dirs: test_lib_d)
endif
if readline.found()
@@ -2537,7 +2537,7 @@ if not nlsopt.disabled()
# otherwise there'd be lots of
# "Gettext not found, all translation (po) targets will be ignored."
# warnings if not found.
- msgfmt = find_program('msgfmt', required: nlsopt.enabled(), native: true)
+ msgfmt = find_program('msgfmt', required: nlsopt, native: true)
# meson 0.59 has this wrapped in dependency('int')
if (msgfmt.found() and
--
Tristan Partin
Neon (https://neon.tech)
v5-0012-Make-finding-pkg-config-python3-more-robust.patchtext/x-patch; charset=utf-8; name=v5-0012-Make-finding-pkg-config-python3-more-robust.patchDownload
From 56b43d0d66a8aaf057f9c2bc0c0e70e874f9c305 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH v5 12/16] Make finding pkg-config(python3) more robust
It is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.
https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/python.py#L218
---
meson.build | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 5806463138..7c50c7567d 100644
--- a/meson.build
+++ b/meson.build
@@ -1050,15 +1050,17 @@ endif
###############################################################
pyopt = get_option('plpython')
+python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
- python3_dep = not_found_dep
+ python3_inst = pm.find_installation(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
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
+ python3_dep = not_found_dep
+ endif
endif
-else
- python3_dep = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
v5-0013-Make-some-Meson-style-more-consistent-with-surrou.patchtext/x-patch; charset=utf-8; name=v5-0013-Make-some-Meson-style-more-consistent-with-surrou.patchDownload
From 917f4b02875c2b076e3f0aede0581b502d574f4a Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:43:51 -0500
Subject: [PATCH v5 13/16] Make some Meson style more consistent with
surrounding code
---
meson.build | 17 ++++++++---------
src/include/meson.build | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/meson.build b/meson.build
index 7c50c7567d..843161d5ee 100644
--- a/meson.build
+++ b/meson.build
@@ -1146,7 +1146,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
foreach func : check_funcs
found = cc.has_function(func, dependencies: [readline],
args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_'+func.to_upper(), found ? 1 : false)
+ cdata.set('HAVE_' + func.to_upper(), found ? 1 : false)
endforeach
check_vars = [
@@ -1156,7 +1156,7 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
]
foreach var : check_vars
- cdata.set('HAVE_'+var.to_upper(),
+ cdata.set('HAVE_' + var.to_upper(),
cc.has_header_symbol(readline_h, var,
args: test_c_args, include_directories: postgres_inc,
prefix: '#include <stdio.h>',
@@ -1311,7 +1311,7 @@ if sslopt in ['auto', 'openssl']
cdata.set('USE_OPENSSL', 1,
description: 'Define to 1 to build with OpenSSL support. (-Dssl=openssl)')
cdata.set('OPENSSL_API_COMPAT', '0x10001000L',
- description: '''Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.''')
+ description: 'Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.')
ssl_library = 'openssl'
else
ssl = not_found_dep
@@ -1599,8 +1599,7 @@ if cc.links('''
if not buggy_int128
cdata.set('PG_INT128_TYPE', '__int128')
- cdata.set('ALIGNOF_PG_INT128_TYPE', cc.
- alignment('__int128', args: test_c_args))
+ cdata.set('ALIGNOF_PG_INT128_TYPE', cc.alignment('__int128', args: test_c_args))
endif
endif
@@ -1642,8 +1641,8 @@ endif
# We use <stdbool.h> if we have it and it declares type bool as having
# size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
if cc.has_type('_Bool', args: test_c_args) \
- and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
- and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
+ and cc.has_type('bool', prefix: '#include <stdbool.h>', args: test_c_args) \
+ and cc.sizeof('bool', prefix: '#include <stdbool.h>', args: test_c_args) == 1
cdata.set('HAVE__BOOL', 1)
cdata.set('PG_USE_STDBOOL', 1)
endif
@@ -1670,7 +1669,7 @@ endforeach
if cc.has_function_attribute('visibility:default') and \
- cc.has_function_attribute('visibility:hidden')
+ cc.has_function_attribute('visibility:hidden')
cdata.set('HAVE_VISIBILITY_ATTRIBUTE', 1)
# Only newer versions of meson know not to apply gnu_symbol_visibility =
@@ -3046,7 +3045,7 @@ meson_install_args = meson_args + ['install'] + {
'muon': []
}[meson_impl]
-# setup tests should be run first,
+# setup tests should be run first,
# so define priority for these
setup_tests_priority = 100
test('tmp_install',
diff --git a/src/include/meson.build b/src/include/meson.build
index 33c0a5562c..d7e1ecd4c9 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -89,7 +89,7 @@ install_headers(
'c.h',
'port.h',
'postgres_fe.h',
- install_dir: dir_include_internal
+ install_dir: dir_include_internal,
)
install_headers(
--
Tristan Partin
Neon (https://neon.tech)
v5-0014-Use-a-better-error-message-in-an-impossible-case.patchtext/x-patch; charset=utf-8; name=v5-0014-Use-a-better-error-message-in-an-impossible-case.patchDownload
From e0aa122ac46a34d02384eed27b6c5598b5e8e16a Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:48:18 -0500
Subject: [PATCH v5 14/16] Use a better error message in an impossible case
Meson validates 'choice' options for us, so technically this case is
impossible. A better error message helps people reading the code
understand what is going on in that branch.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 843161d5ee..0e0bdaddc5 100644
--- a/meson.build
+++ b/meson.build
@@ -1346,7 +1346,7 @@ if uuidopt != 'none'
uuidfunc = 'uuid_export'
uuidheader = 'uuid.h'
else
- error('huh')
+ error('unknown uuid build option value: @0@'.format(uuidopt))
endif
if not cc.has_header_symbol(uuidheader, uuidfunc, args: test_c_args, dependencies: uuid)
--
Tristan Partin
Neon (https://neon.tech)
v5-0015-Clean-up-some-usage-of-Meson-features.patchtext/x-patch; charset=utf-8; name=v5-0015-Clean-up-some-usage-of-Meson-features.patchDownload
From bb843fc8d03649ac6ca86334100b5438b35b3005 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 13 Jun 2023 15:43:02 -0500
Subject: [PATCH v5 15/16] Clean up some usage of Meson features
With Meson features, you can skip the `if myopt.disabled()` dance.
Reduces the amount of indentation as a benefit.
---
meson.build | 516 ++++++++++++++++++++++++----------------------------
1 file changed, 236 insertions(+), 280 deletions(-)
diff --git a/meson.build b/meson.build
index 0e0bdaddc5..0ae82dee1e 100644
--- a/meson.build
+++ b/meson.build
@@ -591,13 +591,11 @@ endif
docs_pdf_opt = get_option('docs_pdf')
docs_pdf_dep = not_found_dep
-if not docs_pdf_opt.disabled()
- fop = find_program(get_option('FOP'), native: true, required: docs_pdf_opt)
- if xmllint_bin.found() and xsltproc_bin.found() and fop.found()
- docs_pdf_dep = declare_dependency()
- elif docs_pdf_opt.enabled()
- error('missing required tools for docs in PDF format')
- endif
+fop = find_program(get_option('FOP'), native: true, required: docs_pdf_opt)
+if xmllint_bin.found() and xsltproc_bin.found() and fop.found()
+ docs_pdf_dep = declare_dependency()
+elif docs_pdf_opt.enabled()
+ error('missing required tools for docs in PDF format')
endif
@@ -609,45 +607,40 @@ endif
gssapiopt = get_option('gssapi')
krb_srvtab = ''
have_gssapi = false
-if not gssapiopt.disabled()
- gssapi = dependency('krb5-gssapi', required: gssapiopt)
- have_gssapi = gssapi.found()
+gssapi = dependency('krb5-gssapi', required: gssapiopt)
+have_gssapi = gssapi.found()
- if not have_gssapi
- elif cc.check_header('gssapi/gssapi.h', dependencies: gssapi, required: false,
- args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_GSSAPI_GSSAPI_H', 1)
- elif cc.check_header('gssapi.h', args: test_c_args, dependencies: gssapi, required: gssapiopt)
- cdata.set('HAVE_GSSAPI_H', 1)
- else
- have_gssapi = false
- endif
-
- if not have_gssapi
- elif cc.check_header('gssapi/gssapi_ext.h', dependencies: gssapi, required: false,
- args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_GSSAPI_GSSAPI_EXT_H', 1)
- elif cc.check_header('gssapi_ext.h', args: test_c_args, dependencies: gssapi, required: gssapiopt)
- cdata.set('HAVE_GSSAPI_EXT_H', 1)
- else
- have_gssapi = false
- endif
-
- if not have_gssapi
- elif cc.has_function('gss_store_cred_into', dependencies: gssapi,
- args: test_c_args, include_directories: postgres_inc)
- cdata.set('ENABLE_GSS', 1)
+if not have_gssapi
+elif cc.check_header('gssapi/gssapi.h', dependencies: gssapi, required: false,
+ args: test_c_args, include_directories: postgres_inc)
+ cdata.set('HAVE_GSSAPI_GSSAPI_H', 1)
+elif cc.check_header('gssapi.h', args: test_c_args, dependencies: gssapi, required: gssapiopt)
+ cdata.set('HAVE_GSSAPI_H', 1)
+else
+ have_gssapi = false
+endif
- krb_srvtab = 'FILE:/@0@/krb5.keytab)'.format(get_option('sysconfdir'))
- cdata.set_quoted('PG_KRB_SRVTAB', krb_srvtab)
- elif gssapiopt.enabled()
- error('''could not find function 'gss_store_cred_into' required for GSSAPI''')
- else
- have_gssapi = false
- endif
+if not have_gssapi
+elif cc.check_header('gssapi/gssapi_ext.h', dependencies: gssapi, required: false,
+ args: test_c_args, include_directories: postgres_inc)
+ cdata.set('HAVE_GSSAPI_GSSAPI_EXT_H', 1)
+elif cc.check_header('gssapi_ext.h', args: test_c_args, dependencies: gssapi, required: gssapiopt)
+ cdata.set('HAVE_GSSAPI_EXT_H', 1)
+else
+ have_gssapi = false
endif
+
if not have_gssapi
- gssapi = not_found_dep
+elif cc.has_function('gss_store_cred_into', dependencies: gssapi,
+ args: test_c_args, include_directories: postgres_inc)
+ cdata.set('ENABLE_GSS', 1)
+
+ krb_srvtab = 'FILE:/@0@/krb5.keytab)'.format(get_option('sysconfdir'))
+ cdata.set_quoted('PG_KRB_SRVTAB', krb_srvtab)
+elif gssapiopt.enabled()
+ error('''could not find function 'gss_store_cred_into' required for GSSAPI''')
+else
+ have_gssapi = false
endif
@@ -766,17 +759,11 @@ endif
###############################################################
icuopt = get_option('icu')
-if not icuopt.disabled()
- icu = dependency('icu-uc', required: icuopt)
- icu_i18n = dependency('icu-i18n', required: icuopt)
-
- if icu.found()
- cdata.set('USE_ICU', 1)
- endif
+icu = dependency('icu-uc', required: icuopt)
+icu_i18n = dependency('icu-i18n', required: icuopt)
-else
- icu = not_found_dep
- icu_i18n = not_found_dep
+if icu.found()
+ cdata.set('USE_ICU', 1)
endif
@@ -786,14 +773,10 @@ endif
###############################################################
libxmlopt = get_option('libxml')
-if not libxmlopt.disabled()
- libxml = dependency('libxml-2.0', required: libxmlopt, version: '>= 2.6.23')
+libxml = dependency('libxml-2.0', required: libxmlopt, version: '>= 2.6.23')
- if libxml.found()
- cdata.set('USE_LIBXML', 1)
- endif
-else
- libxml = not_found_dep
+if libxml.found()
+ cdata.set('USE_LIBXML', 1)
endif
@@ -803,14 +786,10 @@ endif
###############################################################
libxsltopt = get_option('libxslt')
-if not libxsltopt.disabled()
- libxslt = dependency('libxslt', required: libxsltopt)
+libxslt = dependency('libxslt', required: libxsltopt)
- if libxslt.found()
- cdata.set('USE_LIBXSLT', 1)
- endif
-else
- libxslt = not_found_dep
+if libxslt.found()
+ cdata.set('USE_LIBXSLT', 1)
endif
@@ -820,16 +799,11 @@ endif
###############################################################
lz4opt = get_option('lz4')
-if not lz4opt.disabled()
- lz4 = dependency('liblz4', required: lz4opt)
-
- if lz4.found()
- cdata.set('USE_LZ4', 1)
- cdata.set('HAVE_LIBLZ4', 1)
- endif
+lz4 = dependency('liblz4', required: lz4opt)
-else
- lz4 = not_found_dep
+if lz4.found()
+ cdata.set('USE_LZ4', 1)
+ cdata.set('HAVE_LIBLZ4', 1)
endif
@@ -846,20 +820,18 @@ endif
tclopt = get_option('pltcl')
tcl_version = get_option('tcl_version')
tcl_dep = not_found_dep
-if not tclopt.disabled()
- # via pkg-config
- tcl_dep = dependency(tcl_version, required: false)
+# via pkg-config
+tcl_dep = dependency(tcl_version, required: false)
- if not tcl_dep.found()
- tcl_dep = cc.find_library(tcl_version,
- required: tclopt,
- dirs: test_lib_d)
- endif
+if not tcl_dep.found()
+ tcl_dep = cc.find_library(tcl_version,
+ required: tclopt,
+ dirs: test_lib_d)
+endif
- if not cc.has_header('tcl.h', dependencies: tcl_dep, required: tclopt)
- tcl_dep = not_found_dep
- endif
+if not cc.has_header('tcl.h', dependencies: tcl_dep, required: tclopt)
+ tcl_dep = not_found_dep
endif
@@ -869,35 +841,32 @@ endif
###############################################################
pamopt = get_option('pam')
-if not pamopt.disabled()
- pam = dependency('pam', required: false)
+pam = not_found_dep
- if not pam.found()
- pam = cc.find_library('pam', required: pamopt, dirs: test_lib_d)
- endif
+pam = dependency('pam', required: false)
+if not pam.found()
+ pam = cc.find_library('pam', required: pamopt, dirs: test_lib_d)
+endif
- if pam.found()
- pam_header_found = false
+if pam.found()
+ pam_header_found = false
- # header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM.
- if cc.check_header('security/pam_appl.h', dependencies: pam, required: false,
- args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_SECURITY_PAM_APPL_H', 1)
- pam_header_found = true
- elif cc.check_header('pam/pam_appl.h', dependencies: pam, required: pamopt,
- args: test_c_args, include_directories: postgres_inc)
- cdata.set('HAVE_PAM_PAM_APPL_H', 1)
- pam_header_found = true
- endif
+ # header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM.
+ if cc.check_header('security/pam_appl.h', dependencies: pam, required: false,
+ args: test_c_args, include_directories: postgres_inc)
+ cdata.set('HAVE_SECURITY_PAM_APPL_H', 1)
+ pam_header_found = true
+ elif cc.check_header('pam/pam_appl.h', dependencies: pam, required: pamopt,
+ args: test_c_args, include_directories: postgres_inc)
+ cdata.set('HAVE_PAM_PAM_APPL_H', 1)
+ pam_header_found = true
+ endif
- if pam_header_found
- cdata.set('USE_PAM', 1)
- else
- pam = not_found_dep
- endif
+ if pam_header_found
+ cdata.set('USE_PAM', 1)
+ else
+ pam = not_found_dep
endif
-else
- pam = not_found_dep
endif
@@ -908,111 +877,110 @@ endif
perlopt = get_option('plperl')
perl_dep = not_found_dep
-if not perlopt.disabled()
- perl_may_work = true
-
- # First verify that perl has the necessary dependencies installed
- perl_mods = run_command(
- [perl,
- '-MConfig', '-MOpcode', '-MExtUtils::Embed', '-MExtUtils::ParseXS',
- '-e', ''],
- check: false)
- if perl_mods.returncode() != 0
+perl_may_work = true
+
+# First verify that perl has the necessary dependencies installed
+perl_mods = run_command(
+ [perl,
+ '-MConfig', '-MOpcode', '-MExtUtils::Embed', '-MExtUtils::ParseXS',
+ '-e', ''],
+ check: false)
+if perl_mods.returncode() != 0
+ perl_may_work = false
+ perl_msg = 'perl installation does not have the required modules'
+endif
+
+# Then inquire perl about its configuration
+if perl_may_work
+ perl_conf_cmd = [perl, '-MConfig', '-e', 'print $Config{$ARGV[0]}']
+ perlversion = run_command(perl_conf_cmd, 'api_versionstring', check: true).stdout()
+ archlibexp = run_command(perl_conf_cmd, 'archlibexp', check: true).stdout()
+ privlibexp = run_command(perl_conf_cmd, 'privlibexp', check: true).stdout()
+ useshrplib = run_command(perl_conf_cmd, 'useshrplib', check: true).stdout()
+
+ perl_inc_dir = '@0@/CORE'.format(archlibexp)
+
+ if perlversion.version_compare('< 5.14')
+ perl_may_work = false
+ perl_msg = 'Perl version 5.14 or later is required, but this is @0@'.format(perlversion)
+ elif useshrplib != 'true'
perl_may_work = false
- perl_msg = 'perl installation does not have the required modules'
+ perl_msg = 'need a shared perl'
endif
+endif
- # Then inquire perl about its configuration
- if perl_may_work
- perl_conf_cmd = [perl, '-MConfig', '-e', 'print $Config{$ARGV[0]}']
- perlversion = run_command(perl_conf_cmd, 'api_versionstring', check: true).stdout()
- archlibexp = run_command(perl_conf_cmd, 'archlibexp', check: true).stdout()
- privlibexp = run_command(perl_conf_cmd, 'privlibexp', check: true).stdout()
- useshrplib = run_command(perl_conf_cmd, 'useshrplib', check: true).stdout()
-
- perl_inc_dir = '@0@/CORE'.format(archlibexp)
-
- if perlversion.version_compare('< 5.14')
- perl_may_work = false
- perl_msg = 'Perl version 5.14 or later is required, but this is @0@'.format(perlversion)
- elif useshrplib != 'true'
- perl_may_work = false
- perl_msg = 'need a shared perl'
- endif
+if perl_may_work
+ # On most platforms, archlibexp is also where the Perl include files live ...
+ perl_ccflags = ['-I@0@'.format(perl_inc_dir)]
+ # ... but on newer macOS versions, we must use -iwithsysroot to look
+ # under sysroot
+ if not fs.is_file('@0@/perl.h'.format(perl_inc_dir)) and \
+ fs.is_file('@0@@1@/perl.h'.format(pg_sysroot, perl_inc_dir))
+ perl_ccflags = ['-iwithsysroot', perl_inc_dir]
endif
- if perl_may_work
- # On most platforms, archlibexp is also where the Perl include files live ...
- perl_ccflags = ['-I@0@'.format(perl_inc_dir)]
- # ... but on newer macOS versions, we must use -iwithsysroot to look
- # under sysroot
- if not fs.is_file('@0@/perl.h'.format(perl_inc_dir)) and \
- fs.is_file('@0@@1@/perl.h'.format(pg_sysroot, perl_inc_dir))
- perl_ccflags = ['-iwithsysroot', perl_inc_dir]
- endif
-
- # check compiler finds header
- if not cc.has_header('perl.h', required: false,
- args: test_c_args + perl_ccflags, include_directories: postgres_inc)
- perl_may_work = false
- perl_msg = 'missing perl.h'
- endif
+ # check compiler finds header
+ if not cc.has_header('perl.h', required: false,
+ args: test_c_args + perl_ccflags, include_directories: postgres_inc)
+ perl_may_work = false
+ perl_msg = 'missing perl.h'
endif
+endif
- if perl_may_work
- perl_ccflags_r = run_command(perl_conf_cmd, 'ccflags', check: true).stdout()
+if perl_may_work
+ perl_ccflags_r = run_command(perl_conf_cmd, 'ccflags', check: true).stdout()
- # See comments for PGAC_CHECK_PERL_EMBED_CCFLAGS in perl.m4
- foreach flag : perl_ccflags_r.split(' ')
- if flag.startswith('-D') and \
- (not flag.startswith('-D_') or flag == '_USE_32BIT_TIME_T')
- perl_ccflags += flag
- endif
- endforeach
+ # See comments for PGAC_CHECK_PERL_EMBED_CCFLAGS in perl.m4
+ foreach flag : perl_ccflags_r.split(' ')
+ if flag.startswith('-D') and \
+ (not flag.startswith('-D_') or flag == '_USE_32BIT_TIME_T')
+ perl_ccflags += flag
+ endif
+ endforeach
- if host_system == 'windows'
- perl_ccflags += ['-DPLPERL_HAVE_UID_GID']
+ if host_system == 'windows'
+ perl_ccflags += ['-DPLPERL_HAVE_UID_GID']
- if cc.get_id() == 'msvc'
- # prevent binary mismatch between MSVC built plperl and Strawberry or
- # msys ucrt perl libraries
- perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
- endif
+ if cc.get_id() == 'msvc'
+ # prevent binary mismatch between MSVC built plperl and Strawberry or
+ # msys ucrt perl libraries
+ perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
endif
+ endif
- message('CCFLAGS recommended by perl: @0@'.format(perl_ccflags_r))
- message('CCFLAGS for embedding perl: @0@'.format(' '.join(perl_ccflags)))
+ message('CCFLAGS recommended by perl: @0@'.format(perl_ccflags_r))
+ message('CCFLAGS for embedding perl: @0@'.format(' '.join(perl_ccflags)))
- # We are after Embed's ldopts, but without the subset mentioned in
- # Config's ccdlflags and ldflags. (Those are the choices of those who
- # built the Perl installation, which are not necessarily appropriate
- # for building PostgreSQL.)
- ldopts = run_command(perl, '-MExtUtils::Embed', '-e', 'ldopts', check: true).stdout().strip()
- undesired = run_command(perl_conf_cmd, 'ccdlflags', check: true).stdout().split()
- undesired += run_command(perl_conf_cmd, 'ldflags', check: true).stdout().split()
+ # We are after Embed's ldopts, but without the subset mentioned in
+ # Config's ccdlflags and ldflags. (Those are the choices of those who
+ # built the Perl installation, which are not necessarily appropriate
+ # for building PostgreSQL.)
+ ldopts = run_command(perl, '-MExtUtils::Embed', '-e', 'ldopts', check: true).stdout().strip()
+ undesired = run_command(perl_conf_cmd, 'ccdlflags', check: true).stdout().split()
+ undesired += run_command(perl_conf_cmd, 'ldflags', check: true).stdout().split()
- perl_ldopts = []
- foreach ldopt : ldopts.split(' ')
- if ldopt == '' or ldopt in undesired
- continue
- endif
+ perl_ldopts = []
+ foreach ldopt : ldopts.split(' ')
+ if ldopt == '' or ldopt in undesired
+ continue
+ endif
- perl_ldopts += ldopt.strip('"')
- endforeach
+ perl_ldopts += ldopt.strip('"')
+ endforeach
- message('LDFLAGS recommended by perl: "@0@"'.format(ldopts))
- message('LDFLAGS for embedding perl: "@0@"'.format(' '.join(perl_ldopts)))
+ message('LDFLAGS recommended by perl: "@0@"'.format(ldopts))
+ message('LDFLAGS for embedding perl: "@0@"'.format(' '.join(perl_ldopts)))
- perl_dep_int = declare_dependency(
- compile_args: perl_ccflags,
- link_args: perl_ldopts,
- version: perlversion,
- )
+ perl_dep_int = declare_dependency(
+ compile_args: perl_ccflags,
+ link_args: perl_ldopts,
+ version: perlversion,
+ )
- # While we're at it, check that we can link to libperl.
- # On most platforms, if perl.h is there then libperl.so will be too, but
- # at this writing Debian packages them separately.
- perl_link_test = '''
+ # While we're at it, check that we can link to libperl.
+ # On most platforms, if perl.h is there then libperl.so will be too, but
+ # at this writing Debian packages them separately.
+ perl_link_test = '''
/* see plperl.h */
#ifdef _MSC_VER
#define __inline__ inline
@@ -1023,23 +991,22 @@ int main(void)
{
perl_alloc();
}'''
- if not cc.links(perl_link_test, name: 'libperl',
- args: test_c_args + perl_ccflags + perl_ldopts,
- include_directories: postgres_inc)
- perl_may_work = false
- perl_msg = 'missing libperl'
- endif
+ if not cc.links(perl_link_test, name: 'libperl',
+ args: test_c_args + perl_ccflags + perl_ldopts,
+ include_directories: postgres_inc)
+ perl_may_work = false
+ perl_msg = 'missing libperl'
+ endif
- endif # perl_may_work
+endif # perl_may_work
- if perl_may_work
- perl_dep = perl_dep_int
+if perl_may_work
+ perl_dep = perl_dep_int
+else
+ if perlopt.enabled()
+ error('dependency plperl failed: @0@'.format(perl_msg))
else
- if perlopt.enabled()
- error('dependency plperl failed: @0@'.format(perl_msg))
- else
- message('disabling optional dependency plperl: @0@'.format(perl_msg))
- endif
+ message('disabling optional dependency plperl: @0@'.format(perl_msg))
endif
endif
@@ -1051,15 +1018,13 @@ endif
pyopt = get_option('plpython')
python3_dep = not_found_dep
-if not pyopt.disabled()
- pm = import('python')
- python3_inst = pm.find_installation(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
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
- python3_dep = not_found_dep
- endif
+pm = import('python')
+python3_inst = pm.find_installation(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
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
+ python3_dep = not_found_dep
endif
endif
@@ -1069,7 +1034,9 @@ endif
# Library: Readline
###############################################################
-if not get_option('readline').disabled()
+readlineopt = get_option('readline')
+readline = not_found_dep
+if not readlineopt.disabled()
libedit_preferred = get_option('libedit_preferred')
# Set the order of readline dependencies
check_readline_deps = libedit_preferred ? \
@@ -1079,7 +1046,7 @@ if not get_option('readline').disabled()
readline = dependency(readline_dep, required: false)
if not readline.found()
readline = cc.find_library(readline_dep,
- required: get_option('readline'),
+ required: readlineopt,
dirs: test_lib_d)
endif
if readline.found()
@@ -1180,8 +1147,6 @@ Use -Dreadline=disabled to disable readline support.'''.format(readline_dep))
endif
# XXX: Figure out whether to implement mingw warning equivalent
-else
- readline = not_found_dep
endif
@@ -1368,34 +1333,32 @@ endif
zlibopt = get_option('zlib')
zlib = not_found_dep
-if not zlibopt.disabled()
- zlib_t = dependency('zlib', required: zlibopt)
-
- if zlib_t.type_name() == 'internal'
- # if fallback was used, we don't need to test if headers are present (they
- # aren't built yet, so we can't test)
- zlib = zlib_t
- elif not zlib_t.found()
- warning('did not find zlib')
- elif not cc.has_header('zlib.h',
- args: test_c_args, include_directories: postgres_inc,
- dependencies: [zlib_t], required: zlibopt.enabled())
- warning('zlib header not found')
- elif not cc.has_type('z_streamp',
- dependencies: [zlib_t], prefix: '#include <zlib.h>',
- args: test_c_args, include_directories: postgres_inc)
- if zlibopt.enabled()
- error('zlib version is too old')
- else
- warning('zlib version is too old')
- endif
+
+zlib_t = dependency('zlib', required: zlibopt)
+if zlib_t.found() and zlib_t.type_name() == 'internal'
+ # if fallback was used, we don't need to test if headers are present (they
+ # aren't built yet, so we can't test)
+ zlib = zlib_t
+elif not zlib_t.found()
+ warning('did not find zlib')
+elif not cc.has_header('zlib.h',
+ args: test_c_args, include_directories: postgres_inc,
+ dependencies: [zlib_t], required: zlibopt)
+ warning('zlib header not found')
+elif not cc.has_type('z_streamp',
+ dependencies: [zlib_t], prefix: '#include <zlib.h>',
+ args: test_c_args, include_directories: postgres_inc)
+ if zlibopt.enabled()
+ error('zlib version is too old')
else
- zlib = zlib_t
+ warning('zlib version is too old')
endif
+else
+ zlib = zlib_t
+endif
- if zlib.found()
- cdata.set('HAVE_LIBZ', 1)
- endif
+if zlib.found()
+ cdata.set('HAVE_LIBZ', 1)
endif
@@ -1429,16 +1392,11 @@ endif
###############################################################
zstdopt = get_option('zstd')
-if not zstdopt.disabled()
- zstd = dependency('libzstd', required: zstdopt, version: '>=1.4.0')
-
- if zstd.found()
- cdata.set('USE_ZSTD', 1)
- cdata.set('HAVE_LIBZSTD', 1)
- endif
+zstd = dependency('libzstd', required: zstdopt, version: '>=1.4.0')
-else
- zstd = not_found_dep
+if zstd.found()
+ cdata.set('USE_ZSTD', 1)
+ cdata.set('HAVE_LIBZSTD', 1)
endif
@@ -2534,32 +2492,30 @@ cdata.set('ENABLE_THREAD_SAFETY', 1)
nlsopt = get_option('nls')
libintl = not_found_dep
-if not nlsopt.disabled()
- # otherwise there'd be lots of
- # "Gettext not found, all translation (po) targets will be ignored."
- # warnings if not found.
- msgfmt = find_program('msgfmt', required: nlsopt, native: true)
+# otherwise there'd be lots of
+# "Gettext not found, all translation (po) targets will be ignored."
+# warnings if not found.
+msgfmt = find_program('msgfmt', required: nlsopt, native: true)
- # meson 0.59 has this wrapped in dependency('int')
- if (msgfmt.found() and
- cc.check_header('libintl.h', required: nlsopt,
- args: test_c_args, include_directories: postgres_inc))
+# meson 0.59 has this wrapped in dependency('int')
+if (msgfmt.found() and
+ cc.check_header('libintl.h', required: nlsopt,
+ args: test_c_args, include_directories: postgres_inc))
- # in libc
- if cc.has_function('ngettext')
- libintl = declare_dependency()
- else
- libintl = cc.find_library('intl',
- has_headers: ['libintl.h'], required: nlsopt,
- header_include_directories: postgres_inc,
- dirs: test_lib_d)
- endif
+ # in libc
+ if cc.has_function('ngettext')
+ libintl = declare_dependency()
+ else
+ libintl = cc.find_library('intl',
+ has_headers: ['libintl.h'], required: nlsopt,
+ header_include_directories: postgres_inc,
+ dirs: test_lib_d)
endif
+endif
- if libintl.found()
- i18n = import('i18n')
- cdata.set('ENABLE_NLS', 1)
- endif
+if libintl.found()
+ i18n = import('i18n')
+ cdata.set('ENABLE_NLS', 1)
endif
--
Tristan Partin
Neon (https://neon.tech)
v5-0016-Fix-intl-misspelling.patchtext/x-patch; charset=utf-8; name=v5-0016-Fix-intl-misspelling.patchDownload
From dc691784c858410bb9216eae958cf255528cc224 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 13 Jun 2023 15:44:27 -0500
Subject: [PATCH v5 16/16] Fix intl misspelling
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 0ae82dee1e..fc4b7ec2ba 100644
--- a/meson.build
+++ b/meson.build
@@ -2497,7 +2497,7 @@ libintl = not_found_dep
# warnings if not found.
msgfmt = find_program('msgfmt', required: nlsopt, native: true)
-# meson 0.59 has this wrapped in dependency('int')
+# meson 0.59 has this wrapped in dependency('intl')
if (msgfmt.found() and
cc.check_header('libintl.h', required: nlsopt,
args: test_c_args, include_directories: postgres_inc))
--
Tristan Partin
Neon (https://neon.tech)
On 13.06.23 22:47, Tristan Partin wrote:
Forgot that I had gotten a review from a Meson maintainer. The last two
patches in this set are new. One is just a simple spelling correction.
I have committed patches 0001-0006, 0008, 0010, 0013, 0014, 0016, which
are all pretty much cosmetic.
The following patches are now still pending further review:
v5-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patch
v5-0009-Remove-return-code-check.patch
v5-0011-Pass-feature-option-through-to-required-kwarg.patch
v5-0012-Make-finding-pkg-config-python3-more-robust.patch
v5-0015-Clean-up-some-usage-of-Meson-features.patch
On Thu Jun 29, 2023 at 6:18 AM CDT, Peter Eisentraut wrote:
On 13.06.23 22:47, Tristan Partin wrote:
Forgot that I had gotten a review from a Meson maintainer. The last two
patches in this set are new. One is just a simple spelling correction.I have committed patches 0001-0006, 0008, 0010, 0013, 0014, 0016, which
are all pretty much cosmetic.
Thanks Peter.
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-06-29 13:18:21 +0200, Peter Eisentraut wrote:
On 13.06.23 22:47, Tristan Partin wrote:
Forgot that I had gotten a review from a Meson maintainer. The last two
patches in this set are new. One is just a simple spelling correction.I have committed patches 0001-0006, 0008, 0010, 0013, 0014, 0016, which are
all pretty much cosmetic.
Thanks Peter, Tristan! I largely couldn't muster an opinion on most of
these...
The following patches are now still pending further review:
v5-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patch
Hm. One minor disadvantage of this is that if no c++ compiler was found, you
can't really see anything about llvm in the the output, nor in meson-log.txt,
making it somewhat hard to figure out why llvm was disabled.
I think something like
elif llvmopt.auto()
message('llvm requires a C++ compiler')
endif
Should do the trick?
v5-0009-Remove-return-code-check.patch
Pushed.
v5-0011-Pass-feature-option-through-to-required-kwarg.patch
I'm a bit confused how it ended how it's looking like it is right now, but
... :)
I'm thinking of merging 0011 and relevant parts of 0012 and 0015 into one.
v5-0012-Make-finding-pkg-config-python3-more-robust.patch
The commit message here is clearly outdated (still talking about Python.h
check not being required). Does the remainder actually add any robustness?
I'm on board with removing unnecessary .enabled(), but from what I understand
we don't gain anything from adding the if python3_inst.found() branch?
v5-0015-Clean-up-some-usage-of-Meson-features.patch
For me that's not really an improvement in legibility, the indentation for the
bulk of each test helps parse things visually. In some cases the removed "if
feature.disabled()" actually leads to tests being executed when a feature is
disabled, e.g. perl -MConfig ... would now be run even perl is disabled.
Attached my version of 0007 and 0011 (with some changes from 0012 and
0015). I'm running a test of those with the extended CI I have in a branch...
Greetings,
Andres Freund
Attachments:
v16a-0001-meson-Pass-more-feature-option-through-to-requi.patchtext/x-diff; charset=us-asciiDownload
From 8995f525d8036ad0aad9486a9b26864d87ebbe9f Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Thu, 29 Jun 2023 09:32:40 -0700
Subject: [PATCH v16a 1/2] meson: Pass more feature option through to required
kwargs
That was already done in a lot of places, but not all.
Author: Tristan Partin <tristan@neon.tech>
Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po
---
meson.build | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/meson.build b/meson.build
index fbec9979475..6661c1fefa2 100644
--- a/meson.build
+++ b/meson.build
@@ -769,8 +769,8 @@ endif
icuopt = get_option('icu')
if not icuopt.disabled()
- icu = dependency('icu-uc', required: icuopt.enabled())
- icu_i18n = dependency('icu-i18n', required: icuopt.enabled())
+ icu = dependency('icu-uc', required: icuopt)
+ icu_i18n = dependency('icu-i18n', required: icuopt)
if icu.found()
cdata.set('USE_ICU', 1)
@@ -1054,9 +1054,9 @@ endif
pyopt = get_option('plpython')
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
+ python3_inst = pm.find_installation(required: pyopt)
+ python3_dep = python3_inst.dependency(embed: true, required: pyopt)
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
python3_dep = not_found_dep
endif
else
@@ -1079,7 +1079,7 @@ if not get_option('readline').disabled()
readline = dependency(readline_dep, required: false)
if not readline.found()
readline = cc.find_library(readline_dep,
- required: get_option('readline').enabled(),
+ required: get_option('readline'),
dirs: test_lib_d)
endif
if readline.found()
@@ -1379,7 +1379,7 @@ if not zlibopt.disabled()
warning('did not find zlib')
elif not cc.has_header('zlib.h',
args: test_c_args, include_directories: postgres_inc,
- dependencies: [zlib_t], required: zlibopt.enabled())
+ dependencies: [zlib_t], required: zlibopt)
warning('zlib header not found')
elif not cc.has_type('z_streamp',
dependencies: [zlib_t], prefix: '#include <zlib.h>',
@@ -2538,7 +2538,7 @@ if not nlsopt.disabled()
# otherwise there'd be lots of
# "Gettext not found, all translation (po) targets will be ignored."
# warnings if not found.
- msgfmt = find_program('msgfmt', required: nlsopt.enabled(), native: true)
+ msgfmt = find_program('msgfmt', required: nlsopt, native: true)
# meson 0.59 has this wrapped in dependency('intl')
if (msgfmt.found() and
--
2.38.0
v16a-0002-meson-Tie-adding-C-support-to-the-llvm-Meson-op.patchtext/x-diff; charset=us-asciiDownload
From 2f681029390675ae1902bd209657bd4f063d646a Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Thu, 29 Jun 2023 09:42:09 -0700
Subject: [PATCH v16a 2/2] meson: Tie adding C++ support to the llvm Meson
option
In the event the llvm option is defined to be 'auto', it is possible
that the host machine might not have a C++ compiler. If that is the
case, then we shouldn't continue reaching for the llvm dependency.
To make it easier to understand the case where LLVM support is disabled due to
lacking a C++ compiler, add a message noting that fact.
Author: Tristan Partin <tristan@neon.tech>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po
---
meson.build | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 6661c1fefa2..3ac5acb1732 100644
--- a/meson.build
+++ b/meson.build
@@ -742,8 +742,8 @@ endif
###############################################################
llvmopt = get_option('llvm')
-if not llvmopt.disabled()
- add_languages('cpp', required: true, native: false)
+llvm = not_found_dep
+if add_languages('cpp', required: llvmopt, native: false)
llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
if llvm.found()
@@ -757,8 +757,8 @@ if not llvmopt.disabled()
ccache = find_program('ccache', native: true, required: false)
clang = find_program(llvm_binpath / 'clang', required: true)
endif
-else
- llvm = not_found_dep
+elif llvmopt.auto()
+ message('llvm requires a C++ compiler')
endif
--
2.38.0
On Thu Jun 29, 2023 at 12:35 PM CDT, Andres Freund wrote:
Hi,
On 2023-06-29 13:18:21 +0200, Peter Eisentraut wrote:
On 13.06.23 22:47, Tristan Partin wrote:
Forgot that I had gotten a review from a Meson maintainer. The last two
patches in this set are new. One is just a simple spelling correction.I have committed patches 0001-0006, 0008, 0010, 0013, 0014, 0016, which are
all pretty much cosmetic.Thanks Peter, Tristan! I largely couldn't muster an opinion on most of
these...The following patches are now still pending further review:
v5-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patch
Hm. One minor disadvantage of this is that if no c++ compiler was found, you
can't really see anything about llvm in the the output, nor in meson-log.txt,
making it somewhat hard to figure out why llvm was disabled.I think something like
elif llvmopt.auto()
message('llvm requires a C++ compiler')
endifShould do the trick?
Your patch looks great to me.
v5-0011-Pass-feature-option-through-to-required-kwarg.patch
I'm a bit confused how it ended how it's looking like it is right now, but
... :)I'm thinking of merging 0011 and relevant parts of 0012 and 0015 into one.
Your patch looks great to me.
v5-0012-Make-finding-pkg-config-python3-more-robust.patch
The commit message here is clearly outdated (still talking about Python.h
check not being required). Does the remainder actually add any robustness?I'm on board with removing unnecessary .enabled(), but from what I understand
we don't gain anything from adding the if python3_inst.found() branch?
Attached is a more up to date patch, which removes the old part of the
commit message. I guess robust is in the eye of the beholder. It is
definitely possible for the installation to not be found (Python.h not
existing in newer versions of Meson as an example). All my patch would
do is keep the build from crashing if and only if the installation
wasn't found.
The unnecessary .enabled() could be folded into the other patch if you
so chose.
v5-0015-Clean-up-some-usage-of-Meson-features.patch
For me that's not really an improvement in legibility, the indentation for the
bulk of each test helps parse things visually. In some cases the removed "if
feature.disabled()" actually leads to tests being executed when a feature is
disabled, e.g. perl -MConfig ... would now be run even perl is disabled.
Makes sense to not take the patch then.
Attached my version of 0007 and 0011 (with some changes from 0012 and
0015). I'm running a test of those with the extended CI I have in a branch...
Thanks for the further review. Did you by chance see my other email in
another branch of this thread[0]/messages/by-id/CTBSCT2V1TVP.2AUJVJLNWQVG3@gonk?
[0]: /messages/by-id/CTBSCT2V1TVP.2AUJVJLNWQVG3@gonk
--
Tristan Partin
Neon (https://neon.tech)
Attachments:
v6-0001-Make-finding-pkg-config-python3-more-robust.patchtext/x-patch; charset=utf-8; name=v6-0001-Make-finding-pkg-config-python3-more-robust.patchDownload
From 5a1c1c1483dcb9c7e34a5462ddaa7a37adbd6cc7 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH v6] Make finding pkg-config(python3) more robust
It is a possibility that the installation can't be found.
---
meson.build | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 56fbf752d2..ddd941ccfe 100644
--- a/meson.build
+++ b/meson.build
@@ -1050,15 +1050,17 @@ endif
###############################################################
pyopt = get_option('plpython')
+python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
- python3_dep = not_found_dep
+ python3_inst = pm.find_installation(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
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
+ python3_dep = not_found_dep
+ endif
endif
-else
- python3_dep = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-06-29 13:34:42 -0500, Tristan Partin wrote:
On Thu Jun 29, 2023 at 12:35 PM CDT, Andres Freund wrote:
v5-0012-Make-finding-pkg-config-python3-more-robust.patch
The commit message here is clearly outdated (still talking about Python.h
check not being required). Does the remainder actually add any robustness?I'm on board with removing unnecessary .enabled(), but from what I understand
we don't gain anything from adding the if python3_inst.found() branch?Attached is a more up to date patch, which removes the old part of the
commit message. I guess robust is in the eye of the beholder. It is
definitely possible for the installation to not be found (Python.h not
existing in newer versions of Meson as an example). All my patch would
do is keep the build from crashing if and only if the installation
wasn't found.
Ah - I somehow thought .find_installation().dependency() would return a
not-found dependency when the install wasn't located.
Attached my version of 0007 and 0011 (with some changes from 0012 and
0015). I'm running a test of those with the extended CI I have in a branch...Thanks for the further review. Did you by chance see my other email in
another branch of this thread[0]?
I had planned to, but somehow forgot. Will reply.
Greetings,
Andres Freund
Hi,
On 2023-06-13 14:56:36 -0500, Tristan Partin wrote:
I was thinking today. When you initially wrote the build, did you try
using the src/bin/meson.build file as the place where all the binaries
were built? As you say, most of the src/bin/xxx/meson.build files are
extrememly reptitive.
We had a similar-ish issue in my last project which I solved like:
https://github.com/hse-project/hse/blob/master/tools/meson.build#L20-L405
This is a pattern I used quite frequently in that project. One benefit
of this approach is that the binaries all end up next to each other in
the build tree which is eventually how they'll be laid out in the
install destination. The other benefit is of course reducing reptitive
code.
I think the build directory and the source code directory not matching in
structure would have made it considerably harder sell for people to migrate.
I.e. I considered it, but due to meson's "no outputs outside of the current
directory" rule, it didn't (and sadly still doesn't) really seem viable.
Greetings,
Andres Freund
On Thu Jun 29, 2023 at 1:58 PM CDT, Andres Freund wrote:
Hi,
On 2023-06-29 13:34:42 -0500, Tristan Partin wrote:
On Thu Jun 29, 2023 at 12:35 PM CDT, Andres Freund wrote:
v5-0012-Make-finding-pkg-config-python3-more-robust.patch
The commit message here is clearly outdated (still talking about Python.h
check not being required). Does the remainder actually add any robustness?I'm on board with removing unnecessary .enabled(), but from what I understand
we don't gain anything from adding the if python3_inst.found() branch?Attached is a more up to date patch, which removes the old part of the
commit message. I guess robust is in the eye of the beholder. It is
definitely possible for the installation to not be found (Python.h not
existing in newer versions of Meson as an example). All my patch would
do is keep the build from crashing if and only if the installation
wasn't found.Ah - I somehow thought .find_installation().dependency() would return a
not-found dependency when the install wasn't located.
Inspecting the Meson source code... If find_installation() fails, you
get returned a NonExistingExternalProgram, which doesn't implement
dependency()[0]https://github.com/mesonbuild/meson/blob/master/mesonbuild/programs.py#L333.
Attached my version of 0007 and 0011 (with some changes from 0012 and
0015). I'm running a test of those with the extended CI I have in a branch...Thanks for the further review. Did you by chance see my other email in
another branch of this thread[0]?I had planned to, but somehow forgot. Will reply.
Thanks!
[0]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/programs.py#L333
--
Tristan Partin
Neon (https://neon.tech)
On Thu Jun 29, 2023 at 2:02 PM CDT, Andres Freund wrote:
Hi,
On 2023-06-13 14:56:36 -0500, Tristan Partin wrote:
I was thinking today. When you initially wrote the build, did you try
using the src/bin/meson.build file as the place where all the binaries
were built? As you say, most of the src/bin/xxx/meson.build files are
extrememly reptitive.We had a similar-ish issue in my last project which I solved like:
https://github.com/hse-project/hse/blob/master/tools/meson.build#L20-L405
This is a pattern I used quite frequently in that project. One benefit
of this approach is that the binaries all end up next to each other in
the build tree which is eventually how they'll be laid out in the
install destination. The other benefit is of course reducing reptitive
code.I think the build directory and the source code directory not matching in
structure would have made it considerably harder sell for people to migrate.I.e. I considered it, but due to meson's "no outputs outside of the current
directory" rule, it didn't (and sadly still doesn't) really seem viable.
Yeah, I guess it is a matter if you like the layout being closer to the
installation or the source tree at the expense of repetition. I am
partial to the installation since it is less to type if you run a binary
from the build directory and less repetition, but all good. Maybe
something that could be reconsidered when autotools is dropped.
I still think the overrides are important, at the very least for libpq,
but I will defer to your aforementioned decision for now.
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-06-29 14:07:19 -0500, Tristan Partin wrote:
I still think the overrides are important, at the very least for libpq,
but I will defer to your aforementioned decision for now.
libpq makes sense to me, fwiw. Just doing it for all binaries individually
didn't seem as obviously beneficial.
FWIW, it seems it could be handled somewhat centrally for binaries, the
bin_targets array should have all that's needed?
Some things won't work from the build directory, btw. E.g. initdb or postgres
itself.
Greetings,
Andres Freund
On Thu Jun 29, 2023 at 2:13 PM CDT, Andres Freund wrote:
Hi,
On 2023-06-29 14:07:19 -0500, Tristan Partin wrote:
I still think the overrides are important, at the very least for libpq,
but I will defer to your aforementioned decision for now.libpq makes sense to me, fwiw. Just doing it for all binaries individually
didn't seem as obviously beneficial.FWIW, it seems it could be handled somewhat centrally for binaries, the
bin_targets array should have all that's needed?
I will send a follow-up patch with at least libpq overridden. I will
investigate the bin_targets.
Some things won't work from the build directory, btw. E.g. initdb or postgres
itself.
I have already fallen victim to this! Lesson learned :).
--
Tristan Partin
Neon (https://neon.tech)
On Thu Jun 29, 2023 at 2:17 PM CDT, Tristan Partin wrote:
On Thu Jun 29, 2023 at 2:13 PM CDT, Andres Freund wrote:
Hi,
On 2023-06-29 14:07:19 -0500, Tristan Partin wrote:
I still think the overrides are important, at the very least for libpq,
but I will defer to your aforementioned decision for now.libpq makes sense to me, fwiw. Just doing it for all binaries individually
didn't seem as obviously beneficial.FWIW, it seems it could be handled somewhat centrally for binaries, the
bin_targets array should have all that's needed?I will send a follow-up patch with at least libpq overridden. I will
investigate the bin_targets.
Attached is a patch which does just that without overriding the
binaries. I investigated the bin_targets stuff, but some test
executables get added there, so it wouldn't work out that well.
--
Tristan Partin
Neon (https://neon.tech)
Attachments:
v6-0001-Add-Meson-override-for-libpq.patchtext/x-patch; charset=utf-8; name=v6-0001-Add-Meson-override-for-libpq.patchDownload
From b52a13d1575e4965e8c1794e7a62f24ecfeeb1cf Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH v6] Add Meson override for libpq
Meson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:
[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1
[provide]
dependency_names = libpq
Then in my extension (root project), I can have the following line
snippet:
libpq = dependency('libpq')
This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.
---
src/interfaces/libpq/meson.build | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index 80e6a15adf..6d18970e81 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -84,6 +84,8 @@ libpq = declare_dependency(
include_directories: [include_directories('.')]
)
+meson.override_dependency('libpq', libpq)
+
pkgconfig.generate(
name: 'libpq',
description: 'PostgreSQL libpq library',
--
Tristan Partin
Neon (https://neon.tech)
On 2023-Jul-12, Tristan Partin wrote:
Attached is a patch which does just that without overriding the
binaries. I investigated the bin_targets stuff, but some test
executables get added there, so it wouldn't work out that well.
This seems useful. Maybe we should have some documentation changes to
go with it, because otherwise it seems a bit too obscure.
Maybe there are other subdirs where this would be useful. ecpg maybe?
(Much less widely used, but if it's this simple, it shouldn't be much of
a burden)
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
On Wed Jul 12, 2023 at 11:39 AM CDT, Alvaro Herrera wrote:
On 2023-Jul-12, Tristan Partin wrote:
Attached is a patch which does just that without overriding the
binaries. I investigated the bin_targets stuff, but some test
executables get added there, so it wouldn't work out that well.This seems useful. Maybe we should have some documentation changes to
go with it, because otherwise it seems a bit too obscure.
Do you have a place in mind on where to document it?
Maybe there are other subdirs where this would be useful. ecpg maybe?
(Much less widely used, but if it's this simple, it shouldn't be much of
a burden)
A previous version of this patch[0]/messages/by-id/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po did it to all public facing
binaries. Andres wasn't super interested in that.
[0]: /messages/by-id/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-06-29 13:34:42 -0500, Tristan Partin wrote:
On Thu Jun 29, 2023 at 12:35 PM CDT, Andres Freund wrote:
Hm. One minor disadvantage of this is that if no c++ compiler was found, you
can't really see anything about llvm in the the output, nor in meson-log.txt,
making it somewhat hard to figure out why llvm was disabled.I think something like
elif llvmopt.auto()
message('llvm requires a C++ compiler')
endifShould do the trick?
Your patch looks great to me.
v5-0011-Pass-feature-option-through-to-required-kwarg.patch
I'm a bit confused how it ended how it's looking like it is right now, but
... :)I'm thinking of merging 0011 and relevant parts of 0012 and 0015 into one.
Your patch looks great to me.
Pushed these. Thanks!
Greetings,
Andres Freund
Did you need anything more from the "Make finding pkg-config(python3)
more robust" patch? That one doesn't seem to have been applied yet.
Thanks for your reviews thus far.
--
Tristan Partin
Neon (https://neon.tech)
Hi,
On 2023-07-12 18:53:03 -0500, Tristan Partin wrote:
Did you need anything more from the "Make finding pkg-config(python3)
more robust" patch? That one doesn't seem to have been applied yet.
Sorry, was overloaded at the time and then lost track of it. Pushed now!
Greetings,
Andres Freund