Skip Menu |

This queue is for tickets about the Lemonldap-NG-Handler CPAN distribution.

Report information
The Basics
Id: 107205
Status: resolved
Priority: 0/
Queue: Lemonldap-NG-Handler

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

Bug Information
Severity: (no value)
Broken in: 1.4.5
Fixed in: (no value)



Subject: $^X should be used instead "perl
Reason for the many fail reports at cpantesters (see http://matrix.cpantesters.org/?dist=Lemonldap-NG-Handler%201.4.5 ) is probably this line: lib/Lemonldap/NG/Handler/Initialization/LocalInit.pm:178: exec 'perl', '-MLemonldap::NG::Handler::Status', "perl" is usually the first perl in PATH, normally the system perl, but not the perl which is running the tests or using the module. This can be fixed by using $^X instead.
Le Dim 20 Sep 2015 14:56:44, SREZIC a écrit : Show quoted text
> Reason for the many fail reports at cpantesters (see > http://matrix.cpantesters.org/?dist=Lemonldap-NG-Handler%201.4.5 ) is > probably this line: > > lib/Lemonldap/NG/Handler/Initialization/LocalInit.pm:178: exec > 'perl', '-MLemonldap::NG::Handler::Status', > > "perl" is usually the first perl in PATH, normally the system perl, > but not the perl which is running the tests or using the module. This > can be fixed by using $^X instead.
Thanks for the report, created https://jira.ow2.org/browse/LEMONLDAP-848 in our tracker.
I tried to replace 'perl' by $^X but as we are under mod_perl2, $^X is equivalent to /usr/bin/apache2, so it does not work. Do you have another idea on how to fix the tests?
Le Mar 22 Sep 2015 11:40:59, COUDOT a écrit : Show quoted text
> I tried to replace 'perl' by $^X but as we are under mod_perl2, $^X is > equivalent to /usr/bin/apache2, so it does not work. > > Do you have another idea on how to fix the tests?
Looking at http://www.cpantesters.org/cpan/report/85a6cda8-2fce-11e5-b496-3075e0bfc7aa the problem sees to come from Fcntl.
On 2015-09-22 12:23:06, GUIMARD wrote: Show quoted text
> Le Mar 22 Sep 2015 11:40:59, COUDOT a écrit :
> > I tried to replace 'perl' by $^X but as we are under mod_perl2, $^X > > is > > equivalent to /usr/bin/apache2, so it does not work. > > > > Do you have another idea on how to fix the tests?
> > Looking at http://www.cpantesters.org/cpan/report/85a6cda8-2fce-11e5- > b496-3075e0bfc7aa the problem sees to come from Fcntl.
No. This error message just happens because the symbols of the system perl's Fcntl.so do not match with the symbols of the current running perl.
On 2015-09-22 11:40:59, COUDOT wrote: Show quoted text
> I tried to replace 'perl' by $^X but as we are under mod_perl2, $^X is > equivalent to /usr/bin/apache2, so it does not work. > > Do you have another idea on how to fix the tests?
One possibility is to use $Config{perlpath}, which is almost always the same as $^X. I also think that mod_perl defines something which can be checked (was it $ENV{MOD_PERL}?)
Le Mar 22 Sep 2015 16:08:29, SREZIC a écrit : Show quoted text
> On 2015-09-22 11:40:59, COUDOT wrote:
> > I tried to replace 'perl' by $^X but as we are under mod_perl2, $^X > > is > > equivalent to /usr/bin/apache2, so it does not work. > > > > Do you have another idea on how to fix the tests?
> > One possibility is to use $Config{perlpath}, which is almost always > the same as $^X. > I also think that mod_perl defines something which can be checked (was > it $ENV{MOD_PERL}?)
The %Config is not defined in our environment (is this mod_perl 1 ?) I just pushed this patch: @@ -175,7 +175,8 @@ sub statusProcess { open STDOUT, ">&$fdout"; my @tmp = (); push @tmp, "-I$_" foreach (@INC); - exec 'perl', '-MLemonldap::NG::Handler::Status', + my $perl_exec = ( $^X =~ /perl/ ) ? $^X : 'perl'; + exec $perl_exec, '-MLemonldap::NG::Handler::Status', @tmp, '-e', '&Lemonldap::NG::Handler::Status::run(' Unit tests are ok on my laptop, hope this will work when we will update the module on CPAN.
On 2015-09-23 03:36:14, COUDOT wrote: Show quoted text
> Le Mar 22 Sep 2015 16:08:29, SREZIC a écrit :
> > On 2015-09-22 11:40:59, COUDOT wrote:
> > > I tried to replace 'perl' by $^X but as we are under mod_perl2, $^X > > > is > > > equivalent to /usr/bin/apache2, so it does not work. > > > > > > Do you have another idea on how to fix the tests?
> > > > One possibility is to use $Config{perlpath}, which is almost always > > the same as $^X. > > I also think that mod_perl defines something which can be checked > > (was > > it $ENV{MOD_PERL}?)
> > > The %Config is not defined in our environment (is this mod_perl 1 ?)
You need to say "use Config" before. Show quoted text
> I just pushed this patch: > > @@ -175,7 +175,8 @@ sub statusProcess { > open STDOUT, ">&$fdout"; > my @tmp = (); > push @tmp, "-I$_" foreach (@INC); > - exec 'perl', '-MLemonldap::NG::Handler::Status', > + my $perl_exec = ( $^X =~ /perl/ ) ? $^X : 'perl'; > + exec $perl_exec, '-MLemonldap::NG::Handler::Status', > @tmp, > '-e', > '&Lemonldap::NG::Handler::Status::run(' > > > Unit tests are ok on my laptop, hope this will work when we will > update the module on CPAN.
To be extra safe you could check that only the basename contains the string perl, something like this (untested): use File::Basename qw(basename); my $perl_exec = ( basename($^X) =~ /perl/ ) ? $^X : 'perl'; Otherwise your intention could fail if you have an apache in an unusual path like /opt/perl/bin/httpd or so...
Fixed some years ago