On Fri, 28 Jan 2005 at 18:32 +0100, Jos I. Boumans <[EMAIL PROTECTED]> wrote:

Here's a second attempt at integrating IPC::Run (now at version 0.80), with the most notable change the location of the modules themselves; they now all live directly in lib/, and their test files in lib/Foo/Bar/t (modeled after attribute::handlers).

My old libc5 base system reports an error from blead-perl's tests of IPC::Run

lib/IPC/Run/t/win32_compile...............Your vendor has not defined Socket 
macro TCP_NODELAY, used at ../../IPC/Run/Win32IO.pm line 90
BEGIN failed--compilation aborted at ../../IPC/Run/Win32IO.pm line 98.
Compilation failed in require at ../lib/IPC/Run/t/win32_compile.t line 87.
BEGIN failed--compilation aborted at ../lib/IPC/Run/t/win32_compile.t line 87.
FAILED at test 0

/usr/include/linux/tcp.h:#define TCP_NODELAY            1       /* Turn off 
Nagle's algorithm. */

IPC::Run::Win32IO is looking in Socket for TCP_NODELAY but my
perl core Socket was not finding the definition.
dd:Run$ perl -de 1
  DB<1> use Socket qw( IPPROTO_TCP TCP_NODELAY ) ;
  DB<2> x TCP_NODELAY
Your vendor has not defined Socket macro TCP_NODELAY, used at (eval 
6)[/usr/local/lib/perl5/5.9.2/perl5db.pl:628] line 2

Then I noticee that Win32IO isn't even getting installed on this linux computer.

If the .pm file isn't going to be installed, why should the test case cause
the perl build to fail?

Now I am surprised that this hasn't shown up in any other perl tests on my 
system,
as there is even an example of using TCP_NODELAY in perldoc -f getsockopt.

                use Socket;

                defined(my $tcp = getprotobyname("tcp"))
                    or die "Could not determine the protocol number for tcp";
                # my $tcp = Socket::IPPROTO_TCP; # Alternative
                my $packed = getsockopt($socket, $tcp, Socket::TCP_NODELAY)
                    or die "Could not query TCP_NODELAY SOCKEt option: $!";
                my $nodelay = unpack("I", $packed);
                print "Nagle's algorithm is turned ", $nodelay ? "off\n" : 
"on\n";

I think there is a bug in the documentation that the example may
not get the value of TCP_NODELAY without changeing the
                use Socket;
to
                use Socket qw(TCP_NODELAY);
right?

$ perl -wle 'use Socket; print STDOUT Socket::TCP_NODELAY'
Socket::TCP_NODELAY

That was unexpected!!!!!!
either it needs to be called as a function, or imported directly

$ perl -wle 'use Socket; print STDOUT Socket::TCP_NODELAY()'
1
$ perl -wle 'use Socket; print STDOUT &Socket::TCP_NODELAY'
1
$ perl -wle 'use Socket qw(TCP_NODELAY); print STDOUT TCP_NODELAY'
1


So, to summarize, there was a problem on my system that causes TCP_NODELAY
to not be defined correctly into Socket , but I still have to ask, if the module is not going to be installed, should it really be tested?


I think I'm glad that you did test TCP_NODELAY, as it "forced" me to fix my includes, but you may get bug reports from others)

  David







Reply via email to