[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #13976] Regression in :: deps handling between V3.76 and V3.80

From: Paul D. Smith
Subject: Re: [bug #13976] Regression in :: deps handling between V3.76 and V3.80
Date: Thu, 4 Aug 2005 11:59:01 -0400

I'm throwing this out to the mailing list, too, since most folks don't
regularly read through bug reports :-).

%% Reid Madsen <address@hidden> writes:

  rm> Follow-up Comment #4, bug #13976 (project make):

  rm> I'll admit that the processing of :: targets is a gray area, and
  rm> the .WAIT approach is the clearest solution.

Well, clear_ER_ anyway.

  rm> In fact if you'll dump a few ideas my direction I'll take a stab
  rm> at it.  I really need this solved.

The first requirement is to rigorously define the behavior.  The example
you gave with double-colons is one situation.  What about something even
simpler, like this:

    all: foo .WAIT bar
    foo: bar


My first cut at a definition would be that the .WAIT *only* affects the
relationships in the dependency list that it appears in.  So, in the
above example (with -j2 of course) foo and bar would be executed in

One good reason for specifying it this way is that any action more
widespread than on a localized dependency list would be SIGNIFICANTLY
more complicated to implement... and understand... and debug.

In your example:

  rm> all:: foo .WAIT bar
  rm> all:: foo
  rm> all:: bar
  rm> all:: bar foo
  rm> all:: bar .WAIT foo

following the idea that double-colon rules are treated independently,
foo and bar would be run in parallel.  Even removing the middle lines
(which give you an easy out given this principle):

    all:: foo .WAIT bar
    all:: bar .WAIT foo

they would be run in parallel.

Actually because double-colons are treated as separate targets, they're
the easier case.  Multiple single colon rules are harder to decide,
IMO.  For example, what about THIS:

    all: foo .WAIT bar
    all: baz

For the purposes of parallelism, is this considered the same as:

    foo .WAIT bar baz

or would it be:

    foo baz .WAIT bar


  rm> My first thought is that a files deps list has to have two dimensions

  rm>   struct dep {
  rm>     struct dep* wait_list;
  rm>     struct dep* next;
  rm>     ...
  rm>   };

  rm> The dependencies are broken into individual lists on the .WAIT
  rm> target, and the individual lists are then hooked up in order
  rm> through the 'wait_list' member.  Transition between the dependency
  rm> list occurs if all the current dependencies are up to date, and
  rm> the 'wait_list' member is non-nil.

I'm not sure it needs to be that complex.  Couldn't you get the same
effect by simply putting a "wait" boolean in the struct dep, which would
be enabled if the .WAIT target appeared after that dep?

Then when make walked the dependency list it would stop when it found
wait == true.

When the dependency has been completed, the "wait" flag would be set to

I'm sure I'm forgetting something :-).

 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]