bugmake - Bugs: bug #21198, Wrong order of prerequisites with...

 
 

bug #21198: Wrong order of prerequisites with 3.81/CVS

Submitter:  None
Submitted:  Sun 30 Sep 2007 06:29:30 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  Any
Fixed Release:  3.82 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 07 Jun 2009 05:36:25 PM UTC, comment #3: 

Fixed.  This is gross: the way we construct then reverse the prereq list leads to some hackery due to second expansion, and the hackery was incomplete such that this bug occurred.

Paul D. Smith <psmith>
Group administrator
Mon 01 Oct 2007 09:09:15 PM UTC, comment #2: 

Robin Williams points out there is a different issue here which can be seen by adding $< to the echo command, so the test reads:

all : A B C
all : ; @echo $@ -- $^, $<
all : D E F
A B C D E F : ; @echo $@

With that change, make-3.80 says:

A
B
C
D
E
F
all -- A B C D E F, A

But 3.81 says:

A
B
C
D
E
F
all -- A B C D E F, D

The manual says:

"$<
    The name of the first prerequisite."

Here the first prerequisite of "all" would appear to be "A".  Interestingly, if the example is reordered such that the prerequisites are all given before the command for building "all":

all : A B C
all : D E F
all : ; @echo $@ -- $^, $<
A B C D E F : ; @echo $@

Then 3.81 also says $< is "A".

Martin Dorey <mdorey>
Mon 01 Oct 2007 06:32:35 PM UTC, comment #1: 

In which order do you think the prerequisites should be built?  And why?

If C should be built before D, for example, then we have to tell make that D depends on C.  Mentioning D after C in a list of prerequisites is not sufficient.  Mentioning D on a later line than C is not sufficient.  We have to say that D : C, or that D : X where X : C, or D : X where X : Y and Y : C, or similar.

The ordering is otherwise up to make and may (and, as you've seen, does) vary from release to release and even from invocation to invocation.  With -j, C and D can even be built in parallel.

Martin Dorey <mdorey>
Sun 30 Sep 2007 06:29:30 PM UTC, original submission:  

Wrong order of prerequisites with 3.81/CVS

all : A B C
all : ; @echo $@ -- $^
all : D E F
A B C D E F : ; @echo $@

$ gmake381
D
E
F
A
B
C
all -- D E F A B C

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 mdorey (Posted a comment)
  •  

    There are 0 votes 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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-28 psmith Fixed Release4.0 3.82
    2009-06-07 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Component Version4.0 3.81
        Fixed ReleaseNone 4.0

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code