GNU make relies on timestamps to see if a dependency was changed after some file was built. If you make a change during the leap second or an NTP adjustment, is it possible that make will believe the dependency is older than the built file when it really isn't? This would cause the file to never be rebuilt.
Add a comment
|
1 Answer
UNIX timestamps are not saved as dates and daytimes, but as monotonous counters since begin of the UNIX epoch 1970-01-01 00:00:00¹.
Therefore, that problem does not arise.
¹ not exactly though, there's been leap-second-adjustments… it's a long, quite ugly story. However, takeaway is that file time stamps increase monotonically with time. By the way, it looks like there will never by leap seconds again.
-
I know the timestamps are usually monotonically increasing, but the question is about the possible exceptions: NTP adjustments and leap seconds.Tomek Czajka– Tomek Czajka2024-12-17 21:06:24 +00:00Commented Dec 17, 2024 at 21:06
-
and I answered that: still monotonous; leap seconds don't affect how many seconds have happened since some point in time. They affect how that number of passed seconds is converted to a human-readable datetime. . (unless your NTP client does things it shouldn't do. Modern NTP clients by default are safe, in that they never set the clock back, they just "slow down" time, so that timestamps remain monotonous)Marcus Müller– Marcus Müller2024-12-17 21:08:02 +00:00Commented Dec 17, 2024 at 21:08
-
OK so that answers the part about NTP, what about leap seconds (if there are more)? Are timestamps in TAI rather than in Unix time?Tomek Czajka– Tomek Czajka2024-12-17 21:09:11 +00:00Commented Dec 17, 2024 at 21:09
-
1But we're not talking about physics, we're talking about Unix timestamps... Sorry if I'm being obtuse but talking about time in physics doesn't resolve the question. Is the answer that timestamps in the filesystem are stored as a TAI offset rather than a UTC offset?Tomek Czajka– Tomek Czajka2024-12-17 21:11:24 +00:00Commented Dec 17, 2024 at 21:11
-
1Sorry but your other answer clearly is wrong in light of the fact that Unix time jumps by 1 second during a leap second, as described on Wikipedia, and as I just confirmed by experiment.Tomek Czajka– Tomek Czajka2024-12-17 21:36:37 +00:00Commented Dec 17, 2024 at 21:36