arthurnn / memcached

A Ruby interface to the libmemcached C client
Academic Free License v3.0
432 stars 127 forks source link

extconf: set timestamps to a half hour in the past #175

Closed mistydemeo closed 6 years ago

mistydemeo commented 6 years ago

The current approach to setting timestamps can cause confusing errors building the vendored memcached in situations where the clock has drifted a bit from real time. The failed sanity check produces the error:

checking whether build environment is sane... configure: error: newly created file is older than distributed files!
Check your system clock

This kind of clock drift is very common when using Docker for Mac or Windows. Ruby's Time.now appears to use a different clock from the one used by the timestamps for the file created as a part of the sanity check. As a result, a clock drift of as little as six seconds can cause the timestamps set on the source tree to be newer than the file created during the sanity check.

This sets the timestamps a half hour in the past instead of at the present time, allowing for a bit of leeway in clock drift.

mistydemeo commented 6 years ago

Test failures look unrelated.

arthurnn commented 6 years ago

thansk @mistydemeo

mistydemeo commented 6 years ago

Thanks! Any chance you'd be up for cutting a new release?

arthurnn commented 6 years ago

this fixes it in master, which is not released. (in alpha)