autoconf
[Top][All Lists]
Advanced

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

Re: Automake's file locking


From: Bruno Haible
Subject: Re: Automake's file locking
Date: Fri, 29 Jan 2021 00:50:42 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

Zack Weinberg wrote:
> There is a potential way forward here.  The *only* place in all of
> Autoconf and Automake where XFile::lock is used, is by autom4te, to
> take an exclusive lock on the entire contents of autom4te.cache.
> For this, open-file locks are overkill; we could instead use the
> battle-tested technique used by Emacs: symlink sentinels.  (See
> https://git.savannah.gnu.org/cgit/emacs.git/tree/src/filelock.c .)

I can confirm that, while flock() is the most basic/elementary locking
facility [1], its emulation in gnulib [2] does not really work on
Solaris. The unit test regularly fails on Solaris.

Therefore I like the idea of merely relying on the atomicity of
file creation / file rename operations.

These files should reside inside the autom4te.cache directory. I would
not like to change all my scripts and Makefiles that do
  rm -rf autom4te.cache
to do something like
  rm -rf autom4te.cache autom4te.tmp.*
instead.

Bruno

[1] https://gavv.github.io/articles/file-locks/
[2] https://www.gnu.org/software/gnulib/manual/html_node/flock.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]