Skip Menu |

This queue is for tickets about the ExtUtils-HasCompiler CPAN distribution.

Report information
The Basics
Id: 113635
Status: resolved
Priority: 0/
Queue: ExtUtils-HasCompiler

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.013



Subject: Fails tests on perls which *can* build XS
Attaching a full session log, let me know if you need something extra.
Subject: euhc_argh.txt
rabbit@Ahasver:~$ cpanm --look ExtUtils::HasCompiler --> Working on ExtUtils::HasCompiler Fetching http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-HasCompiler-0.012.tar.gz ... OK Entering /home/rabbit/.cpanm/work/1460256150.28104/ExtUtils-HasCompiler-0.012 with /bin/bash rabbit@Ahasver:~/.cpanm/work/1460256150.28104/ExtUtils-HasCompiler-0.012$ perlbrew use 5.10.0 rabbit@Ahasver:~/.cpanm/work/1460256150.28104/ExtUtils-HasCompiler-0.012$ perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.37-2-amd64, archname=x86_64-linux-thread-multi uname='linux ahasver 2.6.37-2-amd64 #1 smp sun feb 27 10:12:22 utc 2011 x86_64 gnulinux ' config_args='-de -Dprefix=/home/rabbit/perl5/perlbrew/perls/5.10.0 -Dusethreads' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.4.5', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /lib64 /usr/lib64 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.11.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Aug 23 2011 06:06:48 %ENV: PERLBREW_BASHRC_VERSION="0.67" PERLBREW_HOME="/home/rabbit/.perlbrew" PERLBREW_MANPATH="/home/rabbit/perl5/perlbrew/perls/5.10.0/man" PERLBREW_PATH="/home/rabbit/perl5/perlbrew/bin:/home/rabbit/perl5/perlbrew/perls/5.10.0/bin" PERLBREW_PERL="5.10.0" PERLBREW_ROOT="/home/rabbit/perl5/perlbrew" PERLBREW_VERSION="0.67" PERL_AUTOINSTALL_PREFER_CPAN="1" @INC: /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/5.10.0/x86_64-linux-thread-multi /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/5.10.0 /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/site_perl/5.10.0/x86_64-linux-thread-multi /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/site_perl/5.10.0 . rabbit@Ahasver:~/.cpanm/work/1460256150.28104/ExtUtils-HasCompiler-0.012$ perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for ExtUtils::HasCompiler Writing MYMETA.yml and MYMETA.json rabbit@Ahasver:~/.cpanm/work/1460256150.28104/ExtUtils-HasCompiler-0.012$ make test cp lib/ExtUtils/HasCompiler.pm blib/lib/ExtUtils/HasCompiler.pm PERL_DL_NONLAZY=1 /home/rabbit/perl5/perlbrew/perls/5.10.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/compare.t .. /usr/bin/ld: cannot find -lgdbm_compat collect2: error: ld returned 1 exit status t/compare.t .. 1/1 # Failed test 'Have a C compiler if CBuilder agrees' # at t/compare.t line 13. # got: undef # expected: '1' # Couldn't execute cc -O2 /tmp/F6fhfMILE0/Fgf0phr0Ys.o -o /tmp/F6fhfMILE0/Fgf0phr0Ys.so -shared -O2 -L/usr/local/lib -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat: Inappropriate ioctl for device at t/compare.t line 13. # Looks like you failed 1 test of 1. t/compare.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests Test Summary Report ------------------- t/compare.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=1, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.27 cusr 0.05 csys = 0.34 CPU) Result: FAIL Failed 1/1 test programs. 1/1 subtests failed. Makefile:851: recipe for target 'test_dynamic' failed make: *** [test_dynamic] Error 1 rabbit@Ahasver:~/.cpanm/work/1460256150.28104/ExtUtils-HasCompiler-0.012$ cpanm -v --reinstall Devel::GlobalDestruction::XS cpanm (App::cpanminus) 1.7039 on perl 5.010000 built for x86_64-linux-thread-multi Work directory is /home/rabbit/.cpanm/work/1460256291.28595 You have make /usr/bin/make You have LWP 6.05 You have /bin/tar: tar (GNU tar) 1.27.1 Copyright (C) 2013 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 Devel::GlobalDestruction::XS () on cpanmetadb ... --> Working on Devel::GlobalDestruction::XS Fetching http://www.cpan.org/authors/id/H/HA/HAARG/Devel-GlobalDestruction-XS-0.02.tar.gz ... OK Unpacking Devel-GlobalDestruction-XS-0.02.tar.gz Devel-GlobalDestruction-XS-0.02/ Devel-GlobalDestruction-XS-0.02/Changes Devel-GlobalDestruction-XS-0.02/lib/ Devel-GlobalDestruction-XS-0.02/maint/ Devel-GlobalDestruction-XS-0.02/Makefile.PL Devel-GlobalDestruction-XS-0.02/MANIFEST Devel-GlobalDestruction-XS-0.02/META.json Devel-GlobalDestruction-XS-0.02/META.yml Devel-GlobalDestruction-XS-0.02/ppport.h Devel-GlobalDestruction-XS-0.02/README Devel-GlobalDestruction-XS-0.02/t/ Devel-GlobalDestruction-XS-0.02/XS.xs Devel-GlobalDestruction-XS-0.02/xt/ Devel-GlobalDestruction-XS-0.02/xt/pod.t Devel-GlobalDestruction-XS-0.02/t/01_basic.t Devel-GlobalDestruction-XS-0.02/t/02_thread.t Devel-GlobalDestruction-XS-0.02/t/03_minusc.t Devel-GlobalDestruction-XS-0.02/t/04_phases.t Devel-GlobalDestruction-XS-0.02/t/05_thread_clone.t Devel-GlobalDestruction-XS-0.02/maint/Makefile.PL.include Devel-GlobalDestruction-XS-0.02/lib/Devel/ Devel-GlobalDestruction-XS-0.02/lib/Devel/GlobalDestruction/ Devel-GlobalDestruction-XS-0.02/lib/Devel/GlobalDestruction/XS.pm Entering Devel-GlobalDestruction-XS-0.02 Checking configure dependencies from META.json Running Makefile.PL Configuring Devel-GlobalDestruction-XS-0.02 ... Checking if your kit is complete... Looks good Writing Makefile for Devel::GlobalDestruction::XS Writing MYMETA.yml and MYMETA.json OK Checking dependencies from MYMETA.json ... Building and testing Devel-GlobalDestruction-XS-0.02 ... cp lib/Devel/GlobalDestruction/XS.pm blib/lib/Devel/GlobalDestruction/XS.pm /home/rabbit/perl5/perlbrew/perls/5.10.0/bin/perl /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/5.10.0/ExtUtils/xsubpp -typemap /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/5.10.0/ExtUtils/typemap XS.xs > XS.xsc && mv XS.xsc XS.c cc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.02\" -DXS_VERSION=\"0.02\" -fPIC "-I/home/rabbit/perl5/perlbrew/perls/5.10.0/lib/5.10.0/x86_64-linux-thread-multi/CORE" XS.c Running Mkbootstrap for Devel::GlobalDestruction::XS () chmod 644 XS.bs rm -f blib/arch/auto/Devel/GlobalDestruction/XS/XS.so cc -shared -O2 -L/usr/local/lib XS.o -o blib/arch/auto/Devel/GlobalDestruction/XS/XS.so \ \ chmod 755 blib/arch/auto/Devel/GlobalDestruction/XS/XS.so cp XS.bs blib/arch/auto/Devel/GlobalDestruction/XS/XS.bs chmod 644 blib/arch/auto/Devel/GlobalDestruction/XS/XS.bs Manifying blib/man3/Devel::GlobalDestruction::XS.3 PERL_DL_NONLAZY=1 /home/rabbit/perl5/perlbrew/perls/5.10.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01_basic.t ......... ok t/02_thread.t ........ ok t/03_minusc.t ........ 1/3 t/03_minusc.t syntax OK t/03_minusc.t ........ ok t/04_phases.t ........ ok t/05_thread_clone.t .. ok All tests successful. Files=5, Tests=33, 0 wallclock secs ( 0.04 usr 0.01 sys + 0.06 cusr 0.00 csys = 0.11 CPU) Result: PASS Files found in blib/arch: installing files in blib/lib into architecture dependent library tree Installing /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/site_perl/5.10.0/x86_64-linux-thread-multi/auto/Devel/GlobalDestruction/XS/XS.so Installing /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/site_perl/5.10.0/x86_64-linux-thread-multi/Devel/GlobalDestruction/XS.pm Installing /home/rabbit/perl5/perlbrew/perls/5.10.0/man/man3/Devel::GlobalDestruction::XS.3 Appending installation info to /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/5.10.0/x86_64-linux-thread-multi/perllocal.pod OK Successfully installed Devel-GlobalDestruction-XS-0.02 (upgraded from 0.01) Installing /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/site_perl/5.10.0/x86_64-linux-thread-multi/.meta/Devel-GlobalDestruction-XS-0.02/install.json Installing /home/rabbit/perl5/perlbrew/perls/5.10.0/lib/site_perl/5.10.0/x86_64-linux-thread-multi/.meta/Devel-GlobalDestruction-XS-0.02/MYMETA.json 1 distribution installed
I haven't been able to reproduce this on the systems I have available. What type of system have you seen this on?
On Sun Apr 10 10:43:29 2016, haarg wrote: Show quoted text
> I haven't been able to reproduce this on the systems I have available. > What type of system have you seen this on?
This is my day-to-day working box, from which I am writing this reply. Think "perlbrew from ages ago, with the underlying OS moving ahead underneath it". Investigated a bit more on a hunch: I had a libgdbm-dev at the time perl was built, but not anymore. Attached is a new (smaller) session log showcasing the problem. Note - while I recognize the "wtf" moment in the entire thing, keep in mind that I didn't do anything special to arrive at this "broken system": it's just how it came to be in the ~4 years since it was first installed. In other words - this is not an outlandish scenario. As a bonus point EU::CB does not get tripped by this
Subject: euhc_argh2.txt
rabbit@Ahasver:~$ cpanm --look ExtUtils::HasCompiler --> Working on ExtUtils::HasCompiler Fetching http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-HasCompiler-0.012.tar.gz ... OK Entering /home/rabbit/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012 with /bin/bash rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ perlbrew use 5.10.0 rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ sudo apt-get install libgdbm-dev Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: libgdbm-dev 0 upgraded, 1 newly installed, 0 to remove and 197 not upgraded. Need to get 48.8 kB of archives. After this operation, 167 kB of additional disk space will be used. Get:1 http://ftp.us.debian.org/debian/ sid/main libgdbm-dev amd64 1.8.3-13.1 [48.8 kB] Fetched 48.8 kB in 0s (54.1 kB/s) Selecting previously unselected package libgdbm-dev. (Reading database ... 114997 files and directories currently installed.) Preparing to unpack .../libgdbm-dev_1.8.3-13.1_amd64.deb ... Unpacking libgdbm-dev (1.8.3-13.1) ... Processing triggers for man-db (2.7.0.2-5) ... Processing triggers for install-info (5.2.0.dfsg.1-6) ... Setting up libgdbm-dev (1.8.3-13.1) ... rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ perl Makefile.PL Writing Makefile for ExtUtils::HasCompiler Writing MYMETA.yml and MYMETA.json rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ make test PERL_DL_NONLAZY=1 /home/rabbit/perl5/perlbrew/perls/5.16.2/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/compare.t .. ok All tests successful. Files=1, Tests=1, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.32 cusr 0.09 csys = 0.44 CPU) Result: PASS rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ sudo apt-get remove --purge libgdbm-dev Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: libgdbm-dev* 0 upgraded, 0 newly installed, 1 to remove and 197 not upgraded. After this operation, 167 kB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 115046 files and directories currently installed.) Removing libgdbm-dev (1.8.3-13.1) ... Processing triggers for man-db (2.7.0.2-5) ... Processing triggers for install-info (5.2.0.dfsg.1-6) ... rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ make test PERL_DL_NONLAZY=1 /home/rabbit/perl5/perlbrew/perls/5.16.2/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/compare.t .. ok All tests successful. Files=1, Tests=1, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.38 cusr 0.06 csys = 0.47 CPU) Result: PASS rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ perl Makefile.PL Writing Makefile for ExtUtils::HasCompiler Writing MYMETA.yml and MYMETA.json rabbit@Ahasver:~/.cpanm/work/1460279136.12370/ExtUtils-HasCompiler-0.012$ make test Skip blib/lib/ExtUtils/HasCompiler.pm (unchanged) PERL_DL_NONLAZY=1 /home/rabbit/perl5/perlbrew/perls/5.10.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/compare.t .. /usr/bin/ld: cannot find -lgdbm_compat collect2: error: ld returned 1 exit status t/compare.t .. 1/1 # Failed test 'Have a C compiler if CBuilder agrees' # at t/compare.t line 13. # got: undef # expected: '1' # Couldn't execute cc -O2 /tmp/BvdmvpOadT/XVVPN7vSw7.o -o /tmp/BvdmvpOadT/XVVPN7vSw7.so -shared -O2 -L/usr/local/lib -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat: Inappropriate ioctl for device at t/compare.t line 13. # Looks like you failed 1 test of 1. t/compare.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests Test Summary Report ------------------- t/compare.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=1, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.26 cusr 0.04 csys = 0.33 CPU) Result: FAIL Failed 1/1 test programs. 1/1 subtests failed. Makefile:851: recipe for target 'test_dynamic' failed make: *** [test_dynamic] Error 1

Its worth mentioning that this sort of issue can happen every day on Gentoo.

It doesn't happen too frequently, but we see it in a few places.

1. End users are building their system perl with system dependencies

2. We try to manage things, but Perl has an "automatically link new things even if they're not needed" mechanic, which means in the event a user has a dependency, even though we didn't configure it to build with that dependency, Perl did anyway.

3. During linking, --as-needed removed the actual dependency from Perl itself, so perl itself doesn't link against the library, however, the library persists in %Config

4. Due to no referential integrity keeping the automatically depended library in the dependency graph, said library can be uninstalled by the package manager.

5. And then there are subsequent failures every time somebody tries to compile a thing using data in %Config that is now "Stale", as link time has no way to know that the arguments specified from %Config can be assumed un-needed without actually attempting to link them.

This looks a *lot* like that sort of pattern.

And as a general rule, "Inherit arbitrary things from %Config" may be what CPAN wants, but it is not what Gentoo wants ( or at least, our users want a more fine-detail level of configurability ), for this reason, and a few more.

Unlike CPAN, Gentoo has the ability to define a collection of "global" choices, and those "global" choices are used when building Perl itself.

Then, when building Perl modules, the expected/desired behaviour is to consume the /current/ state of those "global" choices at build time of the individual package ( which, subject to needs, the user could have adjusted those global choices in a nuanced way relative to the specific package, eg: more aggressive optimisations, more detailed debugging symbols )

In contrast, Perl expects you to set all your compile flags when you build perl, and typically, if you wanted something different after that point you're kinda on your own.

We've had it on our table to make this an option at our disposal, and we currently do have hacks in place to make this sort of behaviour available for specific requested packages, but we do need a more general solution to that problem, and "not doing the wrong thing" by default at the Perl toolchain level is the most logical place to address that.

Subject: Re: [rt.cpan.org #113635] AutoReply: Fails tests on perls which *can* build XS
Date: Sun, 10 Apr 2016 13:41:40 +0200
To: bug-ExtUtils-HasCompiler [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
An extra train of thoughts from elsewhere: <ribasushi> it's the catch-22 of EU::HC - it is only useful on stuff that is XS-optional, so you are virtually never going to hear about "false negatives" <ribasushi> people shrug and move on fixing the actual errors they encountered with other shit in their stack <ribasushi> and bundling ensures the test of "compare to EU::CB" is never executed :/ <ribasushi> hmmm... I am wondering if this needs to be always checked at runtime and be fatal by default: if( !<some shortcircuit envvar> and time() < "something end-of-2017ish" # to auto-shutoff the check in bundles and !can_compile_loadable_object() and <has suitable EUCB (0.26 IIRC)> and ExtUtils::CBuilder->new->have_compiler ) { die "EUCB and EUHC disagree: you may have stumbled into an EUHC bug! please file a bug at ..., set <such and such var> if you are in a pinch " }
Closing the ticket as the main issue (the bundling exhiiting a false-negative) is now resolved. Secondary issue worked on in https://rt.cpan.org/Ticket/Display.html?id=113686.