bugmake - Bugs: bug #35062, Add lazy evaluation of...

 
 

bug #35062: Add lazy evaluation of prerequisites

Submitted by:  Lukasz Mielicki <lmielick>
Submitted on:  Wed 14 Dec 2011 01:16:59 AM UTC  
 
Severity: 3 - NormalItem Group: Enhancement
Status: Wont FixPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: NoneOperating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 20 Dec 2011 01:52:08 PM UTC, comment #4:

> (However functions that referenced "outside influences" like wildcard etc. could not be duplicated (a wildcard expansion while the makefile is read in and an expansion well on into the work of building targets could well give very different results for example).


A makefile where partially existent build work influences the final build state is not a correct makefile. The only safe way to use it would be with "make clean && make" always.

Anonymous
Sat 17 Dec 2011 03:39:53 PM UTC, comment #3:

Well, yes, it would be possible to do something like store the internal variable database as a kind of "versioned" database, where changes to variable values do not overwrite previous ones but instead are added on. Then when a target is defined it would keep a reference to the state of the variable database at that time so that all variable references in prerequisite lists would be expanded in the context of that state, instead of the "current" (ending) state. Or something similar.

However functions that referenced "outside influences" like wildcard etc. could not be duplicated (a wildcard expansion while the makefile is read in and an expansion well on into the work of building targets could well give very different results for example).

And my final comment stands: it would be an enormous amount of work.

One possibility would be to use SECONDEXPANSION to avoid the immediate expansion of prerequisites. However, today make will secondarily expand all (explicit) targets, not just targets that are considered during a given run. I would be willing to look into an enhancement that deferred secondary expansion until a target was considered and not secondarily expanding targets that are not considered.

Paul D. Smith <psmith>
Project Administrator
Sat 17 Dec 2011 02:36:11 PM UTC, comment #2:

> With your suggested change you would see just "bar" (no "foo").


It might be worth noting that this "massive incompatibility" is not in the suggested change per se but in Paul Hacker's idea of how it could be possibly implemented. Of course it is possible to have the feature without the incompatibility.

Anonymous
Wed 14 Dec 2011 01:38:19 AM UTC, comment #1:

Sorry but this would completely change make in a way that's massively incompatible... and confusing.

For example, today if you say:

You'll see "foo" then "bar". With your suggested change you would see just "bar" (no "foo").

This is such a complete abrogation of the historical behavior of make that I don't think it's appropriate, even as an option (especially since it would be an enormous amount of work to implement).

Paul D. Smith <psmith>
Project Administrator
Wed 14 Dec 2011 01:16:59 AM UTC, original submission:

The idea is not to evaluate prerequisites of target not being make goals. Such approach would improve non-recursive make performance by skipping unnecessary wildcard/shell calls for targets not being build.

E.g. the following Makefile would output only:
A prerequisites evaluated

all: a
a: $(info A prerequisites evaluated)
b: $(info B prerequisites evaluated)
.PHONY: a b all

This could be handled in a way similar to .SECONDEXPANSION not to cause compatibility issues in cases where prerequisites expansions causes side effects. However greater care may be needed to support eval.

Lukasz Mielicki <lmielick>

 

(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 lmielick (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 14 Dec 2011 01:38:19 AM UTCpsmithStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1