gugod / App-perlbrew

Manage perl installations in your $HOME
https://perlbrew.pl
Other
719 stars 216 forks source link

perlbrew'd perl vs NetSNMP etc. #545

Open djzort opened 7 years ago

djzort commented 7 years ago
dean@cliffjumper:~$ perlbrew version
/usr/bin/perlbrew  - App::perlbrew/0.78
dean@cliffjumper:~$ perlbrew use
Currently using perl-5.20.2

Then run:

dean@cliffjumper:~$ cpanm --force --verbose NetSNMP::default_store
cpanm (App::cpanminus) 1.7024 on perl 5.020002 built for x86_64-linux-thread-multi
Work directory is /home/dean/.cpanm/work/1487122980.9150
You have make /usr/bin/make
You have LWP 6.15
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching NetSNMP::default_store on cpanmetadb ...
--> Working on NetSNMP::default_store
Fetching http://www.cpan.org/authors/id/H/HA/HARDAKER/NetSNMP-default_store-5.0404.tar.gz ... OK
Unpacking NetSNMP-default_store-5.0404.tar.gz
NetSNMP-default_store-5.0404/
NetSNMP-default_store-5.0404/Makefile.PL
NetSNMP-default_store-5.0404/test.pl
NetSNMP-default_store-5.0404/default_store.xs
NetSNMP-default_store-5.0404/default_store.pm
NetSNMP-default_store-5.0404/README
NetSNMP-default_store-5.0404/Changes
NetSNMP-default_store-5.0404/typemap
NetSNMP-default_store-5.0404/MANIFEST
Entering NetSNMP-default_store-5.0404
META.yml/json not found. Creating skeleton for it.
Running Makefile.PL
Configuring NetSNMP-default_store-5.0404 ... Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for NetSNMP::default_store
Writing MYMETA.yml and MYMETA.json
OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.24)
Building and testing NetSNMP-default_store-5.0404 ... cp default_store.pm blib/lib/NetSNMP/default_store.pm
AutoSplitting blib/lib/NetSNMP/default_store.pm (blib/lib/auto/NetSNMP/default_store)
Running Mkbootstrap for default_store ()
chmod 644 "default_store.bs"
"/home/dean/perl5/perlbrew/perls/perl-5.20.2/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- default_store.bs blib/arch/auto/NetSNMP/default_store/default_store.bs 644
"/home/dean/perl5/perlbrew/perls/perl-5.20.2/bin/perl" "/home/dean/perl5/perlbrew/perls/perl-5.20.2/lib/5.20.2/ExtUtils/xsubpp" -prototypes -typemap '/home/dean/perl5/perlbrew/perls/perl-5.20.2/lib/5.20.2/ExtUtils/typemap' -typemap '/home/dean/.cpanm/work/1487122980.9150/NetSNMP-default_store-5.0404/typemap'  default_store.xs > default_store.xsc
mv default_store.xsc default_store.c
cc -c   -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/build/net-snmp-fJjPtm/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.24/CORE -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I/usr/include -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"5.0404\" -DXS_VERSION=\"5.0404\" -fPIC "-I/home/dean/perl5/perlbrew/perls/perl-5.20.2/lib/5.20.2/x86_64-linux-thread-multi/CORE"   default_store.c
rm -f blib/arch/auto/NetSNMP/default_store/default_store.so
LD_RUN_PATH="/usr/lib/x86_64-linux-gnu" cc  -shared -O2 -L/usr/local/lib -fstack-protector -Wl,-z,relro -Wl,-z,now default_store.o  -o blib/arch/auto/NetSNMP/default_store/default_store.so  \
   -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmp -lm   \

chmod 755 blib/arch/auto/NetSNMP/default_store/default_store.so
"/home/dean/perl5/perlbrew/perls/perl-5.20.2/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- default_store.bs blib/arch/auto/NetSNMP/default_store/default_store.bs 644
PERL_DL_NONLAZY=1 "/home/dean/perl5/perlbrew/perls/perl-5.20.2/bin/perl" "-Iblib/lib" "-Iblib/arch" test.pl
1..90
Can't load 'blib/arch/auto/NetSNMP/default_store/default_store.so' for module NetSNMP::default_store: blib/arch/auto/NetSNMP/default_store/default_store.so: undefined symbol: Perl_xs_handshake at /home/dean/perl5/perlbrew/perls/perl-5.20.2/lib/5.20.2/x86_64-linux-thread-multi/DynaLoader.pm line 193.
 at test.pl line 97.
Compilation failed in require at test.pl line 97.
BEGIN failed--compilation aborted at test.pl line 97.
not ok 1
Makefile:1007: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 2
FAIL
! Testing NetSNMP-default_store-5.0404 failed but installing it anyway.
"/home/dean/perl5/perlbrew/perls/perl-5.20.2/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- default_store.bs blib/arch/auto/NetSNMP/default_store/default_store.bs 644
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/dean/perl5/perlbrew/perls/perl-5.20.2/lib/site_perl/5.20.2/x86_64-linux-thread-multi/auto/NetSNMP/default_store/default_store.so
Appending installation info to /home/dean/perl5/perlbrew/perls/perl-5.20.2/lib/5.20.2/x86_64-linux-thread-multi/perllocal.pod
Successfully reinstalled NetSNMP-default_store-5.0404
Installing /home/dean/perl5/perlbrew/perls/perl-5.20.2/lib/site_perl/5.20.2/x86_64-linux-thread-multi/.meta/NetSNMP-default_store-5.0404/install.json
1 distribution installed
dean@cliffjumper:~$ 

I dont know enough about whats going on with XS modules and how perlbrew works to understand whats going on here. But it looks like the compilation is not happening 100% against the perlbrew'd perl.

I dont even know if i should be asking perlbrew for help here?

djzort commented 3 years ago

Revisiting this with

# perlbrew version 
/opt/perl5/bin/perlbrew  - App::perlbrew/0.89
# which perl
/opt/perl5/perls/perl-5.32.0/bin/perl
# perl -v
This is perl 5, version 32, subversion 0 (v5.32.0) built for x86_64-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)

The result is the same.

Whats strange is that its somehow managing to link against system perl

Warning: prerequisite NetSNMP::OID 5.02 not found.
Generating a Unix-style Makefile
Writing Makefile for NetSNMP::TrapReceiver
Writing MYMETA.yml and MYMETA.json
# make
cp TrapReceiver.pm blib/lib/NetSNMP/TrapReceiver.pm
AutoSplitting blib/lib/NetSNMP/TrapReceiver.pm (blib/lib/auto/NetSNMP/TrapReceiver)
Running Mkbootstrap for TrapReceiver ()
chmod 644 "TrapReceiver.bs"
"/opt/perl5/perls/perl-5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- TrapReceiver.bs blib/arch/auto/NetSNMP/TrapReceiver/TrapReceiver.bs 644
"/opt/perl5/perls/perl-5.32.0/bin/perl" "/opt/perl5/perls/perl-5.32.0/lib/5.32.0/ExtUtils/xsubpp" -prototypes -typemap '/opt/perl5/perls/perl-5.32.0/lib/5.32.0/ExtUtils/typemap' -typemap '/root/net-snmp-5.7.3/perl/TrapReceiver/typemap'  TrapReceiver.xs > TrapReceiver.xsc
mv TrapReceiver.xsc TrapReceiver.c
cc -c  -I. -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/home/lamby/temp/cdt.20200804161507.xrfcNaoyLK.ags.lamby-debian-stretch.net-snmp/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.24/CORE -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I/usr/include -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"5.0703\" -DXS_VERSION=\"5.0703\" -fPIC "-I/opt/perl5/perls/perl-5.32.0/lib/5.32.0/x86_64-linux-thread-multi/CORE"   TrapReceiver.c
rm -f blib/arch/auto/NetSNMP/TrapReceiver/TrapReceiver.so
LD_RUN_PATH="/usr/lib/x86_64-linux-gnu" cc  -shared -O2 -L/usr/local/lib -fstack-protector-strong -Wl,-z,relro -Wl,-z,now  TrapReceiver.o  -o blib/arch/auto/NetSNMP/TrapReceiver/TrapReceiver.so  \
   -L/usr/lib/x86_64-linux-gnu -lnetsnmptrapd -lnetsnmpmibs -lnetsnmpagent -lnetsnmp   \

chmod 755 blib/arch/auto/NetSNMP/TrapReceiver/TrapReceiver.so
# ldd blib/arch/auto/NetSNMP/TrapReceiver/TrapReceiver.so
        linux-vdso.so.1 (0x00007ffcd87db000)
        libnetsnmptrapd.so.30 => /usr/lib/x86_64-linux-gnu/libnetsnmptrapd.so.30 (0x00007fe95f12b000)
        libnetsnmpmibs.so.30 => /usr/lib/x86_64-linux-gnu/libnetsnmpmibs.so.30 (0x00007fe95eca1000)
        libnetsnmpagent.so.30 => /usr/lib/x86_64-linux-gnu/libnetsnmpagent.so.30 (0x00007fe95ea34000)
        libnetsnmp.so.30 => /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 (0x00007fe95e752000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe95e3b3000)
        libperl.so.5.24 => /usr/lib/x86_64-linux-gnu/libperl.so.5.24 (0x00007fe95dfbf000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe95ddbb000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe95dab7000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe95d89a000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fe95d662000)
        libsensors.so.4 => /usr/lib/x86_64-linux-gnu/libsensors.so.4 (0x00007fe95d453000)
        libpci.so.3 => /lib/x86_64-linux-gnu/libpci.so.3 (0x00007fe95d245000)
        libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007fe95d03b000)
        libcrypto.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 (0x00007fe95cbd4000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe95f53e000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe95c9ba000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fe95c7a3000)
        libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007fe95f732000)
        libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fe95c58b000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe95c383000)