Subject: | Test fails when pcap.h missing |
Date: | Mon, 27 Feb 2017 00:35:57 -0500 |
To: | bug-Net-Interface [...] rt.cpan.org |
From: | Chris Fowler <linxdev [...] gmail.com> |
I ran into an issue on a new dev system where Net-Interface-0.16 passed
compile, but failed testing.
# at t/strlcpy.t line 13.
# Compilation failed in require at t/strlcpy.t line 13.
# BEGIN failed--compilation aborted at t/strlcpy.t line 13.
Undefined subroutine &Net::Interface::strlcpy called at t/strlcpy.t line 38.
# Looks like you planned 21 tests but ran 1.
# Looks like you failed 1 test of 1 run.
# Looks like your test exited with 255 just after 1.
t/strlcpy.t ....... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 21/21 subtests
t/symbols.t ....... 1/?
# Failed test 'use Net::Interface;'
# at t/symbols.t line 13.
# Tried to use 'Net::Interface'.
# Error: Can't load
'/home/cfowler/CS/system/perl-modules/modules/libnet-interface-perl/build/Net-Interface-1.012/blib/arch/auto/Net/Interface/Interface.so'
for module Net::Interface: /home/cfowler/C
S/system/perl-modules/modules/libnet-interface-perl/build/Net-Interface-1.012/blib/arch/auto/Net/Interface/Interface.so:
undefined symbol: ni_in6_classify at
/opt/cs/usr/lib/perl5/5.22/DynaLoader.pm line1
93.
# at t/symbols.t line 13.
# Compilation failed in require at t/symbols.t line 13.
# BEGIN failed--compilation aborted at t/symbols.t line 13.
# Failed test 'Undefined subroutine &main::PF_UNSPEC called at
t/symbols.t line 21.
# '
# at t/symbols.t line 33.
# Failed test 'Undefined subroutine &main::PF_INET called at t/symbols.t
line 21.
# '
# at t/symbols.t line 33.
# Failed test 'Undefined subroutine &main::AF_UNSPEC called at
t/symbols.t line 21.
In my case pcap.h is in a non-standard location. The fix was to use
CPATH=<INLUCDE PATH> environment at configure and during make.
Without that if I skipped testing any script using Net::Interface would
dump core.
I guess I was expecting Makefile.PL and configure to pull CFLAGS from
perl's config. I may be mistaken as this module may be 1 of 3 or so out of
200 I use that uses configure.
perl -V below:
Summary of my perl5 (revision 5 version 22 subversion 3) configuration:
Platform:
osname=linux, osvers=2.6.18-274.12.1.el5,
archname=i586-linux-thread-multi
uname='linux cfowler-baytrail-d 2.6.18-274.12.1.el5 #29-ubuntu smp tue
feb 14 13:56:31 utc 2012 i586 athlon i386 gnulinux '
config_args='-des -Dusethreads -Duseshrplib -Doptimize=-O2
-Dprefix=/opt/cs/usr -Dprivlib=/opt/cs/usr/share/perl5/5.22
-Darchlib=/opt/cs/usr/lib/perl5/5.22
-Dsitearch=/opt/cs/usr/lib/perl5/5.22.3 -Dsi
telib=/opt/cs/usr/share/perl5/5.22.3 -Dsitescript=/opt/cs/usr/bin
-Dvendorprefix=/opt/cs/usr -Dvendorarch=/opt/cs/usr/lib/perl5/vendor_perl
-Dvendorlib=/opt/cs/usr/share/perl5/vendor_perl -Dvendorscript=/
opt/cs/usr/bin -Dscriptdir=/opt/cs/usr/bin
-Dotherlibdirs=/opt/cs/usr/lib/perl5/other:/opt/cs/usr/share/perl5/other
-Dman1dir=/opt/cs/usr/share/man/man1 -Dman3dir=/opt/cs/usr/share/man/man3
-Dsiteman1dir=/opt/cs/usr/share/man/man1
-Dsiteman3dir=/opt/cs/usr/share/man/man3
-Dvendorman1dir=/opt/cs/usr/share/man/man1
-Dvendorman3dir=/opt/cs/usr/share/man/man3 -Dinc_version_list=none
-Darchname=i586-linux-thread-multi -Accflags=-m32 -march=i586
-I/opt/cs/usr/include -Dlddlflags=-shared -Wl,-rpath,/opt/cs/usr/lib
-Wl,-rpath,/opt/cs/lib -L/opt/cs/usr/lib -L/opt/cs/lib
-Dldflags=-Wl,-rpath,/opt/cs/usr/lib -Wl,-rpath,/opt/cs/lib
-L/opt/cs/usr/lib -L/opt/cs/lib'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -m32 -march=i586
-I/opt/cs/usr/include -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_FORTIFY_SOURCE=2',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -m32 -march=i586
-I/opt/cs/usr/include -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-55)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234,
doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12,
longdblkind=3
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-Wl,-rpath,/opt/cs/usr/lib -Wl,-rpath,/opt/cs/lib
-L/opt/cs/usr/lib -L/opt/cs/lib -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.5.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.5'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/opt/cs/usr/lib/perl5/5.22/CORE'
cccdlflags='-fPIC', lddlflags='-shared -Wl,-rpath,/opt/cs/usr/lib
-Wl,-rpath,/opt/cs/lib -L/opt/cs/usr/lib -L/opt/cs/lib -L/usr/local/lib
-fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
USE_ITHREADS USE_LARGE_FILES USE_LOCALE
USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO
USE_PERL_ATOF USE_REENTRANT_API
Built under linux
Compiled at Feb 26 2017 22:53:38
%ENV:
PERLLIB="/opt/perl-lib"
@INC:
/opt/perl-lib
/opt/cs/usr/lib/perl5/5.22.3
/opt/cs/usr/share/perl5/5.22.3
/opt/cs/usr/lib/perl5/vendor_perl
/opt/cs/usr/share/perl5/vendor_perl
/opt/cs/usr/lib/perl5/5.22
/opt/cs/usr/share/perl5/5.22
/opt/cs/usr/lib/perl5/other
/opt/cs/usr/share/perl5/other
.
Thanks,
Chris