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

Re: Bug#677865: Re: Bug#677865: dpkg-gencontrol warns about 'File::FcntlLock not available'



Hi!

On Sun, 2014-05-18 at 01:39:12 +0200, Jens Thoms Toerring wrote:
> On Fri, May 16, 2014 at 11:06:17PM +0300, Niko Tyni wrote:
> > Would it be possible to probe for the contents of the flock struct with C
> > code at build time, and then use that information to write out a pure perl
> > module that regenerates the structs at run time (probably with pack())?
> > 
> > It would still be architecture dependent (and thus go in
> > vendorarch/sitearch) but it wouldn't need a rebuild across Perl upgrades.
> 
> I've got it to work and send atttach the new version - it's now
> a pure Perl module, created when running 'perl Makefile.PL'.
> Please let me know if this helps to solve the problem. If it
> does I'll upload it to CPAN.

Wow nice! Yes I think this would solve the issue. But I've got a slight
concern about this new approach and binary compatibility, though. The
inferred information used at build time is disconnected from the actual
function being used at run-time. This could fail or stop working if for
example, a new fcntl(3) versioned symbol was introduced that used a
different ABI (unlikely), or more probably new fcntl commands got
introduced to handle say a layout change in its struct flock, change in
member size, alignment or similar, and then perl core switched to use
that new symbol or the module kept using the old commands. We already
have seen this at least for the fcntl(2) to fcntl64(2) syscall
transition on GNU/Linux for example, which also switched userland to
transparently use F_SETLK64, F_SETLKW64 commands and friends to be able
to use the new struct flock64 and fcntl64 syscall.

What about, preserving the XS module, and make the code try to load it
and if not available, fall back to the new pure perl code? I think that
would palliate such concern.

In Debian libdpkg-perl could switch back to a strong Depends, and the
libfile-fcntllock-perl could Recommend a new -xs variant for example?

Thanks,
Guillem


Reply to: