Discussion:
[1003.1(2013)/Issue7+TC1 0000857]: Make rules which do not create the target file or do unexpected things with its timestamp
Austin Group Bug Tracker
2014-08-21 15:35:18 UTC
Permalink
A NOTE has been added to this issue.
======================================================================
http://austingroupbugs.net/view.php?id=857
======================================================================
Reported By: jammule
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 857
Category: Shell and Utilities
Type: Omission
Severity: Comment
Priority: normal
Status: New
Name: Jarmo Jaakkola
Organization:
User Reference:
Section: make
Page Number: 2937
Line Number: 97105-97113
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-07-08 10:14 UTC
Last Modified: 2014-08-21 15:35 UTC
======================================================================
Summary: Make rules which do not create the target file or do
unexpected things with its timestamp
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
related to 0000523 Add support for special target .PHONY i...
related to 0000763 If rule has no prerequisites or command...
======================================================================

----------------------------------------------------------------------
(0002351) geoffclare (manager) - 2014-08-21 15:35
http://austingroupbugs.net/view.php?id=857#c2351
----------------------------------------------------------------------
On page 2937 line 97106 section make

Change from:

A target is considered out-of-date if it is older than any of its
prerequisites or if it does not exist.

to:

A target is considered out-of-date when all of its prerequisites are
up-to-date and it is older than any of them, or if it does not exist. A
target may also be considered out-of-date when it has the same timestamp as
any of its prerequisites.

On page 2937 line 97112 section make

Change from:

If there are no commands listed for the target, the target shall be treated
as up-to-date.

to:

If there are no commands listed for the target entry, the target shall be
treated as up-to-date. If a file corresponding to the target does not exist
after the target has been successfully brought up-to-date, the target shall
be treated as being newer than any target it is a prerequisite for.

When no rule matches a target for which a corresponding file exists, the
target shall be treated as up-to-date. It shall be an error if there is no
target rule for a prerequisite that does not have a corresponding file.

On page 2954 line 97847 add a new paragraph to the RATIONALE:

On most historic systems, the make utility considered a target with a
prerequisite that had an identical timestamp up-to-date. The HP-UX
implementation of make treated it as out-of-date. The standard now allows
either behavior, but implementaions are encouraged to follow the example
set by HP-UX. This is especially important on filesystems where the
timestamp resolution is the minimum (1 second) required by the standard.
All implementations of make should make full use of the finest timestamp
resolution available on the filesystems holding targets and prerequisites
to ensure that targets are up-to-date even for prerequisite files with
timestamps that were updated within the same second.

Issue History
Date Modified Username Field Change
======================================================================
2014-07-08 10:14 jammule New Issue
2014-07-08 10:14 jammule Name => Jarmo Jaakkola
2014-07-08 10:14 jammule Section => make
2014-07-08 10:14 jammule Page Number => 2937
2014-07-08 10:14 jammule Line Number => 97105-97113
2014-07-08 10:24 jammule Issue Monitored: jammule
2014-07-08 10:25 jammule Issue End Monitor: jammule
2014-08-07 16:18 eblake Note Added: 0002335
2014-08-07 16:18 eblake Relationship added related to 0000523
2014-08-07 17:16 mdempsky Note Added: 0002336
2014-08-07 17:17 mdempsky Note Added: 0002337
2014-08-08 10:41 antoinel Note Added: 0002338
2014-08-08 10:42 antoinel Note Edited: 0002338
2014-08-08 10:42 antoinel Note Edited: 0002338
2014-08-08 10:43 antoinel Note Edited: 0002338
2014-08-08 10:44 antoinel Note Edited: 0002338
2014-08-08 10:47 antoinel Note Edited: 0002338
2014-08-08 10:47 antoinel Note Edited: 0002338
2014-08-08 10:51 antoinel Note Edited: 0002338
2014-08-08 11:44 jammule Note Added: 0002340
2014-08-08 11:47 jammule Note Edited: 0002340
2014-08-08 12:22 eblake Relationship added related to 0000763
2014-08-08 17:10 mdempsky Note Added: 0002343
2014-08-21 15:35 geoffclare Note Added: 0002351
======================================================================
Austin Group Bug Tracker
2014-08-21 15:39:08 UTC
Permalink
The following issue has been RESOLVED.
======================================================================
http://austingroupbugs.net/view.php?id=857
======================================================================
Reported By: jammule
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 857
Category: Shell and Utilities
Type: Omission
Severity: Comment
Priority: normal
Status: Resolved
Name: Jarmo Jaakkola
Organization:
User Reference:
Section: make
Page Number: 2937
Line Number: 97105-97113
Interp Status: ---
Final Accepted Text: http://austingroupbugs.net/view.php?id=857#c2351
Resolution: Accepted As Marked
Fixed in Version:
======================================================================
Date Submitted: 2014-07-08 10:14 UTC
Last Modified: 2014-08-21 15:39 UTC
======================================================================
Summary: Make rules which do not create the target file or do
unexpected things with its timestamp
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
related to 0000523 Add support for special target .PHONY i...
related to 0000763 If rule has no prerequisites or command...
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-07-08 10:14 jammule New Issue
2014-07-08 10:14 jammule Name => Jarmo Jaakkola
2014-07-08 10:14 jammule Section => make
2014-07-08 10:14 jammule Page Number => 2937
2014-07-08 10:14 jammule Line Number => 97105-97113
2014-07-08 10:24 jammule Issue Monitored: jammule
2014-07-08 10:25 jammule Issue End Monitor: jammule
2014-08-07 16:18 eblake Note Added: 0002335
2014-08-07 16:18 eblake Relationship added related to 0000523
2014-08-07 17:16 mdempsky Note Added: 0002336
2014-08-07 17:17 mdempsky Note Added: 0002337
2014-08-08 10:41 antoinel Note Added: 0002338
2014-08-08 10:42 antoinel Note Edited: 0002338
2014-08-08 10:42 antoinel Note Edited: 0002338
2014-08-08 10:43 antoinel Note Edited: 0002338
2014-08-08 10:44 antoinel Note Edited: 0002338
2014-08-08 10:47 antoinel Note Edited: 0002338
2014-08-08 10:47 antoinel Note Edited: 0002338
2014-08-08 10:51 antoinel Note Edited: 0002338
2014-08-08 11:44 jammule Note Added: 0002340
2014-08-08 11:47 jammule Note Edited: 0002340
2014-08-08 12:22 eblake Relationship added related to 0000763
2014-08-08 17:10 mdempsky Note Added: 0002343
2014-08-21 15:35 geoffclare Note Added: 0002351
2014-08-21 15:39 geoffclare Interp Status => ---
2014-08-21 15:39 geoffclare Final Accepted Text =>
http://austingroupbugs.net/view.php?id=857#c2351
2014-08-21 15:39 geoffclare Status New => Resolved
2014-08-21 15:39 geoffclare Resolution Open => Accepted As
Marked
======================================================================
Austin Group Bug Tracker
2014-08-21 16:13:40 UTC
Permalink
A NOTE has been added to this issue.
======================================================================
http://austingroupbugs.net/view.php?id=857
======================================================================
Reported By: jammule
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 857
Category: Shell and Utilities
Type: Omission
Severity: Comment
Priority: normal
Status: Resolved
Name: Jarmo Jaakkola
Organization:
User Reference:
Section: make
Page Number: 2937
Line Number: 97105-97113
Interp Status: ---
Final Accepted Text: http://austingroupbugs.net/view.php?id=857#c2351
Resolution: Accepted As Marked
Fixed in Version:
======================================================================
Date Submitted: 2014-07-08 10:14 UTC
Last Modified: 2014-08-21 16:13 UTC
======================================================================
Summary: Make rules which do not create the target file or do
unexpected things with its timestamp
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
related to 0000523 Add support for special target .PHONY i...
related to 0000763 If rule has no prerequisites or command...
======================================================================

----------------------------------------------------------------------
(0002353) eggert (reporter) - 2014-08-21 16:13
http://austingroupbugs.net/view.php?id=857#c2353
----------------------------------------------------------------------
There's a misspelling "implementaions" in the accepted text.

More importantly, the new paragraph of the rationale should not recommend
the HP-UX behavior, as the traditional behavior is longstanding and has
some performance advantages. For example, given the rule 'copy: original;
cp -p original copy', if I run HP-UX 'make' twice, the second run will copy
the file unnecessarily, but GNU 'make' will do the right thing. This comes
up even more often on filesystems with coarse timestamps, because then even
plain 'cp' can be affected.

I suggest changing this:

The standard now allows either behavior, but implementaions are encouraged
to follow the example set by HP-UX. This is especially important on
filesystems where the timestamp resolution is the minimum (1 second)
required by the standard.

to this:

The standard now allows either behavior.

I also suggest appending the following text:

Shell command sequences like "make; cp original copy; make" may have
problems on filesystems where the timestamp resolution is the minimum (1
second) required by the standard and where 'make' considers identical
timestamps to be up to date. Conversely, rules like "copy: original; cp -p
original copy" will result in redundant work on 'make' implementations that
consider identical timestamps to be out of date.

Issue History
Date Modified Username Field Change
======================================================================
2014-07-08 10:14 jammule New Issue
2014-07-08 10:14 jammule Name => Jarmo Jaakkola
2014-07-08 10:14 jammule Section => make
2014-07-08 10:14 jammule Page Number => 2937
2014-07-08 10:14 jammule Line Number => 97105-97113
2014-07-08 10:24 jammule Issue Monitored: jammule
2014-07-08 10:25 jammule Issue End Monitor: jammule
2014-08-07 16:18 eblake Note Added: 0002335
2014-08-07 16:18 eblake Relationship added related to 0000523
2014-08-07 17:16 mdempsky Note Added: 0002336
2014-08-07 17:17 mdempsky Note Added: 0002337
2014-08-08 10:41 antoinel Note Added: 0002338
2014-08-08 10:42 antoinel Note Edited: 0002338
2014-08-08 10:42 antoinel Note Edited: 0002338
2014-08-08 10:43 antoinel Note Edited: 0002338
2014-08-08 10:44 antoinel Note Edited: 0002338
2014-08-08 10:47 antoinel Note Edited: 0002338
2014-08-08 10:47 antoinel Note Edited: 0002338
2014-08-08 10:51 antoinel Note Edited: 0002338
2014-08-08 11:44 jammule Note Added: 0002340
2014-08-08 11:47 jammule Note Edited: 0002340
2014-08-08 12:22 eblake Relationship added related to 0000763
2014-08-08 17:10 mdempsky Note Added: 0002343
2014-08-21 15:35 geoffclare Note Added: 0002351
2014-08-21 15:39 geoffclare Interp Status => ---
2014-08-21 15:39 geoffclare Final Accepted Text =>
http://austingroupbugs.net/view.php?id=857#c2351
2014-08-21 15:39 geoffclare Status New => Resolved
2014-08-21 15:39 geoffclare Resolution Open => Accepted As
Marked
2014-08-21 15:39 geoffclare Tag Attached: tc2-2008
2014-08-21 16:13 eggert Note Added: 0002353
======================================================================
Geoff Clare
2014-08-22 09:45:08 UTC
Permalink
Post by Austin Group Bug Tracker
----------------------------------------------------------------------
(0002353) eggert (reporter) - 2014-08-21 16:13
http://austingroupbugs.net/view.php?id=857#c2353
----------------------------------------------------------------------
There's a misspelling "implementaions" in the accepted text.
Thanks, I've fixed that.
Post by Austin Group Bug Tracker
More importantly, the new paragraph of the rationale should not recommend
the HP-UX behavior, as the traditional behavior is longstanding and has
some performance advantages. For example, given the rule 'copy: original;
cp -p original copy', if I run HP-UX 'make' twice, the second run will copy
the file unnecessarily, but GNU 'make' will do the right thing. This comes
up even more often on filesystems with coarse timestamps, because then even
plain 'cp' can be affected.
The consensus on the call was that given a choice between the traditional
behaviour where make never updates a target unnecessarily but risks not
updating a target that needs updating, and the HP-UX behaviour where
make might sometimes update a target unnecessarily but ensures that
targets which need updating are always updated, the "right thing" to do
is what HP-UX does.

If a target has the same timestamp as its newest prerequisite, it is
impossible to know whether it is already up to date; we believe
implementations should be encouraged to ensure it is up to date by
remaking it. As you point out, the chances of files having the
same timestamp are close to zero on modern filesystems with support
for finegrain timestamps, so a change to the HP-UX behaviour will
probably not be noticed by most users.
Post by Austin Group Bug Tracker
Shell command sequences like "make; cp original copy; make" may have
problems on filesystems where the timestamp resolution is the minimum (1
second) required by the standard and where 'make' considers identical
timestamps to be up to date. Conversely, rules like "copy: original; cp -p
original copy" will result in redundant work on 'make' implementations that
consider identical timestamps to be out of date.
This may be a worthwhile addition to the application usage section,
regardless of whether the rationale recommends the HP-UX behavior.
--
Geoff Clare <g.clare-7882/***@public.gmane.org>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England
Loading...