Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lz1Cu-000180-UU for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jul 2021 18:14:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lz1Ct-0000QH-Mk for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jul 2021 18:14:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lz1Ct-0000Q8-Er for pgsql-hackers@lists.postgresql.org; Thu, 01 Jul 2021 18:14:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lz1Cn-0001wf-2f for pgsql-hackers@postgresql.org; Thu, 01 Jul 2021 18:14:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 161IEOOg745047; Thu, 1 Jul 2021 14:14:24 -0400 From: Tom Lane To: Peter Eisentraut cc: Jacob Champion , "daniel@yesql.se" , "pgsql-hackers@postgresql.org" , "michael@paquier.xyz" Subject: Re: Preventing abort() and exit() calls in libpq In-reply-to: <9d35a4ac-2c75-cb44-95ab-61d69deb072e@enterprisedb.com> References: <3128896.1624742969@sss.pgh.pa.us> <18eda75d-af6d-3fc0-03b6-607eff9f392a@enterprisedb.com> <622907.1625084114@sss.pgh.pa.us> <630837.1625092151@sss.pgh.pa.us> <67ddcb26f82acaffb26c59b7d8e4cd75399b2cd3.camel@vmware.com> <9d35a4ac-2c75-cb44-95ab-61d69deb072e@enterprisedb.com> Comments: In-reply-to Peter Eisentraut message dated "Thu, 01 Jul 2021 20:05:59 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <745045.1625163264.1@sss.pgh.pa.us> Date: Thu, 01 Jul 2021 14:14:24 -0400 Message-ID: <745046.1625163264@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > On 01.07.21 00:41, Jacob Champion wrote: >> Spitballing -- if you don't like the stamp file, you could add the >> check to the end of the $(shlib) rule, surrounded by an ifeq check. >> Then .DELETE_ON_ERROR should take care of the rest, I think. > Somewhere in the $(shlib) rule would seem most appropriate. But I don't > understand the rest: What ifeq, and why .DELETE_ON_ERROR? The variant of this I'd been thinking of was $(shlib): $(OBJS) | $(SHLIB_PREREQS) $(LINK.shared) -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) +ifneq (,$(SHLIB_EXTRA_ACTION)) + $(SHLIB_EXTRA_ACTION) +endif (and similarly in several other places); then libpq's Makefile could set SHLIB_EXTRA_ACTION to the desired thing. The problem then is, what happens when the extra action fails? Without .DELETE_ON_ERROR, the shlib is still there and the next make run will think everything's good. regards, tom lane