Re: Automake's file locking (was Re: Autoconf/Automake is not using version from AC_INIT)

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

 



On Mon, 25 Jan 2021, Zack Weinberg wrote:

Automake "just" calls Perl's 'flock' built-in (see 'sub lock' in
Automake/XFile.pm) (this code is copied into Autoconf under the
Autom4te:: namespace).  It would be relatively straightforward to
teach it to try 'fcntl(F_SETLKW, ...)' if that fails.  Do you know
whether that would be sufficient?  If not, we may be up a creek, since
depending on CPAN modules is a non-starter.

I expect that it would be that "simple" except for of course everything involved with making sure that things are working properly for everyone.

It may be that moving forward to 'fcntl(F_SETLKW, ...)' by default and then falling back to legacy 'flock' would be best. Or perhaps discarding use of legacy 'flock' entirely.

Most likely the decision as to what to do was based on what was the oldest primitive supported at the time. The GNU/Linux manual page says that "the flock() call first appeared in 4.2BSD". It also says "Since Linux 2.6.12, NFS clients support flock() locks by emulating them as fcntl(2) byte-range locks on the entire file.". There are a number of warnings in the manual page regarding the danger of mixing locking primitives. It was never intended that flock() work over a network share.

It seems unlikely that Autotools development is going to be done on a system lacking POSIX locking since such a system would not be considered a usable system for most purposes. If a project does not provide a 'maintainer mode' to stop maintainer rules from firing, then this could impact archaic targets from the early '90s.

Bob
--
Bob Friesenhahn
bfriesen@xxxxxxxxxxxxxxxxxxx, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux