Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkT0n-0000Vb-4G for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jul 2018 11:40:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fkT0j-0003bU-Cg for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jul 2018 11:40:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkT0j-0003bE-2Z for pgsql-hackers@lists.postgresql.org; Tue, 31 Jul 2018 11:40:17 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fkT0b-0003E5-G3 for pgsql-hackers@postgresql.org; Tue, 31 Jul 2018 11:40:16 +0000 Received: by mail-lj1-x242.google.com with SMTP id s12-v6so13421388ljj.0 for ; Tue, 31 Jul 2018 04:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=TBQGQxUKdfmaOuI3S/VUBdEtIodLykraa/dEzcflw8k=; b=NIsn/cjleE52Abc8EXcKBaWPHkNQ6AO7bQUD08rrHxKJxo8Ux7UJE39xXMSRmhAEYQ 7SzQwonjh1RNWjIceV655T+XUOWSUvUuUeEw6afLNFcm8NH5Zwwjn2ioKGXuRfWu5Jbi W1IiT00MRNNfV4y60Lexkwmw89f0/kS4vhbTP3Tn+A1wBBEOcjfzjDdlqES9jkePzTtS kYHHDgjX3L9sBxRYHVS1IeYHht2XqEuAgeg6KxVMlkTBTMq7HZMPRRcl+1rcMNo0D7RW 5d7HFWv4/ou0S+ZTofIFaQzbJ5z78+wOvK7iT202uYhuAMbYFwtf9+DocRGBuR61RFDe sHnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=TBQGQxUKdfmaOuI3S/VUBdEtIodLykraa/dEzcflw8k=; b=mTiRkd9uAez9g6zPRonWLe1GNuhsxwvPyeiTvuYuxJB22JihD0bcPAWLk0kRpps1Sz +BcNTxIAbKkwtqpPXfShnWwx7jizIdusHOtifz0ucwE/LrNNI6LwYfeicMe/mBhxVYqd xkuX7gNModBZQURqHZ918Kqb1kGfV+dtcn47bcQAmbWV9HI9xFlPh9F5TSGPuJXfKlPY +aE6/J2VRLhPXdPxDlYSGiCqPXcKTKaWlXWoWowj0nEm+SLsJQOtNAmtXtXtsvW2rALq ncyX4/zUeqek67ud/nn0T2iQAClTwFU+UC9B0UKRTd9F5L4ZyMsTje467XdazuejnDkD ZeGA== X-Gm-Message-State: AOUpUlF+E3rghfOMXDv4l19j06I6AbxGyAErzgp3SV8Pj92pWcbZycu0 BqATkzMdWO6uWIh6xJ7fBOotdz7j/1E= X-Google-Smtp-Source: AAOMgpeUHoRiFHTm6XcwoQ4tQ36DuQfuzPACv5VH02b61s+a7FQDIYmYHvsq8PIrCTl2fOLWLVo5SQ== X-Received: by 2002:a2e:7014:: with SMTP id l20-v6mr16762265ljc.141.1533037207555; Tue, 31 Jul 2018 04:40:07 -0700 (PDT) Received: from [1.0.0.7] ([178.155.4.44]) by smtp.gmail.com with ESMTPSA id e5-v6sm1904029lfc.68.2018.07.31.04.40.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jul 2018 04:40:06 -0700 (PDT) Subject: Re: make installcheck-world in a clean environment To: Tom Lane Cc: Peter Eisentraut , Robert Haas , "pgsql-hackers@postgresql.org" References: <24834.1525712835@sss.pgh.pa.us> <0401efec-68f1-679d-3ea3-21d4e8dd11af@gmail.com> <15981.1532988967@sss.pgh.pa.us> <26960.1532994120@sss.pgh.pa.us> From: Alexander Lakhin Message-ID: <8d6aebaa-d119-b702-f8a3-e0261e4cb586@gmail.com> Date: Tue, 31 Jul 2018 14:40:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <26960.1532994120@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="------------02BBDD6D2F12D8805CEB1633" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------02BBDD6D2F12D8805CEB1633 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 31.07.2018 02:42, Tom Lane wrote: > I wrote: >> The original complaint about ecpg remains; I'm not terribly excited >> about messing with that. > Well, I got curious as to why we were seeing such a weird error, > and eventually traced it to this stuff in ecpg/test/Makefile.regress: > > # Standard way to invoke the ecpg preprocessor > ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include -I$(srcdir) > > # Files that most or all ecpg preprocessor test outputs depend on > ECPG_TEST_DEPENDENCIES = ../../preproc/ecpg$(X) \ > $(srcdir)/../regression.h \ > $(srcdir)/../../include/sqlca.h \ > $(srcdir)/../../include/sqlda.h \ > $(srcdir)/../../include/sqltypes.h \ > $(srcdir)/../../include/sql3types.h > > %.c: %.pgc $(ECPG_TEST_DEPENDENCIES) > $(ECPG) -o $@ $< > > Now, the fine gmake manual quoth: > > `%' in a prerequisite of a pattern rule stands for the same stem > that was matched by the `%' in the target. In order for the pattern > rule to apply, its target pattern must match the file name under > consideration and all of its prerequisites (after pattern substitution) > must name files that exist or can be made. > > So the problem is that (after make clean) ../../preproc/ecpg doesn't > exist, and the Makefiles under test/ have no idea how to build it, > and thus this pattern rule is inapplicable. Thus you end up getting > "No rule to make target" errors. Yes, it's exactly the problem I was trying to fix. > While it seems straightforward to fix this for "make check" scenarios --- > just go make ecpg before trying to make the tests --- I think these rules > are very surprising for "make installcheck" cases. You'd expect "make > installcheck" to test the installed ecpg, as indeed Alexander pointed out > at the start of the thread. But it's not doing that. > > Alexander's USE_INSTALLED_ASSETS patch attempted to fix that, and I now > see the point of it, but it still seems pretty hacky and invasive (why > should an ecpg-only problem be touching stuff outside ecpg)? Also, > unless I'm still missing something, it doesn't fix the problem with > "make clean check": ecpg won't have been built before we try to build the > test programs. In fact, after fixing ECPG usage with installcheck, I found that "make installcheck" then rebuilds libpostgres, libpgport and libpq (for installcheck-world). (I mentioned it in this thread before.) Later I proposed a more comprehensive patch that allows us to make installcheck cleanly (without building something). So the problem is not ecpg-only, the ecpg's failure to build is prominent part of it, but there are another assets getting built under the hood. > I'd suggest trying to simplify the USE_INSTALLED_ASSETS patch so it > doesn't muck with the rules for building pg_regress. I don't find > that to be very relevant to the problem. I can simplify the patch to fix only the ECPG failure, and then prepare a distinct patch for libs, if it makes sense. Best regards, ------ Alexander Lakhin Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --------------02BBDD6D2F12D8805CEB1633 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
31.07.2018 02:42, Tom Lane wrote:
I wrote:
The original complaint about ecpg remains; I'm not terribly excited
about messing with that.
Well, I got curious as to why we were seeing such a weird error,
and eventually traced it to this stuff in ecpg/test/Makefile.regress:

# Standard way to invoke the ecpg preprocessor
ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include -I$(srcdir)

# Files that most or all ecpg preprocessor test outputs depend on
ECPG_TEST_DEPENDENCIES = ../../preproc/ecpg$(X) \
	$(srcdir)/../regression.h \
	$(srcdir)/../../include/sqlca.h \
	$(srcdir)/../../include/sqlda.h \
	$(srcdir)/../../include/sqltypes.h \
	$(srcdir)/../../include/sql3types.h

%.c: %.pgc $(ECPG_TEST_DEPENDENCIES)
	$(ECPG) -o $@ $<

Now, the fine gmake manual quoth:

    `%' in a prerequisite of a pattern rule stands for the same stem
    that was matched by the `%' in the target.  In order for the pattern
    rule to apply, its target pattern must match the file name under
    consideration and all of its prerequisites (after pattern substitution)
    must name files that exist or can be made.

So the problem is that (after make clean) ../../preproc/ecpg doesn't
exist, and the Makefiles under test/ have no idea how to build it,
and thus this pattern rule is inapplicable.  Thus you end up getting
"No rule to make target" errors.
Yes, it's exactly the problem I was trying to fix.
While it seems straightforward to fix this for "make check" scenarios ---
just go make ecpg before trying to make the tests --- I think these rules
are very surprising for "make installcheck" cases.  You'd expect "make
installcheck" to test the installed ecpg, as indeed Alexander pointed out
at the start of the thread.  But it's not doing that.

Alexander's USE_INSTALLED_ASSETS patch attempted to fix that, and I now
see the point of it, but it still seems pretty hacky and invasive (why
should an ecpg-only problem be touching stuff outside ecpg)?  Also,
unless I'm still missing something, it doesn't fix the problem with
"make clean check": ecpg won't have been built before we try to build the
test programs.
In fact, after fixing ECPG usage with installcheck, I found that "make installcheck" then rebuilds libpostgres, libpgport and libpq (for installcheck-world). (I mentioned it in this thread before.) Later I proposed a more comprehensive patch that allows us to make installcheck cleanly (without building something).
So the problem is not ecpg-only, the ecpg's failure to build is prominent part of it, but there are another assets getting built under the hood.
I'd suggest trying to simplify the USE_INSTALLED_ASSETS patch so it
doesn't muck with the rules for building pg_regress.  I don't find
that to be very relevant to the problem.
I can simplify the patch to fix only the ECPG failure, and then prepare a distinct patch for libs, if it makes sense.


Best regards,
------

Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

--------------02BBDD6D2F12D8805CEB1633--