Leont / extutils-hascompiler

Check for the presence of a compiler
5 stars 3 forks source link

Testing fails for useshrplib=true #14

Closed mtelka closed 5 months ago

mtelka commented 5 months ago

If we are testing with Perl compiled with useshrplib=true then the testing fails:

#   Failed test 'MakeMaker agrees we can't compile static'
#   at t/compare.t line 67.
#          got: undef
#     expected: '1'
# Looks like you failed 1 test of 3.
t/compare.t .....
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests

The undef came from this piece of code in lib/ExtUtils/HasCompiler.pm:

sub can_compile_static_library {
        my %args = @_;

        my $output = $args{output} || \*STDOUT;

        my $config = $args{config} || 'ExtUtils::HasCompiler::Config';
        return if $config->get('useshrplib') eq 'true';
Leont commented 5 months ago

I can't reproduce that on a useshrplib perl. Can you paste the whole output of t/compare.t?

mtelka commented 5 months ago
$ perl t/compare.t
1..3
# undef
# Generating a Unix-style Makefile
# Writing Makefile for EUHC::Test
# Writing MYMETA.yml and MYMETA.json
# cp lib/EUHC/Test.pm blib/lib/EUHC/Test.pm
# "/usr/perl5/5.38/bin/perl" "/usr/perl5/5.38/lib/ExtUtils/xsubpp"  -typemap '/usr/perl5/5.38/lib/ExtUtils/typemap'  Test.xs > Test.xsc
# mv Test.xsc Test.c
# /usr/gcc/13/bin/gcc -m64 -c   -D_REENTRANT -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O3   -DVERSION=\"\" -DXS_VERSION=\"\" -fPIC "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE"   Test.c
# rm -f "blib/arch/auto/EUHC/Test/Test.a"
# /usr/bin/amd64/ar cr "blib/arch/auto/EUHC/Test/Test.a" Test.o
# : "blib/arch/auto/EUHC/Test/Test.a"
# chmod 755 blib/arch/auto/EUHC/Test/Test.a
# Writing "Makefile.aperl" for this perl
# Generating a Unix-style Makefile.aperl
# Writing Makefile.aperl for EUHC::Test
# Writing MYMETA.yml and MYMETA.json
# make -f Makefile.aperl perl
# make[1]: Entering directory '/tmp/vWij7t6aVX'
# Writing perlmain.c
# mv perlmain.ct perlmain.c
# /usr/gcc/13/bin/gcc -m64 -c   -D_REENTRANT -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O3   -DVERSION=\"\" -DXS_VERSION=\"\" -fPIC "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE"   perlmain.c
# /usr/gcc/13/bin/gcc -m64 -c   -D_REENTRANT -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O3   -DVERSION=\"\" -DXS_VERSION=\"\" -fPIC "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE"   Test.c
# rm -f "blib/arch/auto/EUHC/Test/Test.a"
# /usr/bin/amd64/ar cr "blib/arch/auto/EUHC/Test/Test.a" Test.o
# : "blib/arch/auto/EUHC/Test/Test.a"
# chmod 755 blib/arch/auto/EUHC/Test/Test.a
# cat blib/arch/auto/EUHC/Test/extralibs.ld >> blib/arch/auto/EUHC/Test/extralibs.all
# /usr/gcc/13/bin/gcc -m64 -fstack-protector-strong -m64 -R /usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE Test.o -O3 ./perlmain.o -o perl "blib/arch/auto/EUHC/Test/Test.a" "/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE/libperl.so" `cat blib/arch/auto/EUHC/Test/extralibs.all` -lpthread -lsocket -lnsl -ldl -lm -lc
# To install the new 'perl' binary, call
#     make -f Makefile.aperl inst_perl MAP_TARGET=perl
#     make -f Makefile.aperl map_clean
# make[1]: Leaving directory '/tmp/vWij7t6aVX'
# PERL_DL_NONLAZY=1 "/tmp/vWij7t6aVX/perl" "-Iblib/arch" "-Iblib/lib" "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64" "-I/usr/perl5/5.38/lib" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# t/compiled.t .. ok
# All tests successful.
# Files=1, Tests=1,  1 wallclock secs ( 0.04 usr  0.02 sys +  0.09 cusr  0.04 csys =  0.20 CPU)
# Result: PASS
not ok 1 - MakeMaker agrees we can't compile static
#   Failed test 'MakeMaker agrees we can't compile static'
#   at t/compare.t line 67.
#          got: undef
#     expected: '1'
# /usr/gcc/13/bin/gcc -m64 -D_REENTRANT -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O3 "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE" -fPIC -c /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST7JHp.c -o /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST7JHp.o
# /usr/gcc/13/bin/gcc -m64 /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST7JHp.o -o /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST7JHp.so  -shared -m64 -fstack-protector-strong
# Generating a Unix-style Makefile
# Writing Makefile for EUHC::Test
# Writing MYMETA.yml and MYMETA.json
# cp lib/EUHC/Test.pm blib/lib/EUHC/Test.pm
# Running Mkbootstrap for Test ()
# chmod 644 "Test.bs"
# "/usr/perl5/5.38/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Test.bs blib/arch/auto/EUHC/Test/Test.bs 644
# "/usr/perl5/5.38/bin/perl" "/usr/perl5/5.38/lib/ExtUtils/xsubpp"  -typemap '/usr/perl5/5.38/lib/ExtUtils/typemap'  Test.xs > Test.xsc
# mv Test.xsc Test.c
# /usr/gcc/13/bin/gcc -m64 -c   -D_REENTRANT -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O3   -DVERSION=\"\" -DXS_VERSION=\"\" -fPIC "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE"   Test.c
# rm -f blib/arch/auto/EUHC/Test/Test.so
# /usr/gcc/13/bin/gcc -m64  -shared -m64 -fstack-protector-strong  Test.o  -o blib/arch/auto/EUHC/Test/Test.so  \
#       \
#
# chmod 755 blib/arch/auto/EUHC/Test/Test.so
# "/usr/perl5/5.38/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Test.bs blib/arch/auto/EUHC/Test/Test.bs 644
# PERL_DL_NONLAZY=1 "/usr/perl5/5.38/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# t/compiled.t .. ok
# All tests successful.
# Files=1, Tests=1,  1 wallclock secs ( 0.03 usr  0.02 sys +  0.10 cusr  0.06 csys =  0.20 CPU)
# Result: PASS
ok 2 - MakeMaker agrees we can compile dynamic
# /usr/gcc/13/bin/gcc -m64 -D_REENTRANT -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O3 "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE" -fPIC -c /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST0WE2.c -o /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST0WE2.o
# /usr/gcc/13/bin/gcc -m64 /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST0WE2.o -o /data/builds/ul-workspace/components/perl/ExtUtils-HasCompiler/ExtUtils-HasCompiler-0.024/HASCOMPILER5ftT/TEST0WE2.so  -shared -m64 -fstack-protector-strong
# Generating a Unix-style Makefile
# Writing Makefile for EUHC::Test
# Writing MYMETA.yml and MYMETA.json
# cp lib/EUHC/Test.pm blib/lib/EUHC/Test.pm
# Running Mkbootstrap for Test ()
# chmod 644 "Test.bs"
# "/usr/perl5/5.38/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Test.bs blib/arch/auto/EUHC/Test/Test.bs 644
# "/usr/perl5/5.38/bin/perl" "/usr/perl5/5.38/lib/ExtUtils/xsubpp"  -typemap '/usr/perl5/5.38/lib/ExtUtils/typemap'  Test.xs > Test.xsc
# mv Test.xsc Test.c
# /usr/gcc/13/bin/gcc -m64 -c   -D_REENTRANT -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O3   -DVERSION=\"\" -DXS_VERSION=\"\" -fPIC "-I/usr/perl5/5.38/lib/i86pc-solaris-thread-multi-64/CORE"   Test.c
# rm -f blib/arch/auto/EUHC/Test/Test.so
# /usr/gcc/13/bin/gcc -m64  -shared -m64 -fstack-protector-strong  Test.o  -o blib/arch/auto/EUHC/Test/Test.so  \
#       \
#
# chmod 755 blib/arch/auto/EUHC/Test/Test.so
# "/usr/perl5/5.38/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Test.bs blib/arch/auto/EUHC/Test/Test.bs 644
# PERL_DL_NONLAZY=1 "/usr/perl5/5.38/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# t/compiled.t .. ok
# All tests successful.
# Files=1, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.09 cusr  0.04 csys =  0.17 CPU)
# Result: PASS
ok 3 - MakeMaker agrees we can compile default
# Looks like you failed 1 test of 3.
$
Leont commented 5 months ago

Should be resolved in the latest version