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

From: Paul Eggert <[email-masked]>
Date: Sun, 5 Feb 2023 19:08:07 -0800

On 2023-02-05 17:14, Jacob Bachmeyer wrote:

> How often is Perl built to use long doubles these days?  (That was an 
> option beginning with Perl 5.6.)

I doubt it's used much. It's not used in Ubuntu or Fedora, for what it's 
worth. And on some platforms (e.g., macOS on current Apple silicon) 
-Duselongdouble doesn't matter because long double is the same as double.

Besides, although it's too bad that Perl can't represent file timestamps 
precisely, that's not something Autoconf can fix.

> Looking at the code, commit 01bf65daf6f6627b56fbe78fc436fd877ccd3537 
> appears fine, all I am asking is that commit 
> 4e3744a15c4d8bdb46c11ead2fb56c5f591b714b be reverted.  The current 
> Automake Git master should actually work on Perl 5.6 if Time::HiRes has 
> been installed, which was possible with 5.6 although it was bundled with 
> Perl beginning with the 5.7.3 development release.

Unfortunately the Perl version bump was prompted by evidence in the 
field that without making it clear that bare Perl 5.6 does not suffice, 
Autoconf and Automake fail in ways that are mysterious to their users. 
We can't expect people to install extensions in Perl 5.6 to work around 
this problem. We must make things simple and easy for installers and 
users to understand. Particularly since these are old Perl versions that 
Autoconf and Automake users are unlikely to be running (people who use 
bleeding-edge Autoconf and Automake almost invariably run recent Perl).

It would be OK to go back to requiring only 5.6 if we can write 
conditionalized code that works with 5.6 but with lower-res timestamps, 
and quietly switches to higher-res timestamps if available and works 
fine when they are available. Autoconf and Automake should not rely on 
users installing optional Perl packages or dealing with Perl's 
diagnostics when the optional stuff is missing: the code must work out 
of the box with no expertise required.

Can you write an Automake patch to do that, and test it on old Perl 
installations? 'git format-patch' form preferred. I don't have access to 
ancient Perl and am a bit squeezed for time, so I'm afraid this will 
need to be done by a Perl expert such as yourself.