bugmake - Bugs: bug #46596, Timestamp check behaviour...

 
 

bug #46596: Timestamp check behaviour difference in clean build and rebuild on rules without recipes

Submitted by:  Stefan Becker <stefanb>
Submitted on:  Thu 03 Dec 2015 07:58:39 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: DuplicatePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 4.1Operating 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 11 Apr 2016 02:36:27 PM UTC, comment #4:

You can simplify your example down to this:

In this makefile you're lying to make by telling it that running the final recipe will create a target "c", but in reality it doesn't do that; it creates a target "b".

Make knows of no way to create target "b" itself (because the rule for "b" has no recipe).

I think this may be an example of bug #41273; when the "b" file already exists on disk then the last modified time will be cached internally to make. Because there is no recipe to update the "b" target, make will never invalidate the cached modified time for "b". So, if the timestamp of "b" when make starts up is older than "a", then "a" will not be rebuilt. If the timestamp of "b" when make starts up is newer than "a", then "a" will be rebuilt.

Paul D. Smith <psmith>
Project Administrator
Fri 04 Dec 2015 07:19:42 AM UTC, comment #3:

Thanks

The admin may delete my posts, if he wishes to.

Anonymous
Fri 04 Dec 2015 07:14:35 AM UTC, comment #2:

Sorry, no hidden magic, just reading 3 times through the whole text before hitting submit.

As for the markup: when you enter a new bug there shows up a "related recipe" on the left hand side. Strangely enough it does not appear when you add a comment.

Hope this helps.

Stefan Becker <stefanb>
Fri 04 Dec 2015 04:07:49 AM UTC, comment #1:

Just curious.
How did you manage to set up this nice post and its mark-up...

given that there is no preview, or no re-edit after posting.

Is there a feature that i'm missing?

Is there a "sandbox" where I can "test" my post and preview the resulting post, after its mark-up processing.

Can I re-edit?

Or any other trick?

Are there any special privileges for admins/advanced users, to "fix" and edit existing posts?

Thanks in advance...

Note to the admin: Feel free to delete this message in a few days time... or a day or two after someone will hopefully supply a satisfactory answer.

Thanks in advance

Anonymous
Thu 03 Dec 2015 07:58:39 AM UTC, original submission:

We encountered a difference how timestamps are handled between clean builds and rebuild depending if a rule has a recipe or not. If a rule doesn't have a recipe GNU make doesn't check the timestamp of the dependency correctly and therefore fails to trigger recipes from dependent rules.

I have checked GNU make 3.81, 4.0 and 4.1: they are all affected by this issue.

I've attached 3 makefiles that highlight the problem. We have

  • file "a" that depends on file "b"
  • file "b" is one of the files generated when file "d" is updated
  • the target for dependency "d" is file/.PHONY target "c"
  • the empty rule "b: c" makes sure that the dependencies are correct, i.e. when we ask for "a" the rule for "c" is triggered

Without recipe attached to rule "b: c" the file "a" is not updated on first rebuild, only on the second one.

Example 1 uses a .PHONY target for "c", example 2 does not. The example output is generated with make 4.1 to have the "--trace" option available.

Example 1: wrong execution on rebuild:

Example 1: correct execution on rebuild by adding a no-op ":" recipe

Example 1: correct execution on rebuild by adding an empty recipe

Example 2: wrong execution on rebuild:

Example 2: correct execution on rebuild by adding a no-op ":" recipe

Example 2: correct execution on rebuild by adding an empty recipe

Stefan Becker <stefanb>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #35624:  Makefile added by stefanb (233B - application/octet-stream - Example makefiles)
file #35625:  Makefile2 added by stefanb (48B - application/octet-stream - Example makefiles)
file #35626:  Makefile.no-phony added by stefanb (185B - application/octet-stream - Example makefiles)

 

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 stefanb (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 11 Apr 2016 02:36:27 PM UTCpsmithStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
    Thu 03 Dec 2015 07:58:39 AM UTCstefanbAttached File-=>Added Makefile, #35624
      Attached File-=>Added Makefile2, #35625
      Attached File-=>Added Makefile.no-phony, #35626

    Back to the top


    Powered by Savane 3.1-cleanup1