public inbox for [email protected]
help / color / mirror / Atom feedRe: Documentation for building with meson
11+ messages / 6 participants
[nested] [flat]
* Re: Documentation for building with meson
@ 2023-03-15 11:28 Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
0 siblings, 1 reply; 11+ messages in thread
From: Peter Eisentraut @ 2023-03-15 11:28 UTC (permalink / raw)
To: samay sharma <[email protected]>; Andres Freund <[email protected]>; +Cc: Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
> [PATCH v8 1/5] Make minor additions and corrections to meson docs
The last hunk revealed that there is some mixing up between meson setup
and meson configure. This goes a bit further. For example, earlier it
says that to get a list of meson setup options, call meson configure
--help and look at https://mesonbuild.com/Commands.html#configure, which
are both wrong. Also later throughout the text it uses one or the
other. I think this has the potential to be very confusing, and we
should clean this up carefully.
The text about additional meson test options maybe should go into the
regress.sgml chapter?
> [PATCH v8 2/5] Add data layout options sub-section in installation
docs
This makes sense. Please double check your patch for correct title
casing, vertical spacing of XML, to keep everything looking consistent.
This text isn't yours, but since your patch emphasizes it, I wonder if
it could use some clarification:
+ These options affect how PostgreSQL lays out data on disk.
+ Note that changing these breaks on-disk database compatibility,
+ meaning you cannot use <command>pg_upgrade</command> to upgrade to
+ a build with different values of these options.
This isn't really correct. What breaking on-disk compatibility means is
that you can't use a server compiled one way with a data directory
initialized by binaries compiled another way. pg_upgrade may well have
the ability to upgrade between one or the other; that's up to pg_upgrade
to figure out but not an intrinsic property. (I wonder why pg_upgrade
cares about the WAL block size.)
> [PATCH v8 3/5] Remove Anti-Features section from Installation from
source docs
Makes sense. But is "--disable-thread-safety" really a developer
feature? I think not.
> [PATCH v8 4/5] Re-organize Miscellaneous section
This moves the Miscellaneous section after Developer Features. I think
Developer Features should be last.
Maybe should remove this section and add the options to the regular
PostgreSQL Features section.
Also consider the grouping in meson_options.txt, which is slightly
different yet.
> [PATCH v8 5/5] Change Short Version for meson installation guide
+# create working directory
+mkdir postgres
+cd postgres
+
+# fetch source code
+git clone https://git.postgresql.org/git/postgresql.git src
This comes after the "Getting the Source" section, so at this point they
already have the source and don't need to do "git clone" etc. again.
+# setup and enter build directory (done only first time)
+## Unix based platforms
+meson setup build src --prefix=$PWD/install
+
+## Windows
+meson setup build src --prefix=%cd%/install
Maybe some people work this way, but to me the directory structures you
create here are completely weird.
+# Initialize a new database
+../install/bin/initdb -D ../data
+
+# Start database
+../install/bin/pg_ctl -D ../data/ -l logfile start
+
+# Connect to the database
+../install/bin/psql -d postgres
The terminology here needs to be tightened up. You are using "database"
here to mean three different things.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
@ 2023-03-28 19:27 ` samay sharma <[email protected]>
2023-04-11 17:18 ` Re: Documentation for building with meson Andres Freund <[email protected]>
2023-05-30 18:09 ` Re: Documentation for building with meson Tristan Partin <[email protected]>
2023-06-10 04:00 ` Re: Documentation for building with meson Andres Freund <[email protected]>
2024-01-20 01:53 ` Re: Documentation for building with meson vignesh C <[email protected]>
0 siblings, 4 replies; 11+ messages in thread
From: samay sharma @ 2023-03-28 19:27 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: Andres Freund <[email protected]>; Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
Hi,
On Wed, Mar 15, 2023 at 4:28 AM Peter Eisentraut <
[email protected]> wrote:
> > [PATCH v8 1/5] Make minor additions and corrections to meson docs
>
> The last hunk revealed that there is some mixing up between meson setup
> and meson configure. This goes a bit further. For example, earlier it
> says that to get a list of meson setup options, call meson configure
> --help and look at https://mesonbuild.com/Commands.html#configure, which
> are both wrong. Also later throughout the text it uses one or the
> other. I think this has the potential to be very confusing, and we
> should clean this up carefully.
>
> The text about additional meson test options maybe should go into the
> regress.sgml chapter?
>
I tried to make the meson setup and meson configure usage consistent. I've
removed the text for the test options.
>
>
> > [PATCH v8 2/5] Add data layout options sub-section in installation
> docs
>
> This makes sense. Please double check your patch for correct title
> casing, vertical spacing of XML, to keep everything looking consistent.
>
Thanks for noticing. Made it consistent on both sides.
>
> This text isn't yours, but since your patch emphasizes it, I wonder if
> it could use some clarification:
>
> + These options affect how PostgreSQL lays out data on disk.
> + Note that changing these breaks on-disk database compatibility,
> + meaning you cannot use <command>pg_upgrade</command> to upgrade to
> + a build with different values of these options.
>
> This isn't really correct. What breaking on-disk compatibility means is
> that you can't use a server compiled one way with a data directory
> initialized by binaries compiled another way. pg_upgrade may well have
> the ability to upgrade between one or the other; that's up to pg_upgrade
> to figure out but not an intrinsic property. (I wonder why pg_upgrade
> cares about the WAL block size.)
>
Fixed.
>
>
> > [PATCH v8 3/5] Remove Anti-Features section from Installation from
> source docs
>
> Makes sense. But is "--disable-thread-safety" really a developer
> feature? I think not.
>
>
Moved to PostgreSQL features. Do you think there's a better place for it?
>
> > [PATCH v8 4/5] Re-organize Miscellaneous section
>
> This moves the Miscellaneous section after Developer Features. I think
> Developer Features should be last.
>
> Maybe should remove this section and add the options to the regular
> PostgreSQL Features section.
>
Yes, that makes sense. Made this change.
>
> Also consider the grouping in meson_options.txt, which is slightly
> different yet.
Removed Misc options section from meson_options.txt too.
>
>
> > [PATCH v8 5/5] Change Short Version for meson installation guide
>
> +# create working directory
> +mkdir postgres
> +cd postgres
> +
> +# fetch source code
> +git clone https://git.postgresql.org/git/postgresql.git src
>
> This comes after the "Getting the Source" section, so at this point they
> already have the source and don't need to do "git clone" etc. again.
>
> +# setup and enter build directory (done only first time)
> +## Unix based platforms
> +meson setup build src --prefix=$PWD/install
> +
> +## Windows
> +meson setup build src --prefix=%cd%/install
>
> Maybe some people work this way, but to me the directory structures you
> create here are completely weird.
>
I'd like to discuss what you think is a good directory structure to work
with. I've mentioned some of the drawbacks I see with the current structure
for the short version. I know this structure can feel different but it
feeling weird is not ideal. Do you have a directory structure in mind which
is different but doesn't feel odd to you?
>
> +# Initialize a new database
> +../install/bin/initdb -D ../data
> +
> +# Start database
> +../install/bin/pg_ctl -D ../data/ -l logfile start
> +
> +# Connect to the database
> +../install/bin/psql -d postgres
>
> The terminology here needs to be tightened up. You are using "database"
> here to mean three different things.
>
I'll address this together once we are aligned on the overall directory
structure etc.
There are a few reasons why I had done this. Some reasons Andres has
> described in his previous email and I'll add a few specific examples on why
> having the same section for both might not be a good idea.
>
> * Having readline and zlib as required for building PostgreSQL is now
> wrong because they are not required for meson builds. Also, the name of the
> configs are different for make and meson and the current section only lists
> the make ones.
> * There are many references to configure in that section which don't
> apply to meson.
> * Last I checked Flex and Bison were always required to build via meson
> but not for make and the current section doesn't explain those differences.
>
> I spent a good amount of time thinking if we could have a single section,
> clarify these differences to make it correct and not confuse the users. I
> couldn't find a way to do all three. Therefore, I think we should move to
> a different requirements section for both. I'm happy to re-propose the
> previous version which separates them but wanted to see if anybody has
> better ideas.
Do you have thoughts on the requirements section and the motivation to have
two different versions I had mentioned upthread?
Regards,
Samay
Attachments:
[application/octet-stream] v9-0004-Remove-Miscellaneous-section.patch (8.8K, ../../CAJxrbywZDLXga8kz3brvDd81M6QNbTN2DHM5v7uDgSm8=RROEQ@mail.gmail.com/3-v9-0004-Remove-Miscellaneous-section.patch)
download | inline diff:
From dd728df385266ff61d03324dac44adc5792e279d Mon Sep 17 00:00:00 2001
From: Samay Sharma <[email protected]>
Date: Mon, 13 Feb 2023 16:57:07 -0800
Subject: [PATCH v9 4/5] Remove Miscellaneous section
After some reorganization, only 2 options remain in the
Miscellaneous section. This commit removes that section and
moves the options to the PostgreSQL features section.
---
doc/src/sgml/installation.sgml | 141 ++++++++++++++-------------------
meson_options.txt | 15 ++--
2 files changed, 66 insertions(+), 90 deletions(-)
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index d7ab0c205e..0efbb1c2a3 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -1061,6 +1061,20 @@ build-postgresql:
</listitem>
</varlistentry>
+ <varlistentry id="configure-option-with-krb-srvnam">
+ <term><option>--with-krb-srvnam=<replaceable>NAME</replaceable></option></term>
+ <listitem>
+ <para>
+ The default name of the Kerberos service principal used
+ by GSSAPI.
+ <literal>postgres</literal> is the default. There's usually no
+ reason to change this unless you are building for a Windows
+ environment, in which case it must be set to upper case
+ <literal>POSTGRES</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="configure-option-with-ldap">
<term><option>--with-ldap</option></term>
<listitem>
@@ -1253,6 +1267,21 @@ build-postgresql:
</listitem>
</varlistentry>
+ <varlistentry id="configure-option-with-pgport">
+ <term><option>--with-pgport=<replaceable>NUMBER</replaceable></option></term>
+ <listitem>
+ <para>
+ Set <replaceable>NUMBER</replaceable> as the default port number for
+ server and clients. The default is 5432. The port can always
+ be changed later on, but if you specify it here then both
+ server and clients will have the same default compiled in,
+ which can be very convenient. Usually the only good reason
+ to select a non-default value is if you intend to run multiple
+ <productname>PostgreSQL</productname> servers on the same machine.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="configure-option-disable-thread-safety">
<term><option>--disable-thread-safety</option></term>
<listitem>
@@ -1384,51 +1413,6 @@ build-postgresql:
</sect3>
- <sect3 id="configure-options-misc">
- <title>Miscellaneous</title>
-
- <para>
- It's fairly common, particularly for test builds, to adjust the
- default port number with <option>--with-pgport</option>.
- The other options in this section are recommended only for advanced
- users.
- </para>
-
- <variablelist>
-
- <varlistentry id="configure-option-with-pgport">
- <term><option>--with-pgport=<replaceable>NUMBER</replaceable></option></term>
- <listitem>
- <para>
- Set <replaceable>NUMBER</replaceable> as the default port number for
- server and clients. The default is 5432. The port can always
- be changed later on, but if you specify it here then both
- server and clients will have the same default compiled in,
- which can be very convenient. Usually the only good reason
- to select a non-default value is if you intend to run multiple
- <productname>PostgreSQL</productname> servers on the same machine.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="configure-option-with-krb-srvnam">
- <term><option>--with-krb-srvnam=<replaceable>NAME</replaceable></option></term>
- <listitem>
- <para>
- The default name of the Kerberos service principal used
- by GSSAPI.
- <literal>postgres</literal> is the default. There's usually no
- reason to change this unless you are building for a Windows
- environment, in which case it must be set to upper case
- <literal>POSTGRES</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
- </sect3>
-
<sect3 id="configure-options-data-layout">
<title>Data Layout</title>
@@ -2506,6 +2490,20 @@ ninja install
</listitem>
</varlistentry>
+ <varlistentry id="configure-krb-srvnam-meson">
+ <term><option>-Dkrb_srvnam=<replaceable>NAME</replaceable></option></term>
+ <listitem>
+ <para>
+ The default name of the Kerberos service principal used
+ by GSSAPI.
+ <literal>postgres</literal> is the default. There's usually no
+ reason to change this unless you are building for a Windows
+ environment, in which case it must be set to upper case
+ <literal>POSTGRES</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="configure-with-ldap-meson">
<term><option>-Dldap={ auto | enabled | disabled }</option></term>
<listitem>
@@ -2679,6 +2677,22 @@ ninja install
</para>
</listitem>
</varlistentry>
+
+ <varlistentry id="configure-pgport-meson">
+ <term><option>-Dpgport=<replaceable>NUMBER</replaceable></option></term>
+ <listitem>
+ <para>
+ Set <replaceable>NUMBER</replaceable> as the default port number for
+ server and clients. The default is 5432. The port can always
+ be changed later on, but if you specify it here then both
+ server and clients will have the same default compiled in,
+ which can be very convenient. Usually the only good reason
+ to select a non-default value is if you intend to run multiple
+ <productname>PostgreSQL</productname> servers on the same machine.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</sect3>
@@ -2852,42 +2866,6 @@ ninja install
</variablelist>
</sect3>
- <sect3 id="meson-options-misc">
- <title>Miscellaneous</title>
-
- <variablelist>
- <varlistentry id="configure-pgport-meson">
- <term><option>-Dpgport=<replaceable>NUMBER</replaceable></option></term>
- <listitem>
- <para>
- Set <replaceable>NUMBER</replaceable> as the default port number for
- server and clients. The default is 5432. The port can always
- be changed later on, but if you specify it here then both
- server and clients will have the same default compiled in,
- which can be very convenient. Usually the only good reason
- to select a non-default value is if you intend to run multiple
- <productname>PostgreSQL</productname> servers on the same machine.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="configure-krb-srvnam-meson">
- <term><option>-Dkrb_srvnam=<replaceable>NAME</replaceable></option></term>
- <listitem>
- <para>
- The default name of the Kerberos service principal used
- by GSSAPI.
- <literal>postgres</literal> is the default. There's usually no
- reason to change this unless you are building for a Windows
- environment, in which case it must be set to upper case
- <literal>POSTGRES</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect3>
-
<sect3 id="meson-options-data-layout">
<title>Data Layout</title>
@@ -3152,6 +3130,7 @@ ninja install
</varlistentry>
</variablelist>
</sect3>
+
</sect2>
</sect1>
diff --git a/meson_options.txt b/meson_options.txt
index 4402dd4299..afa7fc7056 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -19,15 +19,6 @@ 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('system_tzdata', type: 'string', value: '',
- description: 'use system time zone data in specified directory')
-
-
# Defaults
option('pgport', type : 'integer', value : 5432,
@@ -70,6 +61,9 @@ option('darwin_sysroot', type : 'string', value: '',
option('rpath', type : 'boolean', value: true,
description: 'whether to embed shared library search path in executables')
+option('system_tzdata', type: 'string', value: '',
+ description: 'use system time zone data in specified directory')
+
# External dependencies
@@ -106,6 +100,9 @@ option('llvm', type : 'feature', value: 'disabled',
option('lz4', type : 'feature', value: 'auto',
description: 'LZ4 support')
+option('krb_srvnam', type : 'string', value : 'postgres',
+ description : '''Default Kerberos service principal for GSSAPI''')
+
option('nls', type: 'feature', value: 'auto',
description: 'native language support')
--
2.38.1
[application/octet-stream] v9-0002-Add-data-layout-options-sub-section-in-installati.patch (9.0K, ../../CAJxrbywZDLXga8kz3brvDd81M6QNbTN2DHM5v7uDgSm8=RROEQ@mail.gmail.com/4-v9-0002-Add-data-layout-options-sub-section-in-installati.patch)
download | inline diff:
From c5e637a54c2b83e5bd8c4155784d97e82937eb51 Mon Sep 17 00:00:00 2001
From: Samay Sharma <[email protected]>
Date: Mon, 6 Feb 2023 16:09:42 -0800
Subject: [PATCH v9 2/5] Add data layout options sub-section in installation
docs
This commit separates out blocksize, segsize and wal_blocksize
options into a separate Data layout options sub-section in both
the make and meson docs. They were earlier in a miscellaneous
section which included several unrelated options. This change
also helps reduce the repetition of the warnings that changing
these parameters breaks on-disk compatibility.
---
doc/src/sgml/installation.sgml | 160 +++++++++++++++++++--------------
1 file changed, 92 insertions(+), 68 deletions(-)
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index e3b9b6c0d0..7e65cdd72e 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -1470,6 +1470,35 @@ build-postgresql:
</listitem>
</varlistentry>
+ </variablelist>
+
+ </sect3>
+
+ <sect3 id="configure-options-data-layout">
+ <title>Data Layout</title>
+
+ <para>
+ These options affect how PostgreSQL lays out data on disk.
+ Note that changing these breaks on-disk database compatibility,
+ meaning you cannot use these binaries with data directories
+ created with different values of these options.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="configure-option-with-blocksize">
+ <term><option>--with-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the <firstterm>block size</firstterm>, in kilobytes. This is the unit
+ of storage and I/O within tables. The default, 8 kilobytes,
+ is suitable for most situations; but other values may be useful
+ in special cases.
+ The value must be a power of 2 between 1 and 32 (kilobytes).
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="configure-option-with-segsize">
<term><option>--with-segsize=<replaceable>SEGSIZE</replaceable></option></term>
<listitem>
@@ -1488,25 +1517,6 @@ build-postgresql:
also set limits on the usable file size.
It is recommended, though not absolutely required, that this value
be a power of 2.
- Note that changing this value breaks on-disk database compatibility,
- meaning you cannot use <command>pg_upgrade</command> to upgrade to
- a build with a different segment size.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="configure-option-with-blocksize">
- <term><option>--with-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
- <listitem>
- <para>
- Set the <firstterm>block size</firstterm>, in kilobytes. This is the unit
- of storage and I/O within tables. The default, 8 kilobytes,
- is suitable for most situations; but other values may be useful
- in special cases.
- The value must be a power of 2 between 1 and 32 (kilobytes).
- Note that changing this value breaks on-disk database compatibility,
- meaning you cannot use <command>pg_upgrade</command> to upgrade to
- a build with a different block size.
</para>
</listitem>
</varlistentry>
@@ -1520,9 +1530,6 @@ build-postgresql:
is suitable for most situations; but other values may be useful
in special cases.
The value must be a power of 2 between 1 and 64 (kilobytes).
- Note that changing this value breaks on-disk database compatibility,
- meaning you cannot use <command>pg_upgrade</command> to upgrade to
- a build with a different WAL block size.
</para>
</listitem>
</varlistentry>
@@ -2932,54 +2939,71 @@ ninja install
</listitem>
</varlistentry>
- <varlistentry id="configure-segsize-meson">
- <term><option>-Dsegsize=<replaceable>SEGSIZE</replaceable></option></term>
- <listitem>
- <para>
- Set the <firstterm>segment size</firstterm>, in gigabytes. Large tables are
- divided into multiple operating-system files, each of size equal
- to the segment size. This avoids problems with file size limits
- that exist on many platforms. The default segment size, 1 gigabyte,
- is safe on all supported platforms. If your operating system has
- <quote>largefile</quote> support (which most do, nowadays), you can use
- a larger segment size. This can be helpful to reduce the number of
- file descriptors consumed when working with very large tables.
- But be careful not to select a value larger than is supported
- by your platform and the file systems you intend to use. Other
- tools you might wish to use, such as <application>tar</application>, could
- also set limits on the usable file size.
- It is recommended, though not absolutely required, that this value
- be a power of 2.
- </para>
- </listitem>
- </varlistentry>
+ </variablelist>
+ </sect3>
- <varlistentry id="configure-blocksize-meson">
- <term><option>-Dblocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
- <listitem>
- <para>
- Set the <firstterm>block size</firstterm>, in kilobytes. This is the unit
- of storage and I/O within tables. The default, 8 kilobytes,
- is suitable for most situations; but other values may be useful
- in special cases.
- The value must be a power of 2 between 1 and 32 (kilobytes).
- </para>
- </listitem>
- </varlistentry>
+ <sect3 id="meson-options-data-layout">
+ <title>Data Layout</title>
+
+ <para>
+ These options affect how PostgreSQL lays out data on disk.
+ Note that changing these breaks on-disk database compatibility,
+ meaning you cannot use these binaries with data directories
+ created with different values of these options.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="meson-option-with-blocksize">
+ <term><option>-Dblocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the <firstterm>block size</firstterm>, in kilobytes. This is the unit
+ of storage and I/O within tables. The default, 8 kilobytes,
+ is suitable for most situations; but other values may be useful
+ in special cases.
+ The value must be a power of 2 between 1 and 32 (kilobytes).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="meson-option-with-segsize">
+ <term><option>-Dsegsize=<replaceable>SEGSIZE</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the <firstterm>segment size</firstterm>, in gigabytes. Large tables are
+ divided into multiple operating-system files, each of size equal
+ to the segment size. This avoids problems with file size limits
+ that exist on many platforms. The default segment size, 1 gigabyte,
+ is safe on all supported platforms. If your operating system has
+ <quote>largefile</quote> support (which most do, nowadays), you can use
+ a larger segment size. This can be helpful to reduce the number of
+ file descriptors consumed when working with very large tables.
+ But be careful not to select a value larger than is supported
+ by your platform and the file systems you intend to use. Other
+ tools you might wish to use, such as <application>tar</application>, could
+ also set limits on the usable file size.
+ It is recommended, though not absolutely required, that this value
+ be a power of 2.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="meson-option-with-wal-blocksize">
+ <term><option>-Dwal_blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the <firstterm>WAL block size</firstterm>, in kilobytes. This is the unit
+ of storage and I/O within the WAL log. The default, 8 kilobytes,
+ is suitable for most situations; but other values may be useful
+ in special cases.
+ The value must be a power of 2 between 1 and 64 (kilobytes).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
- <varlistentry id="configure-wal-blocksize-meson">
- <term><option>-Dwal_blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
- <listitem>
- <para>
- Set the <firstterm>WAL block size</firstterm>, in kilobytes. This is the unit
- of storage and I/O within the WAL log. The default, 8 kilobytes,
- is suitable for most situations; but other values may be useful
- in special cases.
- The value must be a power of 2 between 1 and 64 (kilobytes).
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
</sect3>
<sect3 id="meson-options-devel">
--
2.38.1
[application/octet-stream] v9-0001-Make-minor-additions-and-corrections-to-meson-doc.patch (2.8K, ../../CAJxrbywZDLXga8kz3brvDd81M6QNbTN2DHM5v7uDgSm8=RROEQ@mail.gmail.com/5-v9-0001-Make-minor-additions-and-corrections-to-meson-doc.patch)
download | inline diff:
From 920d628a6fcc8d64a1fcbeadeb9574a01f21c425 Mon Sep 17 00:00:00 2001
From: Samay Sharma <[email protected]>
Date: Mon, 6 Feb 2023 15:31:48 -0800
Subject: [PATCH v9 1/5] Make minor additions and corrections to meson docs
This commit makes a few corrections to the meson docs
and adds a few instructions and links for better clarity.
---
doc/src/sgml/installation.sgml | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 70ab5b77d8..e3b9b6c0d0 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -2057,8 +2057,7 @@ meson setup build -Dssl=openssl
<screen>
meson configure -Dcassert=true
</screen>
- <command>meson configure</command>'s commonly used command-line options
- are explained in <xref linkend="meson-options"/>.
+ Commonly used build options for <command>meson configure</command> (and <command>meson setup</command>) are explained in <xref linkend="meson-options"/>.
</para>
</step>
@@ -2078,6 +2077,13 @@ ninja
processes used with the command line argument <literal>-j</literal>.
</para>
+ <para>
+ If you want to build the docs, you can type:
+<screen>
+ninja docs
+</screen>
+ </para>
+
<para>
It should be noted that after the initial configure step,
<command>ninja</command> is the only command you ever need to type to
@@ -2118,9 +2124,9 @@ ninja
<userinput>meson test</userinput>
</screen>
(This won't work as root; do it as an unprivileged user.)
- See <xref linkend="regress"/> for
- detailed information about interpreting the test results. You can
- repeat this test at any later time by issuing the same command.
+ You can repeat this test at any later time by issuing the same command.
+ You can also see <xref linkend="regress"/> for
+ detailed information about interpreting the test results.
</para>
<para>
@@ -2191,16 +2197,16 @@ ninja install
</sect2>
<sect2 id="meson-options">
- <title><literal>meson setup</literal> Options</title>
+ <title>Configuration Options</title>
<para>
- <command>meson setup</command>'s command-line options are explained below.
+ <command>meson setup</command> and <command>meson configure</command>
+ support several command-line options which are explained below.
This list is not exhaustive (use <literal>meson configure --help</literal>
to get one that is). The options not covered here are meant for advanced
use-cases, and are documented in the standard <ulink
url="https://mesonbuild.com/Commands.html#configure">Meson
- documentation</ulink>. These arguments can be used with <command>meson
- setup</command> as well.
+ documentation</ulink>.
</para>
<sect3 id="meson-options-locations">
--
2.38.1
[application/octet-stream] v9-0003-Remove-Anti-Features-section-from-Installation-fr.patch (8.1K, ../../CAJxrbywZDLXga8kz3brvDd81M6QNbTN2DHM5v7uDgSm8=RROEQ@mail.gmail.com/6-v9-0003-Remove-Anti-Features-section-from-Installation-fr.patch)
download | inline diff:
From 11d82aa49efb3d1cbc08f14562a757f115053c8b Mon Sep 17 00:00:00 2001
From: Samay Sharma <[email protected]>
Date: Mon, 13 Feb 2023 16:23:52 -0800
Subject: [PATCH v9 3/5] Remove Anti-Features section from Installation from
source docs
Currently, several meson setup options are listed in anti-features.
However, they are similar to most other options in the postgres
features list as they are 'auto' features themselves. Also, other
options are likely better suited to the developer options section.
This commit, therefore, moves the options listed in the anti-features
section into other sections and removes that section.
For consistency, this reorganization has been done on the make section
of the docs as well.
---
doc/src/sgml/installation.sgml | 140 ++++++++++++++-------------------
1 file changed, 57 insertions(+), 83 deletions(-)
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 7e65cdd72e..d7ab0c205e 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -1214,23 +1214,6 @@ build-postgresql:
</listitem>
</varlistentry>
- </variablelist>
-
- </sect3>
-
- <sect3 id="configure-options-anti-features">
- <title>Anti-Features</title>
-
- <para>
- The options described in this section allow disabling
- certain <productname>PostgreSQL</productname> features that are built
- by default, but which might need to be turned off if the required
- software or system features are not available. Using these options is
- not recommended unless really necessary.
- </para>
-
- <variablelist>
-
<varlistentry id="configure-option-without-readline">
<term><option>--without-readline</option></term>
<listitem>
@@ -1270,34 +1253,6 @@ build-postgresql:
</listitem>
</varlistentry>
- <varlistentry id="configure-option-disable-spinlocks">
- <term><option>--disable-spinlocks</option></term>
- <listitem>
- <para>
- Allow the build to succeed even if <productname>PostgreSQL</productname>
- has no CPU spinlock support for the platform. The lack of
- spinlock support will result in very poor performance; therefore,
- this option should only be used if the build aborts and
- informs you that the platform lacks spinlock support. If this
- option is required to build <productname>PostgreSQL</productname> on
- your platform, please report the problem to the
- <productname>PostgreSQL</productname> developers.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="configure-option-disable-atomics">
- <term><option>--disable-atomics</option></term>
- <listitem>
- <para>
- Disable use of CPU atomic operations. This option does nothing on
- platforms that lack such operations. On platforms that do have
- them, this will result in poor performance. This option is only
- useful for debugging or making performance comparisons.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry id="configure-option-disable-thread-safety">
<term><option>--disable-thread-safety</option></term>
<listitem>
@@ -1702,6 +1657,34 @@ build-postgresql:
</listitem>
</varlistentry>
+ <varlistentry id="configure-option-disable-spinlocks">
+ <term><option>--disable-spinlocks</option></term>
+ <listitem>
+ <para>
+ Allow the build to succeed even if <productname>PostgreSQL</productname>
+ has no CPU spinlock support for the platform. The lack of
+ spinlock support will result in very poor performance; therefore,
+ this option should only be used if the build aborts and
+ informs you that the platform lacks spinlock support. If this
+ option is required to build <productname>PostgreSQL</productname> on
+ your platform, please report the problem to the
+ <productname>PostgreSQL</productname> developers.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="configure-option-disable-atomics">
+ <term><option>--disable-atomics</option></term>
+ <listitem>
+ <para>
+ Disable use of CPU atomic operations. This option does nothing on
+ platforms that lack such operations. On platforms that do have
+ them, this will result in poor performance. This option is only
+ useful for debugging or making performance comparisons.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</sect3>
@@ -2657,13 +2640,6 @@ ninja install
</para>
</listitem>
</varlistentry>
- </variablelist>
- </sect3>
-
- <sect3 id="meson-options-anti-features">
- <title>Anti-Features</title>
-
- <variablelist>
<varlistentry id="configure-readline-meson">
<term><option>-Dreadline={ auto | enabled | disabled }</option></term>
<listitem>
@@ -2703,36 +2679,6 @@ ninja install
</para>
</listitem>
</varlistentry>
-
- <varlistentry id="configure-spinlocks-meson">
- <term><option>-Dspinlocks={ true | false }</option></term>
- <listitem>
- <para>
- This option is set to true by default; setting it to false will
- allow the build to succeed even if <productname>PostgreSQL</productname>
- has no CPU spinlock support for the platform. The lack of
- spinlock support will result in very poor performance; therefore,
- this option should only be changed if the build aborts and
- informs you that the platform lacks spinlock support. If setting this
- option to false is required to build <productname>PostgreSQL</productname> on
- your platform, please report the problem to the
- <productname>PostgreSQL</productname> developers.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="configure-atomics-meson">
- <term><option>-Datomics={ true | false }</option></term>
- <listitem>
- <para>
- This option is set to true by default; setting it to false will
- disable use of CPU atomic operations. The option does nothing on
- platforms that lack such operations. On platforms that do have
- them, disabling atomics will result in poor performance. Changing
- this option is only useful for debugging or making performance comparisons.
- </para>
- </listitem>
- </varlistentry>
</variablelist>
</sect3>
@@ -3175,8 +3121,36 @@ ninja install
</para>
</listitem>
</varlistentry>
+ <varlistentry id="configure-spinlocks-meson">
+ <term><option>-Dspinlocks={ true | false }</option></term>
+ <listitem>
+ <para>
+ This option is set to true by default; setting it to false will
+ allow the build to succeed even if <productname>PostgreSQL</productname>
+ has no CPU spinlock support for the platform. The lack of
+ spinlock support will result in very poor performance; therefore,
+ this option should only be changed if the build aborts and
+ informs you that the platform lacks spinlock support. If setting this
+ option to false is required to build <productname>PostgreSQL</productname> on
+ your platform, please report the problem to the
+ <productname>PostgreSQL</productname> developers.
+ </para>
+ </listitem>
+ </varlistentry>
- </variablelist>
+ <varlistentry id="configure-atomics-meson">
+ <term><option>-Datomics={ true | false }</option></term>
+ <listitem>
+ <para>
+ This option is set to true by default; setting it to false will
+ disable use of CPU atomic operations. The option does nothing on
+ platforms that lack such operations. On platforms that do have
+ them, disabling atomics will result in poor performance. Changing
+ this option is only useful for debugging or making performance comparisons.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</sect3>
</sect2>
</sect1>
--
2.38.1
[application/octet-stream] v9-0005-Change-Short-Version-for-meson-installation-guide.patch (2.0K, ../../CAJxrbywZDLXga8kz3brvDd81M6QNbTN2DHM5v7uDgSm8=RROEQ@mail.gmail.com/7-v9-0005-Change-Short-Version-for-meson-installation-guide.patch)
download | inline diff:
From 6945616e713be01cc779e14c78ad0f8e8a69876b Mon Sep 17 00:00:00 2001
From: Samay Sharma <[email protected]>
Date: Fri, 24 Feb 2023 20:41:28 -0800
Subject: [PATCH v9 5/5] Change Short Version for meson installation guide
This commit proposes a new version of the short version for building
from source using meson. Some advantages over the current version
include: does not require sudo, creates a localised installation
path and doesn't replace system binaries, doesn't have distro specific
commands and has one line description of what each command does.
---
doc/src/sgml/installation.sgml | 40 +++++++++++++++++++++++++---------
1 file changed, 30 insertions(+), 10 deletions(-)
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 0efbb1c2a3..d1791e5952 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -1967,19 +1967,39 @@ build-postgresql:
<para>
<synopsis>
-meson setup build --prefix=/usr/local/pgsql
+# create working directory
+mkdir postgres
+cd postgres
+
+# fetch source code
+git clone https://git.postgresql.org/git/postgresql.git src
+
+# setup and enter build directory (done only first time)
+## Unix based platforms
+meson setup build src --prefix=$PWD/install
+
+## Windows
+meson setup build src --prefix=%cd%/install
+
cd build
+
+# Compile source
ninja
-su
+
+# Install to the prefix directory specified above
ninja install
-adduser postgres
-mkdir -p /usr/local/pgsql/data
-chown postgres /usr/local/pgsql/data
-su - postgres
-/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
-/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
-/usr/local/pgsql/bin/createdb test
-/usr/local/pgsql/bin/psql test
+
+# Run all tests (optional, takes time)
+meson test
+
+# Initialize a new database
+../install/bin/initdb -D ../data
+
+# Start database
+../install/bin/pg_ctl -D ../data/ -l logfile start
+
+# Connect to the database
+../install/bin/psql -d postgres
</synopsis>
The long version is the rest of this
<phrase>section</phrase>.
--
2.38.1
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
@ 2023-04-11 17:18 ` Andres Freund <[email protected]>
2023-04-11 21:41 ` Re: Documentation for building with meson samay sharma <[email protected]>
2023-04-12 21:19 ` Re: Documentation for building with meson Peter Eisentraut <[email protected]>
3 siblings, 2 replies; 11+ messages in thread
From: Andres Freund @ 2023-04-11 17:18 UTC (permalink / raw)
To: samay sharma <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
Hi,
On 2023-03-28 12:27:26 -0700, samay sharma wrote:
> Subject: [PATCH v9 1/5] Make minor additions and corrections to meson docs
>
> This commit makes a few corrections to the meson docs
> and adds a few instructions and links for better clarity.
> ---
> doc/src/sgml/installation.sgml | 24 +++++++++++++++---------
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
> index 70ab5b77d8..e3b9b6c0d0 100644
> --- a/doc/src/sgml/installation.sgml
> +++ b/doc/src/sgml/installation.sgml
> @@ -2057,8 +2057,7 @@ meson setup build -Dssl=openssl
> <screen>
> meson configure -Dcassert=true
> </screen>
> - <command>meson configure</command>'s commonly used command-line options
> - are explained in <xref linkend="meson-options"/>.
> + Commonly used build options for <command>meson configure</command> (and <command>meson setup</command>) are explained in <xref linkend="meson-options"/>.
> </para>
> </step>
>
> @@ -2078,6 +2077,13 @@ ninja
> processes used with the command line argument <literal>-j</literal>.
> </para>
>
> + <para>
> + If you want to build the docs, you can type:
> +<screen>
> +ninja docs
> +</screen>
> + </para>
"type" sounds a bit too, IDK, process oriented. "To build the docs, use"?
> Subject: [PATCH v9 2/5] Add data layout options sub-section in installation
> docs
>
> This commit separates out blocksize, segsize and wal_blocksize
> options into a separate Data layout options sub-section in both
> the make and meson docs. They were earlier in a miscellaneous
> section which included several unrelated options. This change
> also helps reduce the repetition of the warnings that changing
> these parameters breaks on-disk compatibility.
Makes sense. I'm planning to apply this unless Peter or somebody else has
further feedback.
> From 11d82aa49efb3d1cbc08f14562a757f115053c8b Mon Sep 17 00:00:00 2001
> From: Samay Sharma <[email protected]>
> Date: Mon, 13 Feb 2023 16:23:52 -0800
> Subject: [PATCH v9 3/5] Remove Anti-Features section from Installation from
> source docs
>
> Currently, several meson setup options are listed in anti-features.
> However, they are similar to most other options in the postgres
> features list as they are 'auto' features themselves. Also, other
> options are likely better suited to the developer options section.
> This commit, therefore, moves the options listed in the anti-features
> section into other sections and removes that section.
>
> For consistency, this reorganization has been done on the make section
> of the docs as well.
Makes sense to me. "Anti-Features" is confusing as a name to start with.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
2023-04-11 17:18 ` Re: Documentation for building with meson Andres Freund <[email protected]>
@ 2023-04-11 21:41 ` samay sharma <[email protected]>
1 sibling, 0 replies; 11+ messages in thread
From: samay sharma @ 2023-04-11 21:41 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
Hi,
On Tue, Apr 11, 2023 at 10:18 AM Andres Freund <[email protected]> wrote:
> Hi,
>
> On 2023-03-28 12:27:26 -0700, samay sharma wrote:
> > Subject: [PATCH v9 1/5] Make minor additions and corrections to meson
> docs
> >
> > This commit makes a few corrections to the meson docs
> > and adds a few instructions and links for better clarity.
> > ---
> > doc/src/sgml/installation.sgml | 24 +++++++++++++++---------
> > 1 file changed, 15 insertions(+), 9 deletions(-)
> >
> > diff --git a/doc/src/sgml/installation.sgml
> b/doc/src/sgml/installation.sgml
> > index 70ab5b77d8..e3b9b6c0d0 100644
> > --- a/doc/src/sgml/installation.sgml
> > +++ b/doc/src/sgml/installation.sgml
> > @@ -2057,8 +2057,7 @@ meson setup build -Dssl=openssl
> > <screen>
> > meson configure -Dcassert=true
> > </screen>
> > - <command>meson configure</command>'s commonly used command-line
> options
> > - are explained in <xref linkend="meson-options"/>.
> > + Commonly used build options for <command>meson configure</command>
> (and <command>meson setup</command>) are explained in <xref
> linkend="meson-options"/>.
> > </para>
> > </step>
> >
> > @@ -2078,6 +2077,13 @@ ninja
> > processes used with the command line argument <literal>-j</literal>.
> > </para>
> >
> > + <para>
> > + If you want to build the docs, you can type:
> > +<screen>
> > +ninja docs
> > +</screen>
> > + </para>
>
> "type" sounds a bit too, IDK, process oriented. "To build the docs, use"?
>
Sure, that works.
>
>
> > Subject: [PATCH v9 2/5] Add data layout options sub-section in
> installation
> > docs
> >
> > This commit separates out blocksize, segsize and wal_blocksize
> > options into a separate Data layout options sub-section in both
> > the make and meson docs. They were earlier in a miscellaneous
> > section which included several unrelated options. This change
> > also helps reduce the repetition of the warnings that changing
> > these parameters breaks on-disk compatibility.
>
> Makes sense. I'm planning to apply this unless Peter or somebody else has
> further feedback.
>
Cool.
>
>
> > From 11d82aa49efb3d1cbc08f14562a757f115053c8b Mon Sep 17 00:00:00 2001
> > From: Samay Sharma <[email protected]>
> > Date: Mon, 13 Feb 2023 16:23:52 -0800
> > Subject: [PATCH v9 3/5] Remove Anti-Features section from Installation
> from
> > source docs
> >
> > Currently, several meson setup options are listed in anti-features.
> > However, they are similar to most other options in the postgres
> > features list as they are 'auto' features themselves. Also, other
> > options are likely better suited to the developer options section.
> > This commit, therefore, moves the options listed in the anti-features
> > section into other sections and removes that section.
> >
> > For consistency, this reorganization has been done on the make section
> > of the docs as well.
>
> Makes sense to me. "Anti-Features" is confusing as a name to start with.
>
> Greetings,
>
> Andres Freund
>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
2023-04-11 17:18 ` Re: Documentation for building with meson Andres Freund <[email protected]>
@ 2023-04-12 21:19 ` Peter Eisentraut <[email protected]>
2023-05-30 18:13 ` Re: Documentation for building with meson Tristan Partin <[email protected]>
1 sibling, 1 reply; 11+ messages in thread
From: Peter Eisentraut @ 2023-04-12 21:19 UTC (permalink / raw)
To: Andres Freund <[email protected]>; samay sharma <[email protected]>; +Cc: Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
On 11.04.23 19:18, Andres Freund wrote:
>> Subject: [PATCH v9 2/5] Add data layout options sub-section in installation
>> docs
>>
>> This commit separates out blocksize, segsize and wal_blocksize
>> options into a separate Data layout options sub-section in both
>> the make and meson docs. They were earlier in a miscellaneous
>> section which included several unrelated options. This change
>> also helps reduce the repetition of the warnings that changing
>> these parameters breaks on-disk compatibility.
>
> Makes sense. I'm planning to apply this unless Peter or somebody else has
> further feedback.
I'm okay with patches 0001 through 0004.
I don't like 0005. I think we should drop that for now and maybe have a
separate discussion under a separate heading about that.
>
>
>> From 11d82aa49efb3d1cbc08f14562a757f115053c8b Mon Sep 17 00:00:00 2001
>> From: Samay Sharma <[email protected]>
>> Date: Mon, 13 Feb 2023 16:23:52 -0800
>> Subject: [PATCH v9 3/5] Remove Anti-Features section from Installation from
>> source docs
>>
>> Currently, several meson setup options are listed in anti-features.
>> However, they are similar to most other options in the postgres
>> features list as they are 'auto' features themselves. Also, other
>> options are likely better suited to the developer options section.
>> This commit, therefore, moves the options listed in the anti-features
>> section into other sections and removes that section.
>>
>> For consistency, this reorganization has been done on the make section
>> of the docs as well.
>
> Makes sense to me. "Anti-Features" is confusing as a name to start with.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
2023-04-11 17:18 ` Re: Documentation for building with meson Andres Freund <[email protected]>
2023-04-12 21:19 ` Re: Documentation for building with meson Peter Eisentraut <[email protected]>
@ 2023-05-30 18:13 ` Tristan Partin <[email protected]>
0 siblings, 0 replies; 11+ messages in thread
From: Tristan Partin @ 2023-05-30 18:13 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; Andres Freund <[email protected]>; samay sharma <[email protected]>; +Cc: Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
On Wed Apr 12, 2023 at 4:19 PM CDT, Peter Eisentraut wrote:
> On 11.04.23 19:18, Andres Freund wrote:
> >> Subject: [PATCH v9 2/5] Add data layout options sub-section in installation
> >> docs
> >>
> >> This commit separates out blocksize, segsize and wal_blocksize
> >> options into a separate Data layout options sub-section in both
> >> the make and meson docs. They were earlier in a miscellaneous
> >> section which included several unrelated options. This change
> >> also helps reduce the repetition of the warnings that changing
> >> these parameters breaks on-disk compatibility.
> >
> > Makes sense. I'm planning to apply this unless Peter or somebody else has
> > further feedback.
>
> I'm okay with patches 0001 through 0004.
>
> I don't like 0005. I think we should drop that for now and maybe have a
> separate discussion under a separate heading about that.
With regard to 0005, perhaps it makes the most sense to use the XDG
Directory Specification as an example. Install into ~/.local or
~/.local/postgres (as the Meson default prefix is). Put the data into
~/.var/lib/postgres or something similar.
--
Tristan Partin
Neon (https://neon.tech)
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
@ 2023-05-30 18:09 ` Tristan Partin <[email protected]>
3 siblings, 0 replies; 11+ messages in thread
From: Tristan Partin @ 2023-05-30 18:09 UTC (permalink / raw)
To: samay sharma <[email protected]>; Peter Eisentraut <[email protected]>; +Cc: Andres Freund <[email protected]>; Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
Hey!
Nice work organizing the docs. Looks pretty good. I had a single comment
regarding the Meson docs in general.
It seems like Postgres cares a bit about Windows/Mac development. Is
ninja the blessed way to build Postgres on Windows and Mac? Otherwise, I
would suggest just being more generic and replace instances of `ninja
xxx` in the docs with `meson compile xxx`, making the command
backend-agnostic to accomodate XCode and VS project users.
--
Tristan Partin
Neon (https://neon.tech)
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
@ 2023-06-10 04:00 ` Andres Freund <[email protected]>
2023-06-12 20:33 ` Re: Documentation for building with meson Peter Eisentraut <[email protected]>
3 siblings, 1 reply; 11+ messages in thread
From: Andres Freund @ 2023-06-10 04:00 UTC (permalink / raw)
To: samay sharma <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
Hi,
On 2023-03-28 12:27:26 -0700, samay sharma wrote:
> + <para>
> + If you want to build the docs, you can type:
> +<screen>
> +ninja docs
> +</screen>
> + </para>
To me 'you can type' sounds odd. To me even just "To build the docs:" would
sound better. But the make docs do it "your" way, so I'll just go along with
it for now.
> From c5e637a54c2b83e5bd8c4155784d97e82937eb51 Mon Sep 17 00:00:00 2001
> From: Samay Sharma <[email protected]>
> Date: Mon, 6 Feb 2023 16:09:42 -0800
> Subject: [PATCH v9 2/5] Add data layout options sub-section in installation
> docs
>
> This commit separates out blocksize, segsize and wal_blocksize
> options into a separate Data layout options sub-section in both
> the make and meson docs. They were earlier in a miscellaneous
> section which included several unrelated options. This change
> also helps reduce the repetition of the warnings that changing
> these parameters breaks on-disk compatibility.
I still like this change, but ISTM that the "Data Layout" section should
follow the "PostgreSQL Features" section, rather than follow "Anti Features",
"Build Process Details" and "Miscellaneous". I realize some of these are
reorganized later on, but even then "Build Process Details"
Would anybody mind if I swapped these around?
> + <varlistentry id="meson-option-with-blocksize">
I don't quite understand the "-with" added to the ids?
> From 11d82aa49efb3d1cbc08f14562a757f115053c8b Mon Sep 17 00:00:00 2001
> From: Samay Sharma <[email protected]>
> Date: Mon, 13 Feb 2023 16:23:52 -0800
> Subject: [PATCH v9 3/5] Remove Anti-Features section from Installation from
> source docs
>
> Currently, several meson setup options are listed in anti-features.
> However, they are similar to most other options in the postgres
> features list as they are 'auto' features themselves. Also, other
> options are likely better suited to the developer options section.
> This commit, therefore, moves the options listed in the anti-features
> section into other sections and removes that section.
> For consistency, this reorganization has been done on the make section
> of the docs as well.
> ---
> doc/src/sgml/installation.sgml | 140 ++++++++++++++-------------------
> 1 file changed, 57 insertions(+), 83 deletions(-)
>
> diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
> index 7e65cdd72e..d7ab0c205e 100644
> --- a/doc/src/sgml/installation.sgml
> +++ b/doc/src/sgml/installation.sgml
> @@ -1214,23 +1214,6 @@ build-postgresql:
> </listitem>
> </varlistentry>
>
> - </variablelist>
> -
> - </sect3>
> -
> - <sect3 id="configure-options-anti-features">
> - <title>Anti-Features</title>
> -
> - <para>
> - The options described in this section allow disabling
> - certain <productname>PostgreSQL</productname> features that are built
> - by default, but which might need to be turned off if the required
> - software or system features are not available. Using these options is
> - not recommended unless really necessary.
> - </para>
> -
> - <variablelist>
> -
> <varlistentry id="configure-option-without-readline">
> <term><option>--without-readline</option></term>
> <listitem>
I don't think this is quite right. The section above the list says
"The options described in this section enable building of various PostgreSQL
features that are not built by default. Most of these are non-default only
because they require additional software, as described in Section 17.1."
So just merging --without-icu, --without-readline, --without-zlib,
--disable-thread-safety, in with the rest doesn't quite seem right.
I suspect that the easiest way for that is to just move --disable-atomics,
--disable-spinlocks to the developer section and then to leave the
anti-features section around for autoconf.
Any better idea?
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
2023-06-10 04:00 ` Re: Documentation for building with meson Andres Freund <[email protected]>
@ 2023-06-12 20:33 ` Peter Eisentraut <[email protected]>
0 siblings, 0 replies; 11+ messages in thread
From: Peter Eisentraut @ 2023-06-12 20:33 UTC (permalink / raw)
To: Andres Freund <[email protected]>; samay sharma <[email protected]>; +Cc: Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
On 10.06.23 06:00, Andres Freund wrote:
>> From c5e637a54c2b83e5bd8c4155784d97e82937eb51 Mon Sep 17 00:00:00 2001
>> From: Samay Sharma<[email protected]>
>> Date: Mon, 6 Feb 2023 16:09:42 -0800
>> Subject: [PATCH v9 2/5] Add data layout options sub-section in installation
>> docs
>>
>> This commit separates out blocksize, segsize and wal_blocksize
>> options into a separate Data layout options sub-section in both
>> the make and meson docs. They were earlier in a miscellaneous
>> section which included several unrelated options. This change
>> also helps reduce the repetition of the warnings that changing
>> these parameters breaks on-disk compatibility.
> I still like this change, but ISTM that the "Data Layout" section should
> follow the "PostgreSQL Features" section, rather than follow "Anti Features",
> "Build Process Details" and "Miscellaneous". I realize some of these are
> reorganized later on, but even then "Build Process Details"
>
> Would anybody mind if I swapped these around?
I don't mind a Data Layout section in principle, but I wonder whether
it's worth changing now. The segsize option is proposed to be turned
into a run-time option (and/or removed). For the WAL block size, I had
previously mentioned, I don't think it is correct that pg_upgrade should
actually care about it. So I wouldn't spend too much time trying to
carefully refactor the notes on the data layout options if we're going
to have to change them around before long again anyway.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Documentation for building with meson
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` Re: Documentation for building with meson samay sharma <[email protected]>
@ 2024-01-20 01:53 ` vignesh C <[email protected]>
3 siblings, 0 replies; 11+ messages in thread
From: vignesh C @ 2024-01-20 01:53 UTC (permalink / raw)
To: samay sharma <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; Andres Freund <[email protected]>; Justin Pryzby <[email protected]>; Nazir Bilal Yavuz <[email protected]>; John Naylor <[email protected]>; pgsql-hackers
On Wed, 29 Mar 2023 at 00:57, samay sharma <[email protected]> wrote:
>
> Hi,
>
> On Wed, Mar 15, 2023 at 4:28 AM Peter Eisentraut <[email protected]> wrote:
>>
>> > [PATCH v8 1/5] Make minor additions and corrections to meson docs
>>
>> The last hunk revealed that there is some mixing up between meson setup
>> and meson configure. This goes a bit further. For example, earlier it
>> says that to get a list of meson setup options, call meson configure
>> --help and look at https://mesonbuild.com/Commands.html#configure, which
>> are both wrong. Also later throughout the text it uses one or the
>> other. I think this has the potential to be very confusing, and we
>> should clean this up carefully.
>>
>> The text about additional meson test options maybe should go into the
>> regress.sgml chapter?
>
>
> I tried to make the meson setup and meson configure usage consistent. I've removed the text for the test options.
>>
>>
>>
>> > [PATCH v8 2/5] Add data layout options sub-section in installation
>> docs
>>
>> This makes sense. Please double check your patch for correct title
>> casing, vertical spacing of XML, to keep everything looking consistent.
>
>
> Thanks for noticing. Made it consistent on both sides.
>>
>>
>> This text isn't yours, but since your patch emphasizes it, I wonder if
>> it could use some clarification:
>>
>> + These options affect how PostgreSQL lays out data on disk.
>> + Note that changing these breaks on-disk database compatibility,
>> + meaning you cannot use <command>pg_upgrade</command> to upgrade to
>> + a build with different values of these options.
>>
>> This isn't really correct. What breaking on-disk compatibility means is
>> that you can't use a server compiled one way with a data directory
>> initialized by binaries compiled another way. pg_upgrade may well have
>> the ability to upgrade between one or the other; that's up to pg_upgrade
>> to figure out but not an intrinsic property. (I wonder why pg_upgrade
>> cares about the WAL block size.)
>
>
> Fixed.
>>
>>
>>
>> > [PATCH v8 3/5] Remove Anti-Features section from Installation from
>> source docs
>>
>> Makes sense. But is "--disable-thread-safety" really a developer
>> feature? I think not.
>>
>
> Moved to PostgreSQL features. Do you think there's a better place for it?
>
>>
>>
>> > [PATCH v8 4/5] Re-organize Miscellaneous section
>>
>> This moves the Miscellaneous section after Developer Features. I think
>> Developer Features should be last.
>>
>> Maybe should remove this section and add the options to the regular
>> PostgreSQL Features section.
>
>
> Yes, that makes sense. Made this change.
>>
>>
>> Also consider the grouping in meson_options.txt, which is slightly
>> different yet.
>
>
> Removed Misc options section from meson_options.txt too.
>>
>>
>>
>> > [PATCH v8 5/5] Change Short Version for meson installation guide
>>
>> +# create working directory
>> +mkdir postgres
>> +cd postgres
>> +
>> +# fetch source code
>> +git clone https://git.postgresql.org/git/postgresql.git src
>>
>> This comes after the "Getting the Source" section, so at this point they
>> already have the source and don't need to do "git clone" etc. again.
>>
>> +# setup and enter build directory (done only first time)
>> +## Unix based platforms
>> +meson setup build src --prefix=$PWD/install
>> +
>> +## Windows
>> +meson setup build src --prefix=%cd%/install
>>
>> Maybe some people work this way, but to me the directory structures you
>> create here are completely weird.
>
>
> I'd like to discuss what you think is a good directory structure to work with. I've mentioned some of the drawbacks I see with the current structure for the short version. I know this structure can feel different but it feeling weird is not ideal. Do you have a directory structure in mind which is different but doesn't feel odd to you?
>
>>
>>
>> +# Initialize a new database
>> +../install/bin/initdb -D ../data
>> +
>> +# Start database
>> +../install/bin/pg_ctl -D ../data/ -l logfile start
>> +
>> +# Connect to the database
>> +../install/bin/psql -d postgres
>>
>> The terminology here needs to be tightened up. You are using "database"
>> here to mean three different things.
>
>
> I'll address this together once we are aligned on the overall directory structure etc.
>
>> There are a few reasons why I had done this. Some reasons Andres has described in his previous email and I'll add a few specific examples on why having the same section for both might not be a good idea.
>>
>> * Having readline and zlib as required for building PostgreSQL is now wrong because they are not required for meson builds. Also, the name of the configs are different for make and meson and the current section only lists the make ones.
>> * There are many references to configure in that section which don't apply to meson.
>> * Last I checked Flex and Bison were always required to build via meson but not for make and the current section doesn't explain those differences.
>>
>> I spent a good amount of time thinking if we could have a single section, clarify these differences to make it correct and not confuse the users. I couldn't find a way to do all three. Therefore, I think we should move to a different requirements section for both. I'm happy to re-propose the previous version which separates them but wanted to see if anybody has better ideas.
>
>
> Do you have thoughts on the requirements section and the motivation to have two different versions I had mentioned upthread?
I have changed the status of commitfest entry to "Returned with
Feedback" as there was no followup on Tristan Partin and Andres's
comments from many months. Please handle the comments and add a new
commitfest entry if required for any pending tasks left.
Regards,
Vignesh
^ permalink raw reply [nested|flat] 11+ messages in thread
* [PATCH v4 2/3] Improve pg_ctl postmaster process check on Windows
@ 2023-10-24 05:46 Kyotaro Horiguchi <[email protected]>
0 siblings, 0 replies; 11+ messages in thread
From: Kyotaro Horiguchi @ 2023-10-24 05:46 UTC (permalink / raw)
Currently pg_ctl on Windows does not verify that it actually executed
a postmaster process due to lack of process ID knowledge. This can
lead to false positives in cases where another pg_ctl instance starts
a different server simultaneously.
This patch adds the capability to identify the process ID of the
launched postmaster on Windows, similar to other OS versions, ensuring
more reliable detection of concurrent server startups.
---
src/bin/pg_ctl/pg_ctl.c | 102 ++++++++++++++++++++++++++++++++++++----
1 file changed, 93 insertions(+), 9 deletions(-)
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 3ac2fcc004..9c0168b075 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -132,6 +132,7 @@ static void adjust_data_dir(void);
#ifdef WIN32
#include <versionhelpers.h>
+#include <tlhelp32.h>
static bool pgwin32_IsInstalled(SC_HANDLE);
static char *pgwin32_CommandLine(bool);
static void pgwin32_doRegister(void);
@@ -142,6 +143,7 @@ static void WINAPI pgwin32_ServiceMain(DWORD, LPTSTR *);
static void pgwin32_doRunAsService(void);
static int CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo, bool as_service);
static PTOKEN_PRIVILEGES GetPrivilegesToDelete(HANDLE hToken);
+static pid_t pgwin32_find_postmaster_pid(pid_t shell_pid);
#endif
static pid_t get_pgpid(bool is_status_request);
@@ -609,7 +611,11 @@ wait_for_postmaster_start(pid_t pm_pid, bool do_checkpoint)
/* File is complete enough for us, parse it */
pid_t pmpid;
time_t pmstart;
-
+#ifndef WIN32
+ pid_t wait_pid = pm_pid;
+#else
+ pid_t wait_pid = pgwin32_find_postmaster_pid(pm_pid);
+#endif
/*
* Make sanity checks. If it's for the wrong PID, or the recorded
* start time is before pg_ctl started, then either we are looking
@@ -619,14 +625,8 @@ wait_for_postmaster_start(pid_t pm_pid, bool do_checkpoint)
*/
pmpid = atol(optlines[LOCK_FILE_LINE_PID - 1]);
pmstart = atol(optlines[LOCK_FILE_LINE_START_TIME - 1]);
- if (pmstart >= start_time - 2 &&
-#ifndef WIN32
- pmpid == pm_pid
-#else
- /* Windows can only reject standalone-backend PIDs */
- pmpid > 0
-#endif
- )
+
+ if (pmstart >= start_time - 2 && pmpid == wait_pid)
{
/*
* OK, seems to be a valid pidfile from our child. Check the
@@ -1950,6 +1950,90 @@ GetPrivilegesToDelete(HANDLE hToken)
return tokenPrivs;
}
+
+/*
+ * Find the PID of the launched postmaster.
+ *
+ * On Windows, the cmd.exe doesn't support the exec command. As a result, we
+ * don't directly get the postmaster's PID. This function identifies the PID of
+ * the postmaster started by the child cmd.exe.
+ *
+ * Returns the postmaster's PID. If the shell is alive but the postmaster is
+ * missing, returns 0. Otherwise terminates this command with an error.
+ *
+ * This function uses PID 0 as an invalid value, assuming the system idle
+ * process occupies it and it won't be a PID for a shell or postmaster.
+ */
+static pid_t
+pgwin32_find_postmaster_pid(pid_t shell_pid)
+{
+ HANDLE hSnapshot;
+ PROCESSENTRY32 ppe;
+ pid_t pm_pid = 0; /* abusing 0 as an invalid value */
+ bool multiple_children = false;
+ DWORD last_error;
+
+ /* create a process snapshot */
+ hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ if (hSnapshot == INVALID_HANDLE_VALUE)
+ {
+ write_stderr(_("%s: CreateToolhelp32Snapshot failed\n"),
+ progname);
+ exit(1);
+ }
+
+ /* start iterating on the snapshot */
+ ppe.dwSize = sizeof(PROCESSENTRY32);
+ if (!Process32First(hSnapshot, &ppe))
+ {
+ write_stderr(_("%s: Process32First failed: errcode=%08lx\n"),
+ progname, GetLastError());
+ exit(1);
+ }
+
+ /*
+ * Iterate over the snapshot
+ *
+ * Check for duplicate processes to ensure reliability.
+ *
+ * The launcher shell might start other cmd.exe instances or programs
+ * besides postgres.exe. Veryfying the program file name is essential.
+ *
+ * The launcher shell process isn't checked in this function. It will be
+ * checked by the caller.
+ */
+ do
+ {
+ if (ppe.th32ParentProcessID == shell_pid &&
+ strcmp("postgres.exe", ppe.szExeFile) == 0)
+ {
+ if (pm_pid != ppe.th32ProcessID && pm_pid != 0)
+ multiple_children = true;
+ pm_pid = ppe.th32ProcessID;
+ }
+ }
+ while (Process32Next(hSnapshot, &ppe));
+
+ /* avoid multiple calls primary for clarity, not out of necessity */
+ last_error = GetLastError();
+ if (last_error != ERROR_NO_MORE_FILES)
+ {
+ write_stderr(_("%s: Process32Next failed: errcode=%08lx\n"),
+ progname, last_error);
+ exit(1);
+ }
+ CloseHandle(hSnapshot);
+
+ /* assuming the launching shell executes a single process */
+ if (multiple_children)
+ {
+ write_stderr(_("%s: multiple postmasters found\n"),
+ progname);
+ exit(1);
+ }
+
+ return pm_pid;
+}
#endif /* WIN32 */
static void
--
2.39.3
----Next_Part(Tue_Oct_24_15_00_27_2023_044)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="v4-0003-Remove-short-sleep-from-001_start_stop.pl.patch"
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2024-01-20 01:53 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 11:28 Re: Documentation for building with meson Peter Eisentraut <[email protected]>
2023-03-28 19:27 ` samay sharma <[email protected]>
2023-04-11 17:18 ` Andres Freund <[email protected]>
2023-04-11 21:41 ` samay sharma <[email protected]>
2023-04-12 21:19 ` Peter Eisentraut <[email protected]>
2023-05-30 18:13 ` Tristan Partin <[email protected]>
2023-05-30 18:09 ` Tristan Partin <[email protected]>
2023-06-10 04:00 ` Andres Freund <[email protected]>
2023-06-12 20:33 ` Peter Eisentraut <[email protected]>
2024-01-20 01:53 ` vignesh C <[email protected]>
2023-10-24 05:46 [PATCH v4 2/3] Improve pg_ctl postmaster process check on Windows Kyotaro Horiguchi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox