On 05/23/2013 12:29 PM, Mike Frysinger wrote:
On Wednesday 15 May 2013 15:22:21 Michał Górny wrote:
The 'userland_*' flags have proven not good enough to determine
the availability of lock helpers. Fabian provided a nice portable
locking code instead.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=466554
---
  gx86/eclass/multibuild.eclass | 29 +++++++++++++++--------------

this seems more appropriate for portability.eclass than other random places.
there you can keep flock when it's available, or fall back to manual hacks like
this.

It can be tricky find out whether or not the underlying filesystem will behave well with flock. For example, maybe it will just fail temporarily due to lock exhaustion (ENOLCK), or maybe the filesystem doesn't support locking at all (ENOSYS).

Given all of the variables, it may be safest to use hardlink locks in any case, since they work reliably on practically any relevant filesystem. So if we do end up putting something in portability.eclass, maybe hardlink locks are the way to go. Alternatively, we could add some locking functions in the next EAPI, and let the package manager handle the implementation details.
--
Thanks,
Zac

Reply via email to