bugmake - Bugs: bug #37708, File rules compare wrong own...

 
 

bug #37708: File rules compare wrong own timestamps

Submitted by:  None
Submitted on:  Sat 10 Nov 2012 06:18:16 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating 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.

 

Sun 13 Jan 2013 08:19:32 PM UTC, comment #1:

This is not technically a bug... or if it is it's a duplicate of the directory cache issue. Your makefile is not being honest with make: as far as your makefile is concerned, there is no way for the file "depended_real_file" to ever be updated. Thus, make does some shortcuts to improve performance.

However, because your makefile really does change the time of "depended_real_file" behind make's back (as a hidden side-effect of updating "depended_remake_always"), things don't work well.

I suspect that what you want to do could be more straightforwardly done but there's not enough detail here to know for sure; if you want help please email -unavailable- rather than using the bug tracker.

If you change your makefile such that you give commands to the "depended_real_file" target, even if they're empty, then make will re-check the timestamp because it thinks maybe something changed; then your makefile will work (always rebuilds main):

Paul D. Smith <psmith>
Project Administrator
Sat 10 Nov 2012 06:18:16 PM UTC, original submission:

Have test makefile:

.SILENT:
.PHONY: depended_remake_always

all : depended_remake_always main
depended_remake_always :
if [ \( ! -e ./depended_real_file \) -o \( ./depended -nt ./depended_real_file \) ]; then \
touch depended_real_file; \
echo depended_real_file remade; \
fi
depended_real_file: depended_remake_always
#
main: depended_real_file
echo "about to do main"
touch main

in command line
touch depended
make -f test.mak main

doesn't proceed rule main while depended_remake_always made. It happens because timestamps of main and depended_real_file compared on wrong stage: namely BEFORE depended_real_file rule FULLY executes.

As workaround
touch depended
make -f test.mak all
works as it should

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)
  •  

    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
    Sun 13 Jan 2013 08:19:32 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup