pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: headerscheck ccache support
Date: Thu, 04 Dec 2025 10:34:53 +0000
Message-ID: <E1vR6fk-002kDq-1l@gemulon.postgresql.org> (raw)

headerscheck ccache support

Currently, headerscheck and cpluspluscheck are very slow, and they
defeat use of ccache.  This fixes that, and now they are much faster.

The problem was that the test files are created in a randomly-named
directory (`mktemp -d /tmp/$me.XXXXXX`), and this directory is
mentioned on the compiler command line, which is part of the cache
key.

The solution is to create the test files in the build directory.  For
example, for src/include/storage/ipc.h, we generate

    tmp_headerscheck_c/src_include_storage_ipc_h.c (or .cpp)

Now ccache works.  (And it's also a bit easier to debug everything
with this naming.)

(The subdirectory is used to keep the cleanup trap simple.)

The observed speedup on Cirrus CI for headerscheck plus cpluspluscheck
is from about 1min 20s to only 20s.  In local use, the speedups are
similar.

Co-authored-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/b49e74d4-3cf9-4d1c-9dce-09f75e55d026%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/40bdd839f52a3e18a0e003f556cab3512510f633

Modified Files
--------------
.cirrus.tasks.yml                |  5 ++---
src/tools/pginclude/headerscheck | 15 +++++++++++----
2 files changed, 13 insertions(+), 7 deletions(-)



Message-ID: <E1vR6fk-002kDq-1l@gemulon.postgresql.org>
Permalink:  ../E1vR6fk-002kDq-1l@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vR6fk-002kDq-1l@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: headerscheck ccache support
  In-Reply-To: <E1vR6fk-002kDq-1l@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox