bugmake - Bugs: bug #13862, .WAIT target for parallel builds

 
 

bug #13862: .WAIT target for parallel builds

Submitter:  None
Submitted:  Wed 20 Jul 2005 01:48:52 PM UTC
Votes: 1
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.80 Operating System:  Any
Fixed Release:  4.4 Triage Status:  Medium Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 12 Sep 2022 10:38:25 PM UTC, comment #7: 

This is implemented for the next release of GNU make.

Paul D. Smith <psmith>
Group administrator
Thu 08 Sep 2022 07:34:44 PM UTC, comment #6: 

The next release of the POSIX standard will require .WAIT prerequisites for make.

I think the final text looks something like what is shown here: https://austingroupbugs.net/view.php?id=1437#c5489 but I'm not sure.

Paul D. Smith <psmith>
Group administrator
Wed 12 Feb 2014 11:07:04 PM UTC, comment #5: 

What's the status here? .WAIT seems to be a useful feature.

Anonymous
  Spam posted by sevanath
Mon 03 Apr 2006 05:21:57 PM UTC, comment #3: 

See also bug #13976.
See also these emails:
  http://lists.gnu.org/archive/html/help-make/2005-04/msg00087.html
  http://lists.gnu.org/archive/html/help-make/2005-05/msg00002.html

Nikolay: I don't understand your comment "[.NO_PARALLEL] is already supported in GNU make (though it has a different syntax)".  I'm not aware of anything similar to this available in GNU make today.  If you mean the .NOTPARALLEL special target, that simply disables all parallelism for any instance of make that parses the target.  It doesn't apply only to the prerequisite targets; in fact it ignores them.

Or, you might mean order-only prerequisites.  You can implement something like this with OO prerequisites, but it's very convoluted because you have to be sure every prerequisite also is defined to have the OO prereq, and so on.

Paul D. Smith <psmith>
Group administrator
Sun 02 Apr 2006 06:52:34 AM UTC, comment #2: 

I think the example in the description is not quite correct.
Usually .WAIT target is used to separate targets, that do not
depend one on another in sense of build process, but they should
not be built in parallel. For example, a nightly build process may include "building" and "testing":

nightly_build: install .WAIT test

install: all
...

test:
...

In this case it is not desired to set the dependency (test: install), because it will not allow to rerun tests without
rebuilding. Also it does not make sense to do both targets in
parallel. If we use Sun Studio dmake, we usually add a .WAIT target between "install" and "test", or add the dependency:
.NO_PARALLEL: install test

I think the second way is better, and it is already supported
in GNU make (though it has different syntax). But it would be
great if GNU make will also support .WAIT, because in some
cases .WAIT is a simpler solution. For example, if there are
several sets of targets, and we don't want to build them
in parallel, we usually use .WAIT to separate them:

SET1=t11 t12 t13 t14 t15
SET2=t21 t22 t23 t24 t25
SET3=t31 t32 t33 t34 t35

all: ${SET1} .WAIT ${SET2} .WAIT ${SET3}

In this case it is a tricky task to use .NO_PARALLEL: to
separate the sets of targets.


Nikolay Molchanov <nikm>
Sun 22 Jan 2006 03:02:10 AM UTC, comment #1: 

$ info make 'Phony Targets'

describes GNU make's method -- but, only in passing; it's very easy to miss (look for "foo: baz")!

Essentially:  if "build" depends that the full
 "install-includes" is done before it may start, then the makefile should say that dependency rule.  A target won't start until after all of its prerequisites have finished.

all: install
install: build
build: install-includes

Anonymous
Wed 20 Jul 2005 01:48:52 PM UTC, original submission:  

When building parallel builds (with -j) and with a target that looks like this:

all: install-includes build install

and build depends on that the full install-includes is done before it may start, GNU make doesn't handle this very well.

In BSD make there's a special target called .WAIT, that you can specify on the depend list, telling make to make sure everything before it is completed before starting with the next. Used like this:

all: install-includes .WAIT build .WAIT install

I have searched in info pages and google, but not been able to find out how to do this with GNU make. If it doesn't exist, this is an enhancement request for it.


-email is unavailable-

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by sevanath (Posted a comment)
  •  

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-12 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4
        Triage StatusNone Medium Effort
    2006-04-02 nikm Carbon-Copy- Added nikm
    2005-07-21 tomas_skare Carbon-Copy- Added tomas_skare

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code