From 721856ff24b3722ce8e894e5a32c9c063cd48455 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 6 Nov 2023 14:51:52 +0100 Subject: 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 Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org --- doc/src/Makefile | 2 +- doc/src/sgml/Makefile | 16 +++----- doc/src/sgml/installation.sgml | 83 ++++++++++++++++++------------------------ doc/src/sgml/sourcerepo.sgml | 10 ----- 4 files changed, 42 insertions(+), 69 deletions(-) (limited to 'doc/src') diff --git a/doc/src/Makefile b/doc/src/Makefile index 30d883815aa..2ed02084ff5 100644 --- a/doc/src/Makefile +++ b/doc/src/Makefile @@ -4,5 +4,5 @@ subdir = doc/src top_builddir = ../.. include $(top_builddir)/src/Makefile.global -all distprep html man install installdirs uninstall clean distclean maintainer-clean: +all html man install installdirs uninstall clean distclean: $(MAKE) -C sgml $@ diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 1e55e531dbf..49d35dd0d6e 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -7,8 +7,7 @@ #---------------------------------------------------------------------------- # This makefile is for building and installing the documentation. -# When a release tarball is created, the documentation files are -# prepared using the distprep target. In Git-based trees these files +# In Git-based trees these files # don't exist, unless explicitly built, so we skip the installation in # that case. @@ -28,8 +27,6 @@ include $(top_builddir)/src/Makefile.global all: html man -distprep: html distprep-man - ifndef DBTOEPUB DBTOEPUB = $(missing) dbtoepub @@ -77,7 +74,7 @@ postgres-full.xml: postgres.sgml $(ALLSGML) ## Man pages ## -man distprep-man: man-stamp +man: man-stamp man-stamp: stylesheet-man.xsl postgres-full.xml $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^ @@ -89,10 +86,9 @@ man-stamp: stylesheet-man.xsl postgres-full.xml ## # Technically, this should depend on Makefile.global, but then -# version.sgml would need to be rebuilt after every configure run, -# even in distribution tarballs. So this is cheating a bit, but it -# will achieve the goal of updating the version number when it -# changes. +# version.sgml would need to be rebuilt after every configure run. So +# this is cheating a bit, but it will achieve the goal of updating the +# version number when it changes. version.sgml: $(top_srcdir)/configure { \ echo ""; \ @@ -305,8 +301,6 @@ clean: rm -f *.texixml *.texi *.info db2texi.refs distclean: clean - -maintainer-clean: distclean # HTML rm -fr html/ html-stamp # man diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 9b25e9fdb1b..a3dc6eb855f 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -72,8 +72,7 @@ documentation. See standalone-profile.xsl for details. Alternatively, PostgreSQL can be built using Meson. This is currently - experimental and only works when building from a Git checkout (not from - a distribution tarball). If you choose to use + experimental. If you choose to use Meson, then you don't need GNU make, but the other requirements below still apply. @@ -102,6 +101,41 @@ documentation. See standalone-profile.xsl for details. + + + + flex + + + lex + + + bison + + + yacc + + + Flex 2.5.35 or later and + Bison 2.3 or later are required. Other + lex and yacc + programs cannot be used. + + + + + + + perl + + + Perl 5.14 or later is needed during the build + process and to run some test suites. (This requirement is separate from + the requirements for building PL/Perl; see + below.) + + + @@ -315,51 +349,6 @@ documentation. See standalone-profile.xsl for details. - - If you are building from a Git tree instead of - using a released source package, or if you want to do server development, - you also need the following packages: - - - - - - flex - - - lex - - - bison - - - yacc - - - Flex and Bison - are needed to build from a Git checkout, or if you changed the actual - scanner and parser definition files. If you need them, be sure - to get Flex 2.5.35 or later and - Bison 2.3 or later. Other lex - and yacc programs cannot be used. - - - - - - perl - - - Perl 5.14 or later is needed to build from a Git checkout, - or if you changed the input files for any of the build steps that - use Perl scripts. If building on Windows you will need - Perl in any case. Perl is - also required to run some test suites. - - - - - If you need to get a GNU package, you can find it at your local GNU mirror site (see - - Note that building PostgreSQL from the source - repository requires reasonably up-to-date versions of bison, - flex, and Perl. - These tools are not needed to build from a distribution tarball, because - the files generated with these tools are included in the tarball. - Other tool requirements - are the same as shown in . - - Getting the Source via <productname>Git</productname> -- cgit v1.2.3