Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 31972
Status: open
Priority: 0/
Queue: Perl-Critic

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

Bug Information
Severity: Critical
Broken in:
  • 1.07
  • 1.071
  • 1.072
  • 1.073
  • 1.074
  • 1.075_001
  • 1.076
  • 1.077
  • 1.078
  • 1.079_001
  • 1.079_002
  • 1.079_003
  • 1.080
Fixed in: (no value)



Subject: PodSpelling/Open2 Kills Critic on Win32
Download (untitled) / with headers
text/plain 812b
The addition if the PodSpelling policy in 1.07+ has killed running critic tests [with that policy enabled by default] on Win32 when aspell is installed. The test script, and other critic scripts just hang, waiting for a response it never gets. As far as I can tell, IPC::Open2 on win32 is borked. If I rename/hide/uninstall aspell, the policy_podspelling.t tests curiously pass. I'd think those should fail since no spelling checking was done. These passes I assume explain the PASS reports for win32 in testers. This was the same problem, from the Test::Spelling Changelog: 0.11 2005-11-15 - Some documentation fixes. - Added note about per-file stopwords by Chris Dolan. - Use a temporary file instead of open2() to solve win32 portability issues. (Thanks to Chris Laco!)
Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Sat, 29 Dec 2007 20:45:39 -0600
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <elliotjs [...] cpan.org>
Download (untitled) / with headers
text/plain 704b
Christopher H. Laco via RT wrote: Show quoted text
> The addition if the PodSpelling policy in 1.07+ has killed running > critic tests [with that policy enabled by default] on Win32 when aspell > is installed. The test script, and other critic scripts just hang, > waiting for a response it never gets. As far as I can tell, IPC::Open2 > on win32 is borked.
Joyous. Show quoted text
> If I rename/hide/uninstall aspell, the policy_podspelling.t tests > curiously pass. I'd think those should fail since no spelling checking > was done. These passes I assume explain the PASS reports for win32 in > testers.
Yup. This policy looks for its configured spelling program (which defaults to aspell) and disables itself if it can't find it.
Download (untitled) / with headers
text/plain 139b
So if I understand this correctly, we should not load this policy $OSNAME eq 'win32' && $Pod::Spelling::VERSION < 0.11. Is that right?
CC: claco [...] cpan.org
Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Tue, 01 Jan 2008 12:10:33 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Christopher Laco <claco [...] chrislaco.com>
Download (untitled) / with headers
text/plain 936b
Jeffrey Ryan Thalhammer via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=31972 > > > So if I understand this correctly, we should not load this policy > $OSNAME eq 'win32' && $Pod::Spelling::VERSION < 0.11. Is that right? > > > > >
Based on a quick look at the source, Pod::Spelling does nothing but extract words. It's the use of IPC::Open2 talking to aspell.exe that kills iton win32. This is the same problem that Test::Spelling had with it's use of Open2->aspell.exe. The use of Open2 was ditchd in favor of temp files: http://search.cpan.org/diff?from=Test-Spelling-0.10&to=Test-Spelling-0.11 Now, I'm not sure if there's a way to use Open2/Open3 or some other method for win32, this is certainly one way. I would think that an evev better way might be to use Text::Aspell instead, which appears to use the aspell XS/lib rather than the executable. Not sue the status of that module on win32. -=Chris
Download signature.asc
application/pgp-signature 249b

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 217b
Fixed in svn revision 2087. If it isn't too much trouble, could you try it out for me? Thanks. Here's the url to the trunk: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic login="guest" password=""
CC: claco [...] cpan.org
Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Wed, 02 Jan 2008 08:58:45 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: "Christopher H. Laco" <claco [...] chrislaco.com>
Download (untitled) / with headers
text/plain 1.6k
Jeffrey Ryan Thalhammer via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=31972 > > > Fixed in svn revision 2087. If it isn't too much trouble, could you try > it out for me? Thanks. Here's the url to the trunk: > > http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic > > login="guest" > password="" > >
Looks like something isn't happy about spaces in the path to aspell: Show quoted text
> C:\Perl-Critic>prove -l t/*spelling*.t > t/20_policy_podspelling......'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > > t/20_policy_podspelling......1/4 # Failed test 'Mispelled header' > # at t/20_policy_podspelling.t line 55. > # got: '0' > # expected: '1' > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > > # Failed test 'Mispelled body' > # at t/20_policy_podspelling.t line 67. > # got: '0' > # expected: '1' > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > # Looks like you failed 2 tests of 4. > t/20_policy_podspelling...... Dubious, test returned 2 (wstat 512, 0x200) > Failed 2/4 subtests > > Test Summary Report > ------------------- > t/20_policy_podspelling.t (Wstat: 512 Tests: 4 Failed: 2) > Failed test number(s): 1-2 > Non-zero exit status: 2 > Files=1, Tests=4, 3 wallclock secs ( 0.01 usr + 0.01 sys = 0.02 CPU) > Result: FAIL
Download signature.asc
application/pgp-signature 187b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Wed, 02 Jan 2008 14:56:18 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: "Christopher H. Laco" <claco [...] chrislaco.com>
Download (untitled) / with headers
text/plain 589b
This fixes the error for me. No idea how portable this is: Show quoted text
> C:\Perl-Critic>svn diff > Index: lib/Perl/Critic/Policy/Documentation/PodSpelling.pm > =================================================================== > --- lib/Perl/Critic/Policy/Documentation/PodSpelling.pm (revision 2087) > +++ lib/Perl/Critic/Policy/Documentation/PodSpelling.pm (working copy) > @@ -153,7 +153,7 @@ > sub _set_spell_command { > my ( $self, $spell_command ) = @_; > > - $self->{_spell_command} = $spell_command; > + $self->{_spell_command} = "\"$spell_command\""; > > return; > }
Download signature.asc
application/pgp-signature 187b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Wed, 02 Jan 2008 23:04:39 -0600
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <elliotjs [...] cpan.org>
Download (untitled) / with headers
text/plain 329b
claco@chrislaco.com via RT wrote: Show quoted text
> Queue: Perl-Critic > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=31972 > > > This fixes the error for me. No idea how portable this is:
Oog. Not at all portable. On Unix, this will attempt to invoke a command that has quotes in the name. Not very likely to be correct.
Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Thu, 3 Jan 2008 05:05:13 +0000
To: bug-Perl-Critic [...] rt.cpan.org,undisclosed-recipients:;
From: jeffrey_thalhammer [...] yahoo.com
Download (untitled) / with headers
text/plain 109b
I was thinking of using the shellwords() function but I haven't tried it yet. Sent via BlackBerry by AT&T
Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Sun, 09 Mar 2008 16:39:35 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Kindly test v1.082.
Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Sun, 09 Mar 2008 18:11:38 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: Christopher Laco <claco [...] chrislaco.com>
Download (untitled) / with headers
text/plain 5.2k
Elliot Shank via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=31972 > > > Kindly test v1.082. > >
Having build problems. Show quoted text
> C:\Handel>cpan -i Perl::Critic > CPAN: File::HomeDir loaded ok (v0.67) > Database was generated on Sun, 09 Mar 2008 21:57:15 GMT > Running install for module 'Perl::Critic' > Running make for E/EL/ELLIOTJS/Perl-Critic-1.082.tar.gz > Checksum for C:\strawberry\cpan\sources\authors\id\E\EL\ELLIOTJS\Perl-Critic-1.082.tar.gz ok > > CPAN.pm: Going to build E/EL/ELLIOTJS/Perl-Critic-1.082.tar.gz > > Checking whether your kit is complete... > Looks good > > Checking prerequisites... > Looks good > > Creating new 'Build' script for 'Perl-Critic' version '1.082' > > Versions of optional/unlisted/indirect dependencies: > > Exporter = 5.62 > File::HomeDir = 0.67 > File::Which = 0.05 > IPC::Open2 = 1.02 > Perl::Tidy = 20071205 > Pod::Spell = 1.01 > Readonly::XS = not installed > Variable "$nest" is not available at (re_eval 68) line 2, <DATA> line 1002. > Variable "$nest" is not available at (re_eval 69) line 2, <DATA> line 1002. > Regexp::Parser = 0.20 > Text::ParseWords = 3.26 > > C:\strawberry\perl\bin\perl.exe t\generate_without_optional_dependencies_wrappers.PL t\00_modules.t_without_optional_dependencies.t t\01_con > fig.t_without_optional_dependencies.t t\01_config_bad_perlcriticrc.t_without_optional_dependencies.t t\02_policy.t_without_optional_dependen > cies.t t\03_pragmas.t_without_optional_dependencies.t t\04_defaults.t_without_optional_dependencies.t t\05_utils.t_without_optional_dependen > cies.t t\05_utils_ppi.t_without_optional_dependencies.t t\06_violation.t_without_optional_dependencies.t t\07_perlcritic.t_without_optional_ > dependencies.t t\08_document.t_without_optional_dependencies.t t\09_theme.t_without_optional_dependencies.t t\10_userprofile.t_without_optio > nal_dependencies.t t\11_policyfactory.t_without_optional_dependencies.t t\12_policylisting.t_without_optional_dependencies.t t\13_bundled_po > licies.t_without_optional_dependencies.t t\14_policy_parameters.t_without_optional_dependencies.t t\15_statistics.t_without_optional_depende > ncies.t t\20_policy_podspelling.t_without_optional_dependencies.t t\20_policy_requiretidycode.t_without_optional_dependencies.t t\80_policys > ummary.t_without_optional_dependencies.t t\92_memory_leaks.t_without_optional_dependencies.t t\94_includes.t_without_optional_dependencies.t > > > > Generating tests that hide modules and then run other tests. > Could not figure out the name of the test to wrap from "t\00_modules.t_without_optional_dependencies.t". at t\generate_without_optional_depe > ndencies_wrappers.PL line 39 > t\generate_without_optional_dependencies_wrappers.PL failed at C:/strawberry/perl/lib/Module/Build/Base.pm line 2276. > ELLIOTJS/Perl-Critic-1.082.tar.gz > C:\strawberry\perl\bin\perl.exe ./Build -- NOT OK > Running Build test > Can't test without successful make > Running Build install > Make had returned bad status, install seems impossible
Show quoted text
> C:\Handel>perl -V > Summary of my perl5 (revision 5 version 10 subversion 0) configuration: > Platform: > osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread > uname='' > config_args='undef' > hint=recommended, useposix=true, d_sigaction=undef > useithreads=define, usemultiplicity=define > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=undef, use64bitall=undef, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_RE > ADFIX', > optimize='-s -O2', > cppflags='-DWIN32' > ccversion='', gccversion='3.4.5', gccosandvers='' > intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 > d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12 > ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"' > libpth=C:\strawberry\c\lib > libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -l > ws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 > perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luui > d -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 > libc=-lmsvcrt, so=dll, useshrplib=true, libperl=libperl510.a > gnulibc_version='' > Dynamic Linking: > dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' > cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"' > > > Characteristics of this binary (from libperl): > Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV > PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS > PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS > USE_LARGE_FILES USE_PERLIO > Built under MSWin32 > Compiled at Dec 21 2007 14:11:41 > @INC: > C:/strawberry/perl/lib > C:/strawberry/perl/site/lib > .
Download signature.asc
application/pgp-signature 249b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Sun, 09 Mar 2008 17:45:27 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Download (untitled) / with headers
text/plain 264b
claco@chrislaco.com via RT wrote: Show quoted text
> Elliot Shank via RT wrote:
>> Kindly test v1.082.
> > Having build problems.
Why are you running author tests? Author tests are not supported outside of our own environments. Kindly unset TEST_AUTHOR and run again. Thanks!
Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Mon, 10 Mar 2008 10:08:23 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: "Christopher H. Laco" <claco [...] chrislaco.com>
Download (untitled) / with headers
text/plain 831b
Here's sometime more real that works for me, after -x is checked: Show quoted text
> sub _derive_spell_command_line { > my ($self) = @_; > > my @words = Text::ParseWords::shellwords($self->_get_spell_command()); > if (!@words) { > return; > } > if (! File::Spec->file_name_is_absolute($words[0])) { > $words[0] = File::Which::which($words[0]); > } > if (! $words[0] || ! -x $words[0]) { > return; > } else { > $words[0] = '"' . $words[0] . '"'; > } > $self->_set_spell_command_line(\@words); > > return $self->_get_spell_command_line(); > }
That's probably not cross platform friendly...probably needs a Win32 check around it. But it works for me. The warnings are gone, the tests pass (and fail if I alter them), so I know aspell is actually being used. -=Chris
Download signature.asc
application/pgp-signature 187b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Mon, 10 Mar 2008 09:46:36 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: "Christopher H. Laco" <claco [...] chrislaco.com>
Download (untitled) / with headers
text/plain 4.8k
Elliot Shank via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=31972 > > > claco@chrislaco.com via RT wrote:
>> Elliot Shank via RT wrote:
>>> Kindly test v1.082.
>> Having build problems.
> > Why are you running author tests? Author tests are not supported outside of our own environments. Kindly unset TEST_AUTHOR and run again.
Well, because, I'm an author on my machine...so TEST_AUTHOR=1 in my shell. Now interestingly enough, this didn't cause problems on OSX or *nix...only goes boom on Win32 with TEST_AUTHOR=1. But I digress.... With TEST_AUTHOR=0... make test yields plenty of these: 'C:\Program' is not recognized as an internal or external command And my own critic tests no longer hang...but they also yield the warnings above, so I'm not sure if they're really being spell checked at all. Show quoted text
> t/00_modules....................................ok > t/01_config.....................................'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................5/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................18/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................21/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................31/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................34/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................58/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................66/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................71/? 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/01_config.....................................ok > t/01_config_bad_perlcriticrc....................ok
[big snip] Show quoted text
> t/20_policy_podspelling......'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/20_policy_podspelling......1/4 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > 'C:\Program' is not recognized as an internal or external command, > operable program or batch file. > t/20_policy_podspelling......ok > All tests successful. > Files=1, Tests=4, 2 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) > Result: PASS
In fact, I suspect this test unexpectedly succeeds when spelling isn't working: I changed this: Show quoted text
> $code = <<'END_PERL'; > =head1 Test > > arglbargl > > =cut > END_PERL > > is( pcritique($policy, \$code, \%config), can_podspell() ? 1 : 0, 'Mispelled body' );
to this: Show quoted text
> $code = <<'END_PERL'; > =head1 Test > > first > > =cut > END_PERL > > is( pcritique($policy, \$code, \%config), can_podspell() ? 1 : 0, 'Mispelled body' );
in 20_policy_podspelling.t and the test still passes. No clue what that means. In the end, it looks like the spelling command is not being quoted... so open $command_line is running C:\Program, since there's a space in there... This hackishly fixes the warning problem for me... Show quoted text
> sub _derive_spell_command_line { > my ($self) = @_; > > my @words = Text::ParseWords::shellwords($self->_get_spell_command()); > if (!@words) { > return; > } > if (! File::Spec->file_name_is_absolute($words[0])) { > $words[0] = '"' . File::Which::which($words[0]) . '"'; > } > if (! $words[0] || ! -x $words[0]) { > return; > } > > $self->_set_spell_command_line(\@words); > > return $self->_get_spell_command_line(); > }
Download signature.asc
application/pgp-signature 187b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #31972] PodSpelling/Open2 Kills Critic on Win32
Date: Mon, 10 Mar 2008 15:41:23 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Download (untitled) / with headers
text/plain 828b
claco@chrislaco.com via RT wrote: Show quoted text
> In fact, I suspect this test unexpectedly succeeds when spelling isn't > working: > > I changed this: >
>> $code = <<'END_PERL'; >> =head1 Test >> >> arglbargl >> >> =cut >> END_PERL >> >> is( pcritique($policy, \$code, \%config), can_podspell() ? 1 : 0, 'Mispelled body' );
> > to this: >
>> $code = <<'END_PERL'; >> =head1 Test >> >> first >> >> =cut >> END_PERL >> >> is( pcritique($policy, \$code, \%config), can_podspell() ? 1 : 0, 'Mispelled body' );
> > in 20_policy_podspelling.t and the test still passes. No clue what that > means. In the end, it looks like the spelling command is not being > quoted... so open $command_line is running C:\Program, since there's a > space in there...
Oh, it most definitely will pass if P::C thinks spelling is broken. It's designed to.


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.