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:30:33
Message-ID: Pine.LNX.4.40.0111092124420.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:
> > 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.
>
> Hmm. It sounds to me like the issue is not the dual-output rule as
> such; it's that we have dependencies on one of the output files from
> elsewhere in the source tree, and so we end up with multiple sub-makes
> entering the backend/parser directory in parallel to build that header
> file, and then it's broken because the rule is not safe for parallel
> execution (quite independently of whether it has one or two output
> files).

This might be also true. But I that far to say, that this happens
within the same directory.
What I mean is, the file which generate the dependencies you are talking
about are in the same directory as the bison files.

> But that's supposed to be taken care of by having the parse.h file
> updated before we start recursing into the rest of the backend --- see
> src/backend/Makefile. Why is that not stopping the problem?

s.a.

> Did you see any actual failures related to the other bison invocations,
> or just the one in backend/parser? AFAIK the other ones generate files
> that are only used within their one source directory, and so they should
> not have this problem anyway. There should only be one sub-make looking
> at the other ones.

Yes, I also have seen races in two other directories
(and decided to change all occorences of the two-file
target in any Makefile because I'm under the impression
that it's to dangerous ...).
I have seen problems in src/backend/bootstrap and in
src/pl/plpgsql/src too.

Bye, 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:38:27 Re: Patch for Makefile race against current cvs
Previous Message Tom Lane 2001-11-09 20:20:30 Re: Patch for Makefile race against current cvs