bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Old timestamps in the future?


From: Gisle Vanem
Subject: Old timestamps in the future?
Date: Fri, 9 Dec 2022 14:59:50 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

I have an issue with things like
 touch --date="1970-01-01"

(or 'touch -t time') that I sometime use in makefiles.
E.g. in this makefile:

---------------------------------
all: test-file-1 test-file-2

test-file-1:
        echo 'whatever' > $@
        touch -t 197001010100 $@  # Jan 1. 1970, 01:00

test-file-2:
        echo 'whatever' > $@
        touch -t 197001010020 $@  # Jan 1. 1970, 00:20

clean:
        rm -f test-file-1 test-file-2

---------------------------------

Invoking it a 2nd time, GNU-make warns:
  gnumake: Warning: File 'test-file-2' has modification time 1,8e+19 s in the 
future
  gnumake: Nothing to be done for 'all'.
  gnumake: warning:  Clock skew detected.  Your build may be incomplete.

A file dated '1. Jan. 1970, 00:20' is wrongly claimed to be in the future.
Some wrap going on here or something wrong with the logic in
'remake.c'? But a file dated '1. Jan. 1970, 01:00' is
accepted fine.

Looking at e.g.'is_ordinary_mtime()' it seems a 'st_mtime' must
be larger than some X-value to qualify as a valid timestamp.
So the above 20 min on Windows is not enough to be accepted
as "ordinary" (?)

And what does "Clock skew detected" really mean?
Not in the manual AFAICS.

--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]