public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nazir Bilal Yavuz <[email protected]>
To: Michael Paquier <[email protected]>
Cc: VASUKI M <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Daniel Gustafsson <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: BharatDB <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: BUG #19095: Test if function exit() is used fail when linked static
Date: Tue, 17 Feb 2026 15:04:45 +0300
Message-ID: <CAN55FZ22rrN6gCn7urtmTR=_5z7ArZLUJu-TsMChdXwmRTaquA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CACTYHzimf5+6gp6HzCerZpWh4o2_TW6-S3k3+2YK5mnoQa-+tg@mail.gmail.com>
	<[email protected]>
	<CACTYHzihgbTyYNQsEGcYmfkPd79r+_Jiz+PhN1xW+3NoJGEhyQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CACTYHzgb=1UXNoW08AjBBUB10dZPoAg4pptFm3K63V5xs=j=Jw@mail.gmail.com>
	<CAN55FZ03oW7zGiCgLfeiRxDQ5NLbyrppP1=mFpQ7QoDkbs84JA@mail.gmail.com>
	<[email protected]>
	<[email protected]>

Hi,

On Wed, 10 Dec 2025 at 08:14, Michael Paquier <[email protected]> wrote:
>
> On Wed, Dec 10, 2025 at 08:11:37AM +0900, Michael Paquier wrote:
> > On Tue, Dec 09, 2025 at 03:47:13PM +0300, Bilal Yavuz wrote:
> >> I agree with both of you. We do the same thing for 'ZIC' binary, so I
> >> think putting it to pgxs_empty is the correct fix.
> >
> > Thanks for double-checking.  I was not 100% sure if my analysis was
> > completely right as I was looking at this file for the first time.
>
> On top of the rest, I have double-checked the buildfarm and things
> seem fine with 4a8e6f43a6b5, so the last piece about pthread_exit() is
> now done with 8268e66ac64c.

In another thread [1], Andres pointed out that we need to create a
stamp file again although it exists. Otherwise, the stamp file will be
older than the inputs and it causes rebuilding. In Andres' own words
from [1]:

```
> +sub create_stamp_file
> +{
> +    # Avoid touching existing stamp file to prevent unnecessary rebuilds
> +    if (!(-f $stamp_file))
> +    {
> +        open my $fh, '>', $stamp_file
> +          or die "can't open $stamp_file: $!";
> +        close $fh;
> +    }
> +}

Won't that *cause* rebuilds? With a stamp file you normally want the stamp
file to be *newer* than the inputs. Which it won't be, if you don't touch it
here.

The only reason it doesn't cause quick rebuilds with meson is that ninja
remembers the timestamps of files an avoids rebuilds if they haven't changed.
```

Andres is right. We have the same problem on this libpq_check.pl,
attached fixes that.

[1] https://postgr.es/m/nxszznj6nkdj2vh5cxvwzpwodsbtui6mqluxnur2y4x7xtkirw%40fbvhy54mluzl

-- 
Regards,
Nazir Bilal Yavuz
Microsoft


Attachments:

  [text/x-patch] Fix-creating-stamp-file-in-the-libpq_check.pl.patch (1.2K, 2-Fix-creating-stamp-file-in-the-libpq_check.pl.patch)
  download | inline diff:
From a2e46d2dc10bd31d63c6a6bb44334e069b2a9605 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <[email protected]>
Date: Tue, 17 Feb 2026 14:27:43 +0300
Subject: [PATCH] Fix creating stamp file in the libpq_check.pl

We don't create stamp files if it already exists. This is wrong, stamp
file needs to be newer than the inputs. If the stamp file is older than
the inputs, it will cause rebuilding.

Reported-by: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/[email protected]
---
 src/interfaces/libpq/libpq_check.pl | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/interfaces/libpq/libpq_check.pl b/src/interfaces/libpq/libpq_check.pl
index 8a2e29b2d9a..833f5315c3c 100755
--- a/src/interfaces/libpq/libpq_check.pl
+++ b/src/interfaces/libpq/libpq_check.pl
@@ -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
-- 
2.47.3



view thread (7+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: BUG #19095: Test if function exit() is used fail when linked static
  In-Reply-To: <CAN55FZ22rrN6gCn7urtmTR=_5z7ArZLUJu-TsMChdXwmRTaquA@mail.gmail.com>

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

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