bugmake - Bugs: bug #16958, Marking .PHONY dependencies as...

 
 

bug #16958: Marking .PHONY dependencies as targets is a regression against 3.80

Submitted by:  None
Submitted on:  Wed 28 Jun 2006 12:35:39 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.81Operating System: None
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.

 

Mon 31 Jul 2006 01:27:08 PM UTC, comment #5:

Yes, the failing test case is case.2 in features/patternrules

%.2: void
@exit 1
%.2: 2.phony
@exit 0
.PHONY: 2.phony

David Kågedal <d_kagedal>
Wed 26 Jul 2006 08:16:39 AM UTC, comment #4:

AFAICR, the change fixed some problems in pattern rules. As Paul suggested, you can revert the change and run the regression tests; I am sure some of them will fail. Also note that the change is conceptually correct - a file declared .PHONY effectively becomes a target since you can now 'make' it.

Boris Kolpackov <bosk>
Project Member
Tue 25 Jul 2006 03:28:44 PM UTC, comment #3:

Hi David; have you tried reverting the change, then running the regression test suite? Most of the time when we make a change we also introduce a test case to ensure it works properly (and will continue to do so).

If you revert the change and one or more tests fail, it might give you some insight as to why the change was made.

Paul D. Smith <psmith>
Project Administrator
Mon 24 Jul 2006 09:34:33 AM UTC, comment #2:

But you never explained why you made the change. What problem did it solve? So far, the only difference in behaviour I have seen is the regression reported here.

(I was the original reporter, btw)

David Kågedal <d_kagedal>
Wed 28 Jun 2006 05:32:24 PM UTC, comment #1:

Prerequisites of the .PHONY special target are marked as targets because they are effectively targets. For example, if you have an empty Makefile and say

$ make all

you get:

make: *** No rule to make target `all'. Stop.

If, however, you have this in your makefile

.PHONY: all

then there is no problem building all. Both 3.80 and 3.81 print

make: Nothing to be done for `all'.

I am not saying that we shouldn't fix this regression. I am saying that I believe the code I added is correct and the problem is elsewhere (most likely in the code that decides whether to use commands from .DEFAULT or not).

Boris Kolpackov <bosk>
Project Member
Wed 28 Jun 2006 12:35:39 PM UTC, original submission:

Running "make foo" with a Makefile containing the following two rules produces different results with make 3.80 and 3.81.

.PHONY: foo

.DEFAULT:
echo the target is $@

With 3.80, it prints "the target is foo", and with 3.81 it states that "Nothing to be done for `foo'". This was caused by adding the following line to file.c in int .PHONY case (line 675).

f2->is_target = 1;

This is a regression, since it breaks our makefiles, and I don't understand why phonies should be considered as explicit targets unless there are actual rules for them.

The ChangeLog mentions this, but it doesn't really explain why the change was made.

2004-09-21 Boris Kolpackov <boris@kolpackov.net>

  • file.c (snap_deps): Mark .PHONY prerequisites as targets.
  • implicit.c (pattern_search): When considering an implicit rule's

prerequisite check that it is actually a target rather then
just an entry in the file hashtable.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #10263:  Makefile added by None (48B - application/octet-stream - The test Makefile)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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

Date Changed By Updated Field Previous Value => Replaced By
Thu 04 Jan 2007 07:25:25 PM UTCrandylCarbon-Copy-=>Added randyl
Mon 24 Jul 2006 09:34:33 AM UTCd_kagedalCarbon-Copy-=>Added d_kagedal
Wed 28 Jun 2006 12:37:02 PM UTCNoneAttached File-=>Added Makefile, #10263

Back to the top


Powered by Savane 3.1-cleanup1