Re: Patch for Makefile race against current cvs

From: Klaus Naumann <knaumann(at)gmx-ag(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch for Makefile race against current cvs
Date: 2001-11-09 20:04:58
Message-ID: Pine.LNX.4.40.0111092058260.11086-100000@kn.technik.gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Fri, 9 Nov 2001, Tom Lane wrote:

> Klaus Naumann <knaumann(at)gmx-ag(dot)de> writes:
> > Also even if it would be make's fault I don't see what my patch makes
> > worse. But if you don't want to apply it, you don't apply it.
>
> Well, as to whether it gets applied or not, I'll defer to Peter
> Eisentraut who has done most of the work recently on our configure and
> make support. The reason I'm asking all these questions is that I
> want to understand what the problem really is. It seems to me that if
> we have a problem with these bison invocations then we are likely to
> have similar problems elsewhere. We need to understand why it's
> unsafe and what the general rule is for avoiding such mistakes in
> future.

To me it looks like make is calling the target twice as there are
two dependent files.
I think this is due to a dependency of a dependency.
Lemme explain: What I think is, that we enter a directory and make
a parallel build. We want to compile prepare.c , so make calls the
rule to build prepare.c . A second make (because it's parallel)
sees a file which needs prepare.h, so it calls the rule.
At that point the rule is called twice. If it's now doing things
which are not supposed to work in parallel (like moving away
a file) the build fails.
Maybe this is completely wrong - but this is what it looks
like to me ...

> What bothers me is that you seem to be saying that *any* construct
> involving multiple outputs from one rule is unsafe in a parallel make.

I didn't say that - I just was refering to this special case.
It happened to me - more then one time. Even about 20 times
(while creating the patch ...)

> That strikes me as a huge restriction, and one that would surely be
> mentioned prominently in the gmake manual if it were real. But I can't
> find anything that says that.

I agree, and I don't think it's a problem which happens always.

> I think what you are looking at here is a gmake bug, and that you should
> report it to the gmake people.

Meybe we should ask them - but somehow I have the impression that
it's not a gmake problem ...

CU, Klaus

--
Klaus Naumann
Systems Administration
GMX Aktiengesellschaft
Riesstrasse 17, 80992 München
Telefon +49.89.143 39-0
Telefax +49.89.143 39-100
mailto:knaumann(at)gmx-ag(dot)de
http://www.gmx.net/

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-11-09 20:20:30 Re: Patch for Makefile race against current cvs
Previous Message Klaus Naumann 2001-11-09 19:58:22 Re: Patch for Makefile race against current cvs