postgresql/src/backend/utils
Peter Eisentraut 721856ff24 Remove distprep
A PostgreSQL release tarball contains a number of prebuilt files, in
particular files produced by bison, flex, perl, and well as html and
man documentation.  We have done this consistent with established
practice at the time to not require these tools for building from a
tarball.  Some of these tools were hard to get, or get the right
version of, from time to time, and shipping the prebuilt output was a
convenience to users.

Now this has at least two problems:

One, we have to make the build system(s) work in two modes: Building
from a git checkout and building from a tarball.  This is pretty
complicated, but it works so far for autoconf/make.  It does not
currently work for meson; you can currently only build with meson from
a git checkout.  Making meson builds work from a tarball seems very
difficult or impossible.  One particular problem is that since meson
requires a separate build directory, we cannot make the build update
files like gram.h in the source tree.  So if you were to build from a
tarball and update gram.y, you will have a gram.h in the source tree
and one in the build tree, but the way things work is that the
compiler will always use the one in the source tree.  So you cannot,
for example, make any gram.y changes when building from a tarball.
This seems impossible to fix in a non-horrible way.

Second, there is increased interest nowadays in precisely tracking the
origin of software.  We can reasonably track contributions into the
git tree, and users can reasonably track the path from a tarball to
packages and downloads and installs.  But what happens between the git
tree and the tarball is obscure and in some cases non-reproducible.

The solution for both of these issues is to get rid of the step that
adds prebuilt files to the tarball.  The tarball now only contains
what is in the git tree (*).  Getting the additional build
dependencies is no longer a problem nowadays, and the complications to
keep these dual build modes working are significant.  And of course we
want to get the meson build system working universally.

This commit removes the make distprep target altogether.  The make
dist target continues to do its job, it just doesn't call distprep
anymore.

(*) - The tarball also contains the INSTALL file that is built at make
dist time, but not by distprep.  This is unchanged for now.

The make maintainer-clean target, whose job it is to remove the
prebuilt files in addition to what make distclean does, is now just an
alias to make distprep.  (In practice, it is probably obsolete given
that git clean is available.)

The following programs are now hard build requirements in configure
(they were already required by meson.build):

- bison
- flex
- perl

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org
2023-11-06 15:18:04 +01:00
..
activity Remove distprep 2023-11-06 15:18:04 +01:00
adt Remove distprep 2023-11-06 15:18:04 +01:00
cache Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
error Avoid calling proc_exit() in processes forked by system(). 2023-10-17 10:41:48 -05:00
fmgr Fix code indentation violations introduced by recent commit 2023-08-11 20:43:34 +09:00
hash Update copyright for 2023 2023-01-02 15:00:37 -05:00
init Set GUC "is_superuser" in all processes that set AuthenticatedUserId. 2023-11-06 06:14:13 -08:00
mb Remove distprep 2023-11-06 15:18:04 +01:00
misc Remove distprep 2023-11-06 15:18:04 +01:00
mmgr Shrink memory contexts struct sizes 2023-07-17 11:16:56 +12:00
resowner Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
sort Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
time Improve error message for snapshot import in snapmgr.c, take two 2023-09-19 10:19:50 +09:00
.gitignore Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
Gen_dummy_probes.pl Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
Gen_dummy_probes.pl.prolog Update copyright for 2023 2023-01-02 15:00:37 -05:00
Gen_dummy_probes.sed Update copyright for 2023 2023-01-02 15:00:37 -05:00
Gen_fmgrtab.pl Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
README.Gen_dummy_probes Tweak generation of Gen_dummy_probes.pl 2021-05-11 20:02:02 -04:00
errcodes.txt Remove the "snapshot too old" feature. 2023-09-05 19:53:43 +12:00
generate-errcodes.pl Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
postprocess_dtrace.sed Update copyright for 2023 2023-01-02 15:00:37 -05:00
probes.d bufmgr: Introduce infrastructure for faster relation extension 2023-04-05 16:21:09 -07:00

README.Gen_dummy_probes

# Generating dummy probes

If Postgres isn't configured with dtrace enabled, we need to generate
dummy probes for the entries in probes.d, that do nothing.

This is accomplished in Unix via the sed script `Gen_dummy_probes.sed`. We
used to use this in MSVC builds using the perl utility `psed`, which mimicked
sed. However, that utility disappeared from Windows perl distributions and so
we converted the sed script to a perl script to be used in MSVC builds.

We still keep the sed script as the authoritative source for generating
these dummy probes because except on Windows perl is not a hard requirement
when building from a tarball.

So, if you need to change the way dummy probes are generated, first change
the sed script, and when it's working generate the perl script. This can
be accomplished by using the perl utility s2p.

s2p is no longer part of the perl core, so it might not be on your system,
but it is available on CPAN and also in many package systems. e.g.
on Fedora it can be installed using `cpan App::s2p` or
`dnf install perl-App-s2p`.

The Makefile contains a recipe for regenerating Gen_dummy_probes.pl, so all
you need to do is once you have s2p installed is `make Gen_dummy_probes.pl`
Note that in a VPATH build this will generate the file in the vpath tree,
not the source tree.