Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

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

People
Owner: Nobody in particular
Requestors: jloverso [...] mathworks.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.55
  • 0.56
  • 0.57
  • 0.58
Fixed in: (no value)



Subject: Makefile.PL generates bad Devel::Cover::Inc.pm on Windows (with patch)
Download (untitled) / with headers
text/plain 2.4k
If I invoke 'perl Makefie.PL' on Windows using an absolete UNC path to perl.exe (if I have the UNC path to the perl installation in my PATH), then when Makefile.PL writes this into Inc.pm: our \$Perl = '$^X'; the resulting Inc.pm has this: our $Perl = '\\server\path\to\perl-5.8.8\bin\perl.exe'; And when Inc.pm is used (for instance, when attempting to run the Devel::Cover tests, the value of $Perl is... DB<3> p $Devel::Cover::Inc::Perl \server\path\to\perl-5.8.8\bin\perl.exe That's because \\ inside single quotes is really stripped. Ref: see 'perldoc perlop' under 'Gory details of parsing quoted constructs' in the section 'Interpolation': '', "q//" The only interpolation is removal of "\" from pairs "\\". Inc.pm really needs to have any backslashes doubled: our $Perl = '\\\\server\\path\\to\\perl-5.8.8\\bin\\perl.exe'; OR the value should be set with <<'EOF', which doesn't remove \: chomp(our $Perl = <<'EOF'); \\server\path\to\perl-5.8.8\bin\perl.exe EOF The best way to double the backslashes is to use Data::Dumper. You could just use s'\\'\\\\'g before printing the value surrounded by ', but that doesn't help you in the general case of weird pathnames (i.e., it might have ' in it!) The three possible patches for Makefile.PL are: diff -U1 Makefile.PL.orig Makefile.PL.fix1 --- Makefile.PL.orig 2006-12-19 08:25:50.000000000 -0500 +++ Makefile.PL.fix1 2006-12-19 08:25:50.000000000 -0500 @@ -56,3 +56,5 @@ our \$VERSION = "$Version"; -our \$Perl = '$^X'; +chomp(our \$Perl = <<'EOF'); +$^X +EOF our \$Perl_version = '$]'; diff -U1 Makefile.PL.orig Makefile.PL.fix2 --- Makefile.PL.orig 2006-12-19 08:25:50.000000000 -0500 +++ Makefile.PL.fix2 2006-12-19 08:25:50.000000000 -0500 @@ -38,2 +38,4 @@ +(my $Perl = $^X) =~ s/\\/\\\\/g; + open I, ">lib/Devel/Cover/Inc.pm" @@ -56,3 +58,3 @@ our \$VERSION = "$Version"; -our \$Perl = '$^X'; +our \$Perl = '$Perl'; our \$Perl_version = '$]'; diff -U1 Makefile.PL.orig Makefile.PL.fix3 --- Makefile.PL.orig 2006-12-19 08:25:50.000000000 -0500 +++ Makefile.PL.fix3 2006-12-19 08:25:50.000000000 -0500 @@ -19,2 +19,4 @@ +use Data::Dumper; + $| = 1; @@ -38,2 +40,8 @@ +my $Perl; +{ + local $Data::Dumper::Terse = 1; + $Perl = Dumper($^X); +}; + open I, ">lib/Devel/Cover/Inc.pm" @@ -56,3 +64,3 @@ our \$VERSION = "$Version"; -our \$Perl = '$^X'; +our \$Perl = '$Perl'; our \$Perl_version = '$]'; Thank you!
From: jloverso [...] mathworks.com
Download (untitled) / with headers
text/plain 541b
Minor correction to the fix using Data::Dumper -- diff -U1 Makefile.PL.orig Makefile.PL.fix3 --- Makefile.PL.orig 2006-12-19 08:25:50.000000000 -0500 +++ Makefile.PL.fix3 2006-12-19 08:25:50.000000000 -0500 @@ -19,2 +19,4 @@ +use Data::Dumper; + $| = 1; @@ -38,2 +40,8 @@ +my $Perl; +{ + local $Data::Dumper::Terse = 1; + $Perl = Dumper($^X); +}; + open I, ">lib/Devel/Cover/Inc.pm" @@ -56,3 +64,3 @@ our \$VERSION = "$Version"; -our \$Perl = '$^X'; +our \$Perl = $Perl; our \$Perl_version = '$]';
Subject: Re: [rt.cpan.org #24105] Makefile.PL generates bad Devel::Cover::Inc.pm on Windows (with patch)
Date: Sat, 30 Dec 2006 00:44:23 +0100
To: John LoVerso via RT <bug-Devel-Cover [...] rt.cpan.org>
From: Paul Johnson <paul [...] pjcj.net>
Download (untitled) / with headers
text/plain 499b
On Tue, Dec 26, 2006 at 04:03:40PM -0500, John LoVerso via RT wrote: Show quoted text
> The three possible patches for Makefile.PL are:
Thanks very much. I've gone for the first patch and added the fix as http://pjcj.sytes.net/svnweb/Devel::Cover/revision/?rev=182 It will be in the next release. I've a feeling there might be other places that could need some attention for similar problems, or which could be simplified, particularly in the testing code. -- Paul Johnson - paul@pjcj.net http://www.pjcj.net


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.