Skip Menu |

This queue is for tickets about the Devel-CheckLib CPAN distribution.

Report information
The Basics
Id: 72291
Status: open
Priority: 0/
Queue: Devel-CheckLib

People
Owner: mattn.jp [...] gmail.com
Requestors: martin [...] arp242.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: CheckLib fails on NFS
CheckLib fails when building on NFS on my FreeBSD system (See: http:// www.freebsd.org/cgi/query-pr.cgi?pr=ports/155991) The problem is that it tries to use File::Temp::tempfile() to create a file within the source directory, which may cause problems. A patch which solves the issue is attached ... I'm not familiar with Perl, and couldn't find a "get_tmp_dir()"-like function with a quick search, but you should get the idea ;)
Subject: patch-inc-Devel-CheckLib.pm
--- inc/Devel/CheckLib.pm.orig 2011-05-25 05:39:14.000000000 +0200 +++ inc/Devel/CheckLib.pm 2011-11-09 01:10:42.000000000 +0100 @@ -222,7 +222,7 @@ for my $header (@headers) { push @use_headers, $header; my($ch, $cfile) = File::Temp::tempfile( - 'assertlibXXXXXXXX', SUFFIX => '.c' + 'assertlibXXXXXXXX', SUFFIX => '.c', DIR => '/tmp/' ); print $ch qq{#include <$_>\n} for @use_headers; print $ch qq{int main(void) { return 0; }\n}; @@ -262,7 +262,7 @@ # now do each library in turn with headers my($ch, $cfile) = File::Temp::tempfile( - 'assertlibXXXXXXXX', SUFFIX => '.c' + 'assertlibXXXXXXXX', SUFFIX => '.c', DIR => '/tmp/' ); print $ch qq{#include <$_>\n} foreach (@headers); print $ch "int main(void) { ".($args{function} || 'return 0;')." }\n";
This issue was also reported against XML::Parser in RT 72293 since it includes Devel::CheckLib in inc for testing. I've stated there I'll be happy to update XML::Parser once this ticket is resolved in a release. I am concerned, however that the patch might be a little too Unix-centric. /tmp/ makes no sense on VMS/Windows. It's also unclear to me if this if /tmp/ is actually a good place to default to on all flavors of Unix.
Thanks. I'll look into it. On 2011-11月-09 水 03:53:46, TODDR wrote: Show quoted text
> This issue was also reported against XML::Parser in RT 72293 since it > includes Devel::CheckLib > in inc for testing. I've stated there I'll be happy to update > XML::Parser once this ticket is resolved > in a release. > > I am concerned, however that the patch might be a little too Unix- > centric. /tmp/ makes no > sense on VMS/Windows. It's also unclear to me if this if /tmp/ is > actually a good place to default > to on all flavors of Unix.
The patch is at least wrong as it should not use a hardcoded /tmp. It's better to use TMPDIR => 1 instead. But I don't have an opinion about the nfs problems. Regards, Slaven
Actually, the problem is that on *BSD systems File::Temp is using locking by default. This does not work (EXLOCK=>1 is default anyway; /mnt/test is a nfs directory): 22:08 eserte@biokovo (/mnt/test): env LC_ALL=C perl -MFile::Temp=tempfile -e 'my($tmpfh,$tmpfile) = tempfile("XXXXXXXX", EXLOCK=>1) or die $!' Error in tempfile() using XXXXXXXX: Could not create temp file G4ifBI7A: Operation not supported at -e line 1 This works (explicitely NOT using locking): 22:09 eserte@biokovo (/mnt/test): env LC_ALL=C perl -MFile::Temp=tempfile -e 'my($tmpfh,$tmpfile) = tempfile("XXXXXXXX", EXLOCK=>0) or die $!' Regards, Slaven
However, if I explicitely start nfslocking on my FreeBSD system, then it works also with EXLOCK => 1: 22:12 eserte@biokovo (/mnt/test): sudo /etc/rc.d/nfslocking start Starting statd. Starting lockd. 22:12 eserte@biokovo (/mnt/test): env LC_ALL=C perl -MFile::Temp=tempfile -e 'my($tmpfh,$tmpfile) = tempfile("XXXXXXXX", EXLOCK=>1) or die $!' (no error) Regards, Slaven
Are you meaning that if add EXELOCK => 1, TMPDIR => 1 is not needed? Or needed both? On 2012-4月-18 水 16:14:01, SREZIC wrote: Show quoted text
> However, if I explicitely start nfslocking on my FreeBSD system, then
it Show quoted text
> works also with EXLOCK => 1: > > 22:12 eserte@biokovo (/mnt/test): sudo /etc/rc.d/nfslocking start > Starting statd. > Starting lockd. > 22:12 eserte@biokovo (/mnt/test): env LC_ALL=C perl > -MFile::Temp=tempfile -e 'my($tmpfh,$tmpfile) = tempfile("XXXXXXXX", > EXLOCK=>1) or die $!' > (no error) > > Regards, > Slaven
Hi, is there any progress with this ticket? tickets in other distributions are blocked on having a fix.