From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-bugs@postgresql.org
Cc: Dylan Alex Simon <dylan@dylex.net>
Subject: Re: BUG #5665: catalog/schemapg.h: No such file or directory
Date: Sun, 30 Jan 2011 13:27:11 -0500
Message-ID: <2695.1296412031@sss.pgh.pa.us> (raw)
In-Reply-To: <2146.1296409499@sss.pgh.pa.us>
References: <20110129114655.GA10393@datura.dylex.net>
<2146.1296409499@sss.pgh.pa.us>
I wrote:
> Dylan Alex Simon <dylan@dylex.net> writes:
>> I'm seeing this problem too, so I might be able to shed some light on it.
> Hm. I can't replicate this at all.
> ...
>> GNU Make 3.82
> Mine is 3.81 (Fedora 13). Is it possible this is a bug introduced in
> 3.82? The symlink is made this way:
> $(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h
> prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
> cd $(dir $@) && rm -f $(notdir $@) && \
> $(LN_S) "$$prereqdir/$(notdir $<)" .
Ah-hah: when I try it on Fedora 14 (with make 3.82), it fails just as
Dylan describes. Doing it manually in builddir/src/backend shows that
"dir $<" is indeed the culprit:
$ rm ../../src/include/catalog/schemapg.h
$ make ../../src/include/catalog/schemapg.h
make -C catalog schemapg.h
make[1]: Entering directory `/home/tgl/tmp/postgresql-9.0.2/obj-x86_64/src/backend/catalog'
make[1]: `/home/tgl/tmp/postgresql-9.0.2/src/src/backend/catalog/schemapg.h' is up to date.
make[1]: Leaving directory `/home/tgl/tmp/postgresql-9.0.2/obj-x86_64/src/backend/catalog'
prereqdir=`cd catalog/ >/dev/null && pwd` && \
cd ../../src/include/catalog/ && rm -f schemapg.h && \
ln -s "$prereqdir/schemapg.h" .
$ ls -l ../../src/include/catalog/schemapg.h
lrwxrwxrwx. 1 tgl tgl 72 Jan 30 13:03 ../../src/include/catalog/schemapg.h -> /home/tgl/tmp/postgresql-9.0.2/obj-x86_64/src/backend/catalog/schemapg.h
Now, this make rule looks exactly like the one for parser/gram.h, and
that's not misbehaving. The problem appears to be caused by the
other rule for schemapg.h:
# run this unconditionally to avoid needing to know its dependencies here:
submake-schemapg:
$(MAKE) -C catalog schemapg.h
.PHONY: submake-schemapg
catalog/schemapg.h: submake-schemapg
If I comment this out entirely, or change it to a simple rule
catalog/schemapg.h:
$(MAKE) -C catalog schemapg.h
then the symlink is built correctly. Apparently, the use of a phony
dependency causes make to decide that "catalog/schemapg.h" must refer to
a file in the build tree not the source tree.
I'm not sure whether the gmake boys will think this is a bug. It's
certainly a behavior change from pre-3.82 releases. In any case,
I think the rule for catalog/schemapg.h is a bit too cute (and even more
so in HEAD ... WTF is that "|" in there now?). We need to be less
bleeding edge here.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, dylan@dylex.net
Subject: Re: BUG #5665: catalog/schemapg.h: No such file or directory
In-Reply-To: <2695.1296412031@sss.pgh.pa.us>
References: <20110129114655.GA10393@datura.dylex.net> <2146.1296409499@sss.pgh.pa.us> <2695.1296412031@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox