Subject: [bug#61240] improve high-res file timestamp in Automake

From: Paul Eggert <[email-masked]>
Date: Sat, 4 Feb 2023 17:56:05 -0800

On 2023-02-04 16:02, Jacob Bachmeyer wrote:
> In any case, you will still need to account for the possibility that 
> Time::HiRes::stat() might not actually have higher resolution, depending 
> on the filesystem.

That's fine. All we want is the exact file timestamp. If the file system 
timestamp resolution is only 2 s, then we want that multiple of 2. 
Admittedly we can't get the exact file timestamp on many modern file 
systems since Time::HiRes is precise only to the nearest ~238 ns for 
today's timestamps, but the idea is to get what we easily can.

> There are also the no-runtime-overhead options of using "eval { use Time::HiRes qw(stat) };" which will replace stat() with the hi-res version if it is available and continue with the regular stat() builtin if not, or "use constant HAVE_Time_HiRes => eval { use Time::HiRes };" and a conditional "if (HAVE_Time_HiRes) { ... } else { ... }" as I suggested as an improvement to Mike Frysinger's patch. 

Sorry, I don't remember seeing that suggestion. I guess it was in 
another thread. Could you resend that patch to [email-masked] and 
cc me? Preferably a patch against the latest Automake, in "git 
format-patch" format; see <https://savannah.gnu.org/git/?group=automake> 
for how to get bleeding-edge Automake. The idea would be to port 
bleeding-edge Automake to Perl < 5.10 when that's easy.

Please bear in mind that I stopped coding in Perl 30 years ago and so am 
a bit rusty.