Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Parse-ErrorString-Perl CPAN distribution.

Report information
The Basics
Id: 42004
Status: resolved
Priority: 0/
Queue: Parse-ErrorString-Perl

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

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



Subject: Makefile.PL error (does not install) and tests fail
Hi, first let me thank you for creating this nice module! Unfortunately, version 0.08 does not install properly on my system (and cpantesters is accusing the same problem). Here's the output: -------------------8<------------------- cpan[1]> install Parse::ErrorString::Perl CPAN: Storable loaded ok (v2.18) Going to read /root/.cpan/Metadata Database was generated on Sun, 28 Dec 2008 02:28:28 GMT Running install for module 'Parse::ErrorString::Perl' Running make for P/PS/PSHANGOV/Parse-ErrorString-Perl-0.08.tar.gz CPAN: Digest::SHA loaded ok (v5.47) CPAN: File::Which loaded ok (v0.05) CPAN: Compress::Zlib loaded ok (v2.015) Checksum for /root/.cpan/sources/authors/id/P/PS/PSHANGOV/Parse-ErrorString-Perl-0.08.tar.gz ok Scanning cache /root/.cpan/build for sizes DONE Parse-ErrorString-Perl-0.08 Parse-ErrorString-Perl-0.08/Build.PL Parse-ErrorString-Perl-0.08/Changes Parse-ErrorString-Perl-0.08/Makefile.PL Parse-ErrorString-Perl-0.08/MANIFEST Parse-ErrorString-Perl-0.08/META.yml Parse-ErrorString-Perl-0.08/README Parse-ErrorString-Perl-0.08/bin Parse-ErrorString-Perl-0.08/bin/check_perldiag Parse-ErrorString-Perl-0.08/lib Parse-ErrorString-Perl-0.08/lib/Parse Parse-ErrorString-Perl-0.08/lib/Parse/ErrorString Parse-ErrorString-Perl-0.08/lib/Parse/ErrorString/Perl.pm Parse-ErrorString-Perl-0.08/t Parse-ErrorString-Perl-0.08/t/00-load.t Parse-ErrorString-Perl-0.08/t/01-errors.t Parse-ErrorString-Perl-0.08/t/02-diagnostics.t Parse-ErrorString-Perl-0.08/t/03-split_diagnostics.t Parse-ErrorString-Perl-0.08/t/04-perldiag.t Parse-ErrorString-Perl-0.08/t/05-stacktrace.t Parse-ErrorString-Perl-0.08/t/06-short_filename.t CPAN: File::Temp loaded ok (v0.21) CPAN: YAML loaded ok (v0.68) CPAN: Module::Build loaded ok (v0.31) CPAN.pm: Going to build P/PS/PSHANGOV/Parse-ErrorString-Perl-0.08.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Parse::ErrorString::Perl cp lib/Parse/ErrorString/Perl.pm blib/lib/Parse/ErrorString/Perl.pm make: *** No rule to make target `bin\check_perldiag', needed by `blib/script/bin\check_perldiag'. Stop. PSHANGOV/Parse-ErrorString-Perl-0.08.tar.gz make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: PSHANGOV/Parse-ErrorString-Perl-0.08.tar.gz : make NO cpan[2]> -------------------8<------------------- (I'm using Linux, by the way) I was able to fix this by manually downloading "Parse-ErrorString-Perl-0.08.tar.gz" and editing Makefile.PL, changing this: ---------8<------------- 'EXE_FILES' => [ 'bin\\check_perldiag' ], ---------8<------------- into this: ---------8<------------- 'EXE_FILES' => [ 'bin/check_perldiag' ], ---------8<------------- But although the "make" command runs ok, the "make test" issues the following error: ---------8<------------- # make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-load.................1/1 # Testing Parse::ErrorString::Perl 0.08, Perl 5.010000, /usr/bin/perl t/00-load.................ok t/01-errors...............ok t/02-diagnostics..........ok t/03-split_diagnostics....ok t/04-perldiag.............ok t/05-stacktrace...........ok t/06-short_filename.......1/4 # Failed test 'msg_short_script short path' # at t/06-short_filename.t line 15. # Looks like you failed 1 test of 4. t/06-short_filename....... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests Test Summary Report ------------------- t/06-short_filename (Wstat: 256 Tests: 4 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=7, Tests=82, 5 wallclock secs ( 0.12 usr 0.01 sys + 4.68 cusr 0.16 csys = 4.97 CPU) Result: FAIL Failed 1/7 test programs. 1/82 subtests failed. make: *** [test_dynamic] Error 1 ---------8<------------- Apparently, for the tested error string: "Use of uninitialized value $empty in length at c:\my\very\long\path\to\this\perl\script\called\error.pl line 6." , the "file" method should return only "error.pl" but is instead returning "c:\my\very\long\path\to\this\perl\script\called\error.pl" I don't know if the latter is an error of your module or of File::Spec, but since it's your test suit I thought you should at least have another look at it. Anyway, thanks! I hope this helps you to fix it soon :) Cheers, -b
Show quoted text
> > Apparently, for the tested error string: > > "Use of uninitialized value $empty in length at > c:\my\very\long\path\to\this\perl\script\called\error.pl line 6." > > , the "file" method should return only "error.pl" but is instead > returning "c:\my\very\long\path\to\this\perl\script\called\error.pl" > > > I don't know if the latter is an error of your module or of > File::Spec, > but since it's your test suit I thought you should at least have > another > look at it. >
It just occured to me that your test suite might be wrong after all. In the POD you say (for the "file" method): ---------------8<--------------- file The path to the file in which the error occurred, possibly trunicated. If the error occurred in a script, the parser will attempt to return only the filename; if the error occurred in a module, the parser will attempt to return the path to the module relative to the directory in @INC in which it resides. ---------------8<--------------- The key point is "the parser will attempt to return only the filename". So it should return "file.pl" ***IF*** I was on Windows. Since I am on Linux, "c:\my\very\long\path\to\this\perl\script\called\error.pl" is *not* a valid path, so the method is working properly by returning the full name - in fact, you can create a valid file named "c:\my\very\long\path\to\this\perl\script\called\error.pl" on linux, on any path. Perhaps you should create different error message strings for different operating systems, and use something like $^O or Devel::CheckOS to find the appropriate string to check under that OS. Hope this helps! Cheers, -b
Subject: (fix provided) Makefile.PL error (does not install) and tests fail
On Sun Dec 28 15:40:26 2008, GARU wrote: Show quoted text
> > Perhaps you should create different error message strings for different > operating systems, and use something like $^O or Devel::CheckOS to find > the appropriate string to check under that OS. >
Well, I got bored and did that for you. The new t/06-short_filename.t and Makefile.PL are attached to this message. I also provided them as a diff, if you prefer. Now 'make', 'make test' and 'make install' all work nicely. Hope to see the new CPAN release soon! Cheers, -b
17c17 < 'bin\\check_perldiag' --- > 'bin/check_perldiag'
#!perl -T use Test::More tests => 4; use Parse::ErrorString::Perl; use File::Spec; my $parser = Parse::ErrorString::Perl->new; my $msg_short_script; if ($^O =~ m/win/i) { $msg_short_script = <<'ENDofMSG'; Use of uninitialized value $empty in length at c:\my\very\long\path\to\this\perl\script\called\error.pl line 6. ENDofMSG } else { $msg_short_script = <<'ENDofMSG'; Use of uninitialized value $empty in length at /my/very/long/path/to/this/perl/script/called/error.pl line 6. ENDofMSG } my @errors_short_script = $parser->parse_string($msg_short_script); ok(@errors_short_script, 'msg_short_script results'); ok($errors_short_script[0]->file eq 'error.pl', 'msg_short_script short path'); our @INC; my $path = File::Spec->catfile($INC[0], 'Error.pm'); my $msg_short_module = 'Use of uninitialized value $empty in length at ' . $path . ' line 6.'; my @errors_short_module = $parser->parse_string($msg_short_module); ok(@errors_short_module, 'msg_short_module results'); ok($errors_short_module[0]->file eq 'Error.pm', 'msg_short_module short path');
# Note: this file was auto-generated by Module::Build::Compat version 0.30 use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'Parse::ErrorString::Perl', 'VERSION_FROM' => 'lib/Parse/ErrorString/Perl.pm', 'PREREQ_PM' => { 'Class::XSAccessor' => 0, 'File::Basename' => 0, 'File::Spec' => 0, 'Pod::Find' => 0, 'Pod::POM' => 0, 'Test::More' => 0 }, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [ 'bin/check_perldiag' ], 'PL_FILES' => {} ) ;
9c9,11 < my $msg_short_script = <<'ENDofMSG'; --- > my $msg_short_script; > if ($^O =~ m/win/i) { > $msg_short_script = <<'ENDofMSG'; 11a14,19 > } > else { > $msg_short_script = <<'ENDofMSG'; > Use of uninitialized value $empty in length at /my/very/long/path/to/this/perl/script/called/error.pl line 6. > ENDofMSG > }
Subject: Re: [rt.cpan.org #42004] (fix provided) Makefile.PL error (does not install) and tests fail
Date: Wed, 31 Dec 2008 10:03:20 -0800 (PST)
To: bug-Parse-ErrorString-Perl [...] rt.cpan.org
From: Petar Shangov <pshangov [...] yahoo.com>
Thanks very much for the feedback, a new version of the module will soon be on CPAN. It took some time since the Makefile.PL issue is not very trivial as it seems and fully resolving it will involve some bug-fixing of Module::Build. Petar Show quoted text
----- Original Message ----
> From: Breno G. de Oliveira via RT <bug-Parse-ErrorString-Perl@rt.cpan.org> > Sent: Sunday, 28 December, 2008 22:57:26 > Subject: [rt.cpan.org #42004] (fix provided) Makefile.PL error (does not install) and tests fail > > Queue: Parse-ErrorString-Perl > Ticket > > On Sun Dec 28 15:40:26 2008, GARU wrote:
> > > > Perhaps you should create different error message strings for different > > operating systems, and use something like $^O or Devel::CheckOS to find > > the appropriate string to check under that OS. > >
> > Well, I got bored and did that for you. The new t/06-short_filename.t > and Makefile.PL are attached to this message. I also provided them as a > diff, if you prefer. > > Now 'make', 'make test' and 'make install' all work nicely. > > Hope to see the new CPAN release soon! > > Cheers, > > -b