Re: [RFC] building postgres with meson - v12

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, samay sharma <smilingsamay(at)gmail(dot)com>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Subject: Re: [RFC] building postgres with meson - v12
Date: 2022-09-07 07:19:51
Message-ID: a56cebc5-47cd-45e7-d08b-a6c21778f42c@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 31.08.22 20:11, Andres Freund wrote:
>> doc/src/sgml/resolv.xsl: I don't understand what this is doing. Maybe
>> at least add a comment in the file.
> It's only used for building epubs. Perhaps I should extract that into a
> separate patch as well? The relevant section is:
>
>> #
>> # epub
>> #
>>
>> # This was previously implemented using dbtoepub - but that doesn't seem to
>> # support running in build != source directory (i.e. VPATH builds already
>> # weren't supported).
>> if pandoc.found() and xsltproc.found()
>> # XXX: Wasn't able to make pandoc successfully resolve entities
>> # XXX: Perhaps we should just make all targets use this, to avoid repeatedly
>> # building whole thing? It's comparatively fast though.
>> postgres_full_xml = custom_target('postgres-full.xml',
>> input: ['resolv.xsl', 'postgres.sgml'],
>> output: ['postgres-full.xml'],
>> depends: doc_generated + [postgres_sgml_valid],
>> command: [xsltproc, '--path', '@OUTDIR@/', xsltproc_flags,
>> '-o', '@OUTPUT@', '@INPUT@'],
>> build_by_default: false,
>> )
> A noted, I couldn't make pandoc resolve our entities, so I used resolv.xsl
> them, before calling pandoc.
>
> I'll rename it to resolve-entities.xsl and add a comment.

We can have xmllint do this. The following gets the epub build working
with vpath:

diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile
index 4ae7ca2be7..33b72d03db 100644
--- a/doc/src/sgml/Makefile
+++ b/doc/src/sgml/Makefile
@@ -184,8 +184,12 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path
'$(srcdir)/'

epub: postgres.epub
postgres.epub: postgres.sgml $(ALLSGML) $(ALL_IMAGES)
- $(XMLLINT) --noout --valid $<
- $(DBTOEPUB) -o $@ $<
+ $(XMLLINT) $(XMLINCLUDE) --output tmp.sgml --noent --valid $<
+ifeq ($(vpath_build),yes)
+ $(MKDIR_P) images
+ cp $(ALL_IMAGES) images/
+endif
+ $(DBTOEPUB) -o $@ tmp.sgml

This could also be combined with the idea of the postgres.sgml.valid
thing you have in the meson patch set.

I'll finish this up and produce a proper patch.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shiy.fnst@fujitsu.com 2022-09-07 07:39:23 RE: Handle infinite recursion in logical replication setup
Previous Message Yura Sokolov 2022-09-07 07:15:24 Re: Reducing the chunk header sizes on all memory context types