Re: Is there an undocumented Syntax Check in Meson?

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Is there an undocumented Syntax Check in Meson?
Date: 2024-05-09 19:53:27
Message-ID: 87h6f6hidk.fsf@wibble.ilmari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:

> Hi,
>
> On 2024-05-09 20:12:38 +0100, Dagfinn Ilmari Mannsåker wrote:
>> Attached is a patch which adds a check-docs target for meson, which
>> takes 0.3s on my laptop.
>
> Nice.
>
>
>> +checkdocs = custom_target('check-docs',
>> + input: 'postgres.sgml',
>> + output: 'check-docs',
>> + depfile: 'postgres-full.xml.d',
>> + command: [xmllint, '--nonet', '--valid', '--noout',
>> + '--path', '@OUTDIR@', '@INPUT@'],
>> + depends: doc_generated,
>> + build_by_default: false,
>> +)
>> +alias_target('check-docs', checkdocs)
>
> Isn't the custom target redundant with postgres_full_xml? I.e. you could just
> have the alias_target depend on postgres_full_xml?

We could, but that would actually rebuild postgres-full.xml, not just
check the syntax (but that only takes 0.1-0.2s longer), and only run if
the docs have been modified since it was last built (which I guess is
fine, since if you haven't modified the docs you can't have introduced
any syntax errors).

It's already possible to run that target directly, i.e.

ninja doc/src/sgml/postgres-full.xml

We could just document that in the list of meson doc targets, but a
shortcut alias would roll off the fingers more easily and be more
discoverable.

> Greetings,
>
> Andres Freund

- ilmari

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-05-09 19:58:37 Re: add --no-sync to pg_upgrade's calls to pg_dump and pg_dumpall
Previous Message David G. Johnston 2024-05-09 19:52:45 Re: Is there an undocumented Syntax Check in Meson?