]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Force creation of stamp file after libpq library check in meson builds
authorMichael Paquier <michael@paquier.xyz>
Wed, 18 Feb 2026 07:07:13 +0000 (16:07 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 18 Feb 2026 07:07:13 +0000 (16:07 +0900)
Previously, if --stamp_file was specified, libpq_check.pl would create a
new stamp file only if none could be found.  If there was already a
stamp file, the script would do nothing, leaving the previous stamp file
in place.  This logic could cause unnecessary rebuilds because meson
relies on the timestamp of the output files to determine if a rebuild
should happen.  In this case, a stamp file generated during an older
check would be kept, but we need a stamp file from the latest moment
where the libpq check has been run, so as correct rebuild decisions can
be taken.

This commit changes libpq_check.pl so as a fresh stamp file is created
each time libpq_check.pl is run, when --stamp_file is specified.

Oversight in commit 4a8e6f43a6b5.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reviewed-by: VASUKI M <vasukim1992002@gmail.com>
Discussion: https://postgr.es/m/CAN55FZ22rrN6gCn7urtmTR=_5z7ArZLUJu-TsMChdXwmRTaquA@mail.gmail.com

src/interfaces/libpq/libpq_check.pl

index 8a2e29b2d9a773761fa1d02856e302ce25106d1b..833f5315c3c45b7ad67ac496c8b21a996044773a 100755 (executable)
@@ -31,12 +31,9 @@ die "$0: --nm must be specified\n" unless defined $nm_path and -x $nm_path;
 
 sub create_stamp_file
 {
-       if (!(-f $stamp_file))
-       {
-               open my $fh, '>', $stamp_file
-                 or die "can't open $stamp_file: $!";
-               close $fh;
-       }
+       open my $fh, '>', $stamp_file
+         or die "can't open $stamp_file: $!";
+       close $fh;
 }
 
 # Skip on Windows and Solaris