pgsql: Avoid overwriting unchanged output files in genbki.pl and Gen_fm

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid overwriting unchanged output files in genbki.pl and Gen_fm
Date: 2018-05-03 22:06:51
Message-ID: E1fEMNH-0000q0-9h@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid overwriting unchanged output files in genbki.pl and Gen_fmgrtab.pl.

If a particular output file already exists with the contents it should
have, leave it alone, so that its mod timestamp is not advanced.

In builds using --enable-depend, this can avoid the need to recompile .c
files whose included files didn't actually change. It's not clear whether
it saves much of anything for users of ccache; but the cost of doing the
file comparisons seems to be negligible, so we might as well do it.

For developers using the MSVC toolchain, this will create a regression:
msvc/Solution.pm will sometimes run genbki.pl or Gen_fmgrtab.pl
unnecessarily. I'll look into fixing that separately.

Discussion: https://postgr.es/m/16925.1525376229@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1f1cd9b5ddc6e7464c1c7416bcce7007fe3bc88c

Modified Files
--------------
src/backend/catalog/Catalog.pm | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-05-03 22:47:47 pgsql: Blindly try to fix MSVC build's use of genbki.pl and Gen_fmgrtab
Previous Message Peter Eisentraut 2018-05-03 17:13:20 pgsql: Tweak tests to support Python 3.7