Skip Menu |

This queue is for tickets about the Devel-Cover-Report-Clover CPAN distribution.

Report information
The Basics
Id: 75376
Status: resolved
Priority: 0/
Queue: Devel-Cover-Report-Clover

People
Owner: Nobody in particular
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.34
Fixed in: (no value)



Subject: Most tests fail on Ubuntu
Release 0.31 was working fine on Ubuntu. The testsuite in release 0.34 is completely broken: almost all test fail with error "Can't open perl script "cover": no such file or directory" -- Olivier Mengué - http://perlresume.org/DOLMEN
Le 2012-02-28 17:50:12, DOLMEN a écrit : Show quoted text
> Release 0.31 was working fine on Ubuntu. > The testsuite in release 0.34 is completely broken: almost all test fail > with error "Can't open perl script "cover": no such file or directory"
The problem may be in t/testcover.pm, in sub p_which: it does bad assumption about the installation directory of Devel::Cover. I'm using a local::lib-based install so my cover script is not in one of the @Config{qw/installscript installsitebin installvendorbin installbin/} directories. $ENV{PATH} is what matters. -- Olivier Mengué - http://perlresume.org/DOLMEN
Thank you. I will try and reproduce it and create a patch unless you are working on one already. On Tue Feb 28 12:05:12 2012, DOLMEN wrote: Show quoted text
> Le 2012-02-28 17:50:12, DOLMEN a écrit :
> > Release 0.31 was working fine on Ubuntu. > > The testsuite in release 0.34 is completely broken: almost all test fail > > with error "Can't open perl script "cover": no such file or directory"
> > The problem may be in t/testcover.pm, in sub p_which: it does bad > assumption about the installation directory of Devel::Cover. I'm using a > local::lib-based install so my cover script is not in one of the > @Config{qw/installscript installsitebin installvendorbin installbin/} > directories. > $ENV{PATH} is what matters.
I attempted to reproduce it as follows but it did not work mkdir ~/mybin sudo mv `which cover` ~/mybin export PATH=$PATH:$HOME/mybin perl Build.PL ./Build test all tests passed meaning the PATH seems to be honored. You'll notice that the over_cmd() function in that file defaults to 'cover' (no path specified) so it *should* be using the PATH. Can you dump your \%ENV hash, say from within the testcover::run method. Here is what mine looks like. $VAR1 = { 'Apple_PubSub_Socket_Render' => '/tmp/launch-O04rlE/Render', 'Apple_Ubiquity_Message' => '/tmp/launch-f9egZR/Apple_Ubiquity_Message', 'CLICOLOR' => '1', 'COMMAND_MODE' => 'unix2003', 'DISPLAY' => '/tmp/launch-THEwGn/org.x:0', 'EDITOR' => 'vim', 'GIT_EDITOR' => 'vim', 'HARNESS_ACTIVE' => 1, 'HARNESS_IS_VERBOSE' => '1', 'HARNESS_VERBOSE' => '1', 'HARNESS_VERSION' => '3.23', 'HOME' => '/Users/dbartle', 'LANG' => 'en_US.UTF-8', 'LESSCHARSET' => 'utf-8', 'LOCALE' => 'UTF-8', 'LOGNAME' => 'dbartle', 'OLDPWD' => '/Users/dbartle/Documents/devel-cover-report-clover/t', 'PATH' => '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/dbartle/mybin', 'PERL5LIB' => '/Users/dbartle/Documents/devel-cover-report- clover/blib/lib:/Users/dbartle/Documents/devel-cover-report-clover/blib/arch', 'PERL_DL_NONLAZY' => '1', 'PWD' => '/Users/dbartle/Documents/devel-cover-report-clover', 'SHELL' => '/bin/bash', 'SHLVL' => '1', 'SSH_AUTH_SOCK' => '/tmp/launch-2KeR88/Listeners', 'TAP_VERSION' => '13', 'TERM' => 'xterm-256color', 'TERM_PROGRAM' => 'Apple_Terminal', 'TERM_PROGRAM_VERSION' => '303', 'TERM_SESSION_ID' => '4E9BBF1D-431A-4B9C-A2AF-CB8E4077F8E9', 'TEST_VERBOSE' => '1', 'TMPDIR' => '/var/folders/2l/s_xv_4qd4hn8rpfdcy79bv9w0000gq/T/', 'USER' => 'dbartle', 'VERSIONER_PERL_PREFER_32_BIT' => 'no', 'VERSIONER_PERL_VERSION' => '5.12', '_' => './Build', '__CF_USER_TEXT_ENCODING' => '0x1F7:0:0' }; On Tue Feb 28 12:10:21 2012, DBARTLE wrote: Show quoted text
> Thank you. I will try and reproduce it and create a patch unless you > are working on one > already. > > On Tue Feb 28 12:05:12 2012, DOLMEN wrote:
> > Le 2012-02-28 17:50:12, DOLMEN a écrit :
> > > Release 0.31 was working fine on Ubuntu. > > > The testsuite in release 0.34 is completely broken: almost all
> test fail
> > > with error "Can't open perl script "cover": no such file or
> directory"
> > > > The problem may be in t/testcover.pm, in sub p_which: it does bad > > assumption about the installation directory of Devel::Cover. I'm
> using a
> > local::lib-based install so my cover script is not in one of the > > @Config{qw/installscript installsitebin installvendorbin
> installbin/}
> > directories. > > $ENV{PATH} is what matters.
> >
I killed off my install of Devel::Cover and installed Devel::Cover under local lib. Then I ran this: eval $(perl -Mlocal::lib) The tests seemed to work at that point for me. I took a look at the File::Which stuff at one point in an early early release IIRC but tests failed about 75% of the time in CPANTS due to some really strange things like $ENV{PATH} being set to '' in many environments. I'll have to explore this further. On Tue Feb 28 12:05:12 2012, DOLMEN wrote: Show quoted text
> Le 2012-02-28 17:50:12, DOLMEN a écrit :
> > Release 0.31 was working fine on Ubuntu. > > The testsuite in release 0.34 is completely broken: almost all test fail > > with error "Can't open perl script "cover": no such file or directory"
> > The problem may be in t/testcover.pm, in sub p_which: it does bad > assumption about the installation directory of Devel::Cover. I'm using a > local::lib-based install so my cover script is not in one of the > @Config{qw/installscript installsitebin installvendorbin installbin/} > directories. > $ENV{PATH} is what matters.
Le 2012-02-28 18:18:55, DBARTLE a écrit : Show quoted text
> I attempted to reproduce it as follows but it did not work > > mkdir ~/mybin > sudo mv `which cover` ~/mybin > export PATH=$PATH:$HOME/mybin > perl Build.PL > ./Build test > > all tests passed meaning the PATH seems to be honored.
With this test, the 'cover' script used is still one of your perl $Config paths, not $HOME/mybin/cover. Show quoted text
> You'll notice that the over_cmd() function in that file defaults to > 'cover' (no path specified) so it > *should* be using the PATH.
No, "/usr/bin/perl cover" is not using the $PATH. Also I noticed that $Devel::Cover::Inc::Base is wrong: it indicates the temporary build directory at the time I installed Devel::Cover, and that doesn't exists anymore. Anyway, patch submitted: https://github.com/captin411/devel-cover-report-clover/pull/2 -- Olivier Mengué - http://perlresume.org/DOLMEN
Le 2012-02-28 19:14:31, DOLMEN a écrit : Show quoted text
> Le 2012-02-28 18:18:55, DBARTLE a écrit :
> > I attempted to reproduce it as follows but it did not work > > > > mkdir ~/mybin > > sudo mv `which cover` ~/mybin > > export PATH=$PATH:$HOME/mybin > > perl Build.PL > > ./Build test > > > > all tests passed meaning the PATH seems to be honored.
> > With this test, the 'cover' script used is still one of your perl > $Config paths, not $HOME/mybin/cover.
I'm probably wrong on this. Did you check that the 'cover' used is not the one from $Devel::Cover::Inc::Base ? -- Olivier Mengué - http://perlresume.org/DOLMEN
Can you post a dump of ENV at the beginning of testcover::run()? and also what your ENV looks like before you run ./Build. I want to try and replicate what is happening and also still let the automated testing sandboxes to be able to work as well so that it works in all cases. The problems on the sandboxed testing systems arise in two situations 1) Devel::Cover is installed both in a system path AND in a .cpanplus folder in the sandbox In this case, the wrong 'cover' command can be found based on a disconnect between the order of precedence in the PATH vs the order of precedence in the PERL5LIB env. 2) Devel::Cover is installed ONLY in the ~/.cpanplus folder (somewhere) and the PATH does not include a path which would let the OS find the 'cover' command Here is an example abbreviated environment line which caused problems. Note that Devel::Cover was installed in the .cpanplus folder in this case and it was not installed system wide. The 'cover' command did not exist anywhere in the EVN{PATH}... rather it was basically in $some_build_folder/cover (which is why $Devel::Cover::Inc::Base/cover is also checked). PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin PERL5LIB = :[...]/Volumes/Media/smoke/bare/conf/perl-5.14.1/.cpanplus/5.14.1/build/Devel- Cover-0.79/blib:[...]/Volumes/Media/smoke/bare/conf/perl- 5.14.1/.cpanplus/5.14.1/build/Devel-Cover-Report-Clover-0.26/blib/lib:[...] On Tue Feb 28 13:21:39 2012, DOLMEN wrote: Show quoted text
> Le 2012-02-28 19:14:31, DOLMEN a écrit :
> > Le 2012-02-28 18:18:55, DBARTLE a écrit :
> > > I attempted to reproduce it as follows but it did not work > > > > > > mkdir ~/mybin > > > sudo mv `which cover` ~/mybin > > > export PATH=$PATH:$HOME/mybin > > > perl Build.PL > > > ./Build test > > > > > > all tests passed meaning the PATH seems to be honored.
> > > > With this test, the 'cover' script used is still one of your perl > > $Config paths, not $HOME/mybin/cover.
> > I'm probably wrong on this. > Did you check that the 'cover' used is not the one from > $Devel::Cover::Inc::Base ?
Le 2012-02-28 20:07:58, DBARTLE a écrit : Show quoted text
> Can you post a dump of ENV at the beginning of testcover::run()? and > also what your ENV looks > like before you run ./Build. I want to try and replicate what is > happening and also still let the > automated testing sandboxes to be able to work as well so that it > works in all cases.
I have added the following lines at the beginning of testcover::run: foreach my $e ('PATH', sort grep(/^PERL/, keys %ENV) ) { Test::More::diag("$e=$ENV{$e}"); } Test::More::diag("Devel::Cover::Inc::Base=$Devel::Cover::Inc::Base"); Test::More::diag('Devel::Cover::Inc::Inc='.join(':', @Devel::Cover::Inc::Inc)); Here is the output of "LANG=C perl -Ilib t/basic.t": ----------8<----------8<----------8<----------8<----------8<---------- # PATH=/home/omengue/bin:/home/omengue/.perl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games # PERL5LIB=/home/omengue/.perl/lib/perl5/x86_64-linux-gnu-thread-multi:/home/omengue/.perl/lib/perl5 # PERLBREW_ROOT=/home/omengue/.perl/perlbrew # PERL_CPANM_OPT=-l /home/omengue/.perl --mirror http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/ # PERL_LOCAL_LIB_ROOT=/home/omengue/.perl # PERL_MB_OPT=--install_base /home/omengue/.perl # PERL_MM_OPT=INSTALL_BASE=/home/omengue/.perl # Devel::Cover::Inc::Base=/home/omengue/.local/share/.cpan/build/Devel-Cover-0.79-KikcpK # Devel::Cover::Inc::Inc=.:/etc/perl:/home/omengue/.perl/lib/perl5:/home/omengue/.perl/lib/perl5/x86_64-linux-gnu-thread-multi:/tmp/CPAN-Reporter-lib-qS3j:/usr/lib/perl/5.10.1:/usr/lib/perl5:/usr/share/perl/5.10.1:/usr/share/perl5 Can't open perl script "cover": No such file or directory system('/usr/bin/perl','cover','/home/omengue/tmp/p5-Devel-Cover-Report-Clover/t/../cover_db_test/multi_file/cover_db') failed: 512 ----------8<----------8<----------8<----------8<----------8<---------- Show quoted text
> The problems on the sandboxed testing systems arise in two situations > > 1) Devel::Cover is installed both in a system path AND in a .cpanplus > folder in the sandbox
I would not call a module in the ".cpanplus" folder to be "installed". Show quoted text
> In this case, the wrong 'cover' command can be found based on a > disconnect between the order > of precedence in the PATH vs the order of precedence in the PERL5LIB > env.
Trying to reliably call a script from a Perl distribution is impossible if you can not trust the environment. If the 'cover' script found $ENV{PATH} does not match the Devel::Cover in @INC, that is a problem either with the original user environment or a bug in the CPAN client that does not modifies PATH to match what it does with PERL5LIB. The only right workaround would be to avoid using the 'cover' script at all. But I understand that replicating its functionality is a tough job. Maybe the solution would be to ask the Devel::Cover maintainer to provide the functionality you need as a module instead of relying on the script. Show quoted text
> 2) Devel::Cover is installed ONLY in the ~/.cpanplus folder > (somewhere) and the PATH does not > include a path which would let the OS find the 'cover' command > > > Here is an example abbreviated environment line which caused problems. > Note that > Devel::Cover was installed in the .cpanplus folder in this case and it > was not installed system > wide. The 'cover' command did not exist anywhere in the EVN{PATH}... > rather it was basically in > $some_build_folder/cover (which is why $Devel::Cover::Inc::Base/cover > is also checked).
Your assumption is that the module is installed. But that is not the case. This is only smoke testing and only PERL5LIB is modified in that environment to add the temporary Devel-Cover/lib. Personally, I think that is a bug in the smoke tool and that PATH should also be modified by the smoke tool. Trying to find the cover script in that broken environment can not be done reliably, unless with the $Devel::Cover::Inc::Base. But in that case, it would be better to try to use it before trying $PATH. Please, use my patch to fix the case of real non-broken environments. I can also improve it to implement my suggestion above (using $Devel::Cover::Inc::Base before $ENV{PATH}). Tell me. -- Olivier Mengué - http://perlresume.org/DOLMEN
Thanks a lot for the pull request on github.com. I've integrated the changes and uploaded the new version of the module to CPAN (v0.35).