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

 
 

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

Submitted by:  None
Submitted on:  Sun 30 Sep 2007 06:29:30 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.81Operating System: Any
Fixed Release: 3.82Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by mdorey (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 06:17:45 AM UTCpsmithFixed Release4.0=>3.82
    Sun 07 Jun 2009 05:36:25 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Component Version4.0=>3.81
      Fixed ReleaseNone=>4.0

    Back to the top


    Powered by Savane 3.1-cleanup1