Re: Something fishy about the current Makefiles

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Something fishy about the current Makefiles
Date: 2011-01-06 16:57:11
Message-ID: 14879.1294333031@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Whilst fooling around with GIN, I have repeatedly observed that doing
"make" in src/backend/access/gin, followed by "make install-bin" in
src/backend, fails to rebuild the postgres executable --- it just
installs the existing one. A second execution of "make install-bin"
does notice that postgres is out of date and rebuilds it. This
procedure for rebuilding after changing one or two .c files has always
worked for me before. I can't avoid the suspicion that the recent
changes to make things more parallel-friendly broke something.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Something fishy about the current Makefiles
Date: 2011-01-06 17:27:10
Message-ID: AANLkTinBh6Coq5P1y+SjMnYck6KLyNWchwuzQk2aGzHy@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jan 6, 2011 at 11:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Whilst fooling around with GIN, I have repeatedly observed that doing
> "make" in src/backend/access/gin, followed by "make install-bin" in
> src/backend, fails to rebuild the postgres executable --- it just
> installs the existing one.  A second execution of "make install-bin"
> does notice that postgres is out of date and rebuilds it.  This
> procedure for rebuilding after changing one or two .c files has always
> worked for me before.  I can't avoid the suspicion that the recent
> changes to make things more parallel-friendly broke something.

I've noticed something like this as well, but haven't been able to
figure out exactly what is going wrong.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Something fishy about the current Makefiles
Date: 2011-01-06 18:53:48
Message-ID: 20248.1294340028@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Jan 6, 2011 at 11:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Whilst fooling around with GIN, I have repeatedly observed that doing
>> "make" in src/backend/access/gin, followed by "make install-bin" in
>> src/backend, fails to rebuild the postgres executable --- it just
>> installs the existing one. A second execution of "make install-bin"
>> does notice that postgres is out of date and rebuilds it. This
>> procedure for rebuilding after changing one or two .c files has always
>> worked for me before. I can't avoid the suspicion that the recent
>> changes to make things more parallel-friendly broke something.

> I've noticed something like this as well, but haven't been able to
> figure out exactly what is going wrong.

I'm not entirely sure either, but it looks like the first upper "make"
updates the objfiles.txt file in src/backend/access and then the second
one realizes it has to rebuild postgres. Something about multi-level
dependencies isn't quite right.

regards, tom lane


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Something fishy about the current Makefiles
Date: 2011-01-07 00:54:15
Message-ID: 1294361655.19612.16392.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 2011-01-06 at 13:53 -0500, Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Thu, Jan 6, 2011 at 11:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Whilst fooling around with GIN, I have repeatedly observed that doing
> >> "make" in src/backend/access/gin, followed by "make install-bin" in
> >> src/backend, fails to rebuild the postgres executable --- it just
> >> installs the existing one. A second execution of "make install-bin"
> >> does notice that postgres is out of date and rebuilds it. This
> >> procedure for rebuilding after changing one or two .c files has always
> >> worked for me before. I can't avoid the suspicion that the recent
> >> changes to make things more parallel-friendly broke something.
>
> > I've noticed something like this as well, but haven't been able to
> > figure out exactly what is going wrong.
>
> I'm not entirely sure either, but it looks like the first upper "make"
> updates the objfiles.txt file in src/backend/access and then the second
> one realizes it has to rebuild postgres. Something about multi-level
> dependencies isn't quite right.

I had a weirdness with the dependency files a few days ago. The error
was a missing delimiter : at the end of one of the files. Stopped
everything cold until I added that character, then re-configured and not
a hint of the earlier problem.

Sounds like dependency is a common issue.

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Something fishy about the current Makefiles
Date: 2011-01-11 22:10:59
Message-ID: 1294783859.17361.5.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On tor, 2011-01-06 at 11:57 -0500, Tom Lane wrote:
> Whilst fooling around with GIN, I have repeatedly observed that doing
> "make" in src/backend/access/gin, followed by "make install-bin" in
> src/backend, fails to rebuild the postgres executable --- it just
> installs the existing one. A second execution of "make install-bin"
> does notice that postgres is out of date and rebuilds it. This
> procedure for rebuilding after changing one or two .c files has always
> worked for me before. I can't avoid the suspicion that the recent
> changes to make things more parallel-friendly broke something.

This fixes it, but it's beyond me why.

diff --git i/src/backend/common.mk w/src/backend/common.mk
index 4e0a5da..5d599db 100644
--- i/src/backend/common.mk
+++ w/src/backend/common.mk
@@ -34,7 +34,7 @@ objfiles.txt: Makefile $(SUBDIROBJS) $(OBJS)
expand_subsys = $(foreach file,$(1),$(if $(filter %/objfiles.txt,$(file)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file)))),$(file)))

# Parallel make trickery
-$(SUBDIROBJS): | $(SUBDIRS:%=%-recursive) ;
+$(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;

.PHONY: $(SUBDIRS:%=%-recursive)
$(SUBDIRS:%=%-recursive):


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Something fishy about the current Makefiles
Date: 2011-01-12 00:04:47
Message-ID: 11437.1294790687@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On tor, 2011-01-06 at 11:57 -0500, Tom Lane wrote:
>> Whilst fooling around with GIN, I have repeatedly observed that doing
>> "make" in src/backend/access/gin, followed by "make install-bin" in
>> src/backend, fails to rebuild the postgres executable --- it just
>> installs the existing one. A second execution of "make install-bin"
>> does notice that postgres is out of date and rebuilds it. This
>> procedure for rebuilding after changing one or two .c files has always
>> worked for me before. I can't avoid the suspicion that the recent
>> changes to make things more parallel-friendly broke something.

> This fixes it, but it's beyond me why.

Further experimentation suggests that *only* subdirectories of access/
are vulnerable to the issue. I wonder whether this syntax:

> -$(SUBDIROBJS): | $(SUBDIRS:%=%-recursive) ;

is weird with respect to the first SUBDIRS value. Or maybe it's a plain
old bug in gmake.

regards, tom lane


From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Something fishy about the current Makefiles
Date: 2011-01-12 00:18:59
Message-ID: 1294791539.15758.3.camel@jdavis-ux.asterdata.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 2011-01-06 at 12:27 -0500, Robert Haas wrote:
> I've noticed something like this as well, but haven't been able to
> figure out exactly what is going wrong.

I've been having build problems ever since:

http://archives.postgresql.org/message-id/1291256879.25389.6.camel@jdavis-ux.asterdata.local

It's gotten much worse recently, where changing a c file seems to
require multiple top-level "make install" commands to take effect (as
Tom describes). I don't think it's limited to the access/ subdirectory,
though.

Regards,
Jeff Davis


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Something fishy about the current Makefiles
Date: 2011-01-12 19:32:33
Message-ID: 1294860592-sup-8432@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from Tom Lane's message of jue ene 06 13:57:11 -0300 2011:
> Whilst fooling around with GIN, I have repeatedly observed that doing
> "make" in src/backend/access/gin, followed by "make install-bin" in
> src/backend, fails to rebuild the postgres executable --- it just
> installs the existing one. A second execution of "make install-bin"
> does notice that postgres is out of date and rebuilds it. This
> procedure for rebuilding after changing one or two .c files has always
> worked for me before. I can't avoid the suspicion that the recent
> changes to make things more parallel-friendly broke something.

FWIW this explains why I was having such a hard time testing the FOR KEY
LOCK patch. Please commit whatever fix you have.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support