bugmake - Bugs: bug #35133, Pattern rules used as dependencies...

 
 

bug #35133: Pattern rules used as dependencies for .PRECIOUS don't actually do pattern matching

Submitted by:  None
Submitted on:  Tue 20 Dec 2011 10:17:46 PM UTC  
 
Severity: 3 - NormalItem Group: Enhancement
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.82Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Wed 21 Dec 2011 03:54:55 PM UTC, comment #2:

I can see where it would be an issue with backward compatibility.

At the least, .PRECIOUS should probably have a better description in the documentation to make it more clear that it will only match on a target if the patterns are identical.

Brian Vandenberg <phantal>
Tue 20 Dec 2011 11:22:06 PM UTC, comment #1:

The .PRECIOUS pseudo-target is behaving as documented:

And so are pattern-specific variable assignments:

This is not a bug; the system is behaving as documented.

We can consider changing the behavior of, for example, the .PRECIOUS target so that patterns simply match any target, like other pseudo-targets that take patterns, but we'd have to think very carefully about the backward-compatibility implications of this. I'll leave this open as an enhancement request.

Paul D. Smith <psmith>
Project Administrator
Tue 20 Dec 2011 10:17:46 PM UTC, original submission:

Simple example:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
all: some_target_blah.o stuff.o
@echo $@, $<

%.y:
@echo $@

some_target%.cc : %.y
@echo $@, ${TEST}

%.cc:
@echo $@, ${TEST}

%.o : %.cc
@echo $@, $<

#1
%.cc : TEST := stuff

#2
.PRECIOUS: %.cc
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In the above example, pattern-matching is used in a few different ways; the two I'm drawing attention to in this bug report are #1 and #2.

#1 causes EVERY .cc file to have TEST set. However, in #2, the pattern specified as a dependency of .PRECIOUS only applies to files built using a rule of the form:

%.cc : whatever

Since 'some_target_blah.o' is built using a different pattern, the .PRECIOUS directive doesn't apply to it; thus, make will still try to remove that file when it is finished running.

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 phantal (Posted a comment)
  • -unavailable- added by psmith (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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 20 Dec 2011 11:22:06 PM UTCpsmithItem GroupBug=>Enhancement

    Back to the top


    Powered by Savane 3.1-cleanup