Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 52794
Status: resolved
Worked: 45 min
Priority: 0/
Queue: PAR-Packer

People
Owner: Nobody in particular
Requestors: javierous [...] gmail.com
Cc:
AdminCc:

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



Subject: Multiple tests failing on strawberry perl
Download (untitled) / with headers
text/plain 4.1k
I'm using stock strawberry perl 5.8.9.3 on a windows xp vm. I'm seeing a lot of similar fails while running tests for the module (output below). I've seen the same behavior on strawberry perl 5.10.1.0. I'm not sure what to look at here, any help would be appreciated. Thanks in advance. t/20-pp.t ................ Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: C:\strawberry\perl\vendor\li b . C:\strawberry\perl\lib C:\strawberry\perl\lib C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\strawb erry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. t/20-pp.t ................ 1/34 # Failed test 'pp_hello_1 # [430] # Test 1_0 The command string " a.exe " in directory C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\autom ated_pp_test\pp_switch_tests\temp1,did not produce :: "hello" :: # Instead, it produced :: Usage: a.exe [ -Alib.par ] [ -Idir ] [ -Mmodule ] [ src.par ] [ program.pl ] # a.exe [ -B|-b ] [-Ooutfile] src.par # Can't locate File/Temp.pm in @INC (@INC contains: C:\strawberry\perl\vendor\lib .) at -e line 161. # END failed--call queue aborted at -e line 969. :: # End of [430] results # # Did pp "hello.pl" produce a.exe? # ' # at automated_pp_test.pl line 7022. Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: C:\strawberry\perl\vendor\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\strawberry\perl\vendor\lib C:\str awberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. t/20-pp.t ................ 2/34 Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: C:\strawberry\perl\vend or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. t/20-pp.t ................ 3/34 # Failed test 'pp_minus_o_foo_foo_dot_pl_bar_dot_pl # [430] # Test 3_0 The command string " foo.exe " in directory C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\aut omated_pp_test\pp_switch_tests\temp0,did not produce :: "hello foo" :: # Instead, it produced :: Usage: foo.exe [ -Alib.par ] [ -Idir ] [ -Mmodule ] [ src.par ] [ program.pl ] # foo.exe [ -B|-b ] [-Ooutfile] src.par # Can't locate File/Temp.pm in @INC (@INC contains: C:\strawberry\perl\vendor\lib .) at -e line 161. # END failed--call queue aborted at -e line 969. :: # End of [430] results # # Did pp -o foo.exe "foo.pl" "bar.pl" produce foo.exe? # ' # at automated_pp_test.pl line 7115. t/20-pp.t ................ 5/34 Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: C:\strawberry\perl\vend or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. t/20-pp.t ................ 6/34 Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: C:\strawberry\perl\vend or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. t/20-pp.t ................ 10/34 Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: C:\strawberry\perl\ven dor\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\ strawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. t/20-pp.t ................ 11/34 # Failed test 'pp_minus_e_print_hello # [430] # Test 11_0 The command string " a.exe " in directory C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\auto mated_pp_test\pp_switch_tests\temp2,did not produce :: "hello" :: # Instead, it produced :: Usage: a.exe [ -Alib.par ] [ -Idir ] [ -Mmodule ] [ src.par ] [ program.pl ] # a.exe [ -B|-b ] [-Ooutfile] src.par # Can't locate File/Temp.pm in @INC (@INC contains: C:\strawberry\perl\vendor\lib .) at -e line 161. # END failed--call queue aborted at -e line 969. :: # End of [430] results # # Did pp -e "print \"hello\n\";" produce a.exe? # ' # at automated_pp_test.pl line 7495. [...]
Download (untitled) / with headers
text/plain 5.4k
Hi Javier, I have run into this exact same issue today, while trying to get PAR installed so that I could update the binary of a program a co-worker of mine needed. I don't have a solution to the bug, but I have gotten a work-around in place. What you do is: 1. Use CPAN in strawberry perl to attempt to install PAR::Packer. 2. As its running (and failing) the tests, cancel out of the build with Ctrl-C. 3. Use CPAN in strawberry perl to attempt to install PAR::Filter::PodStrip. 4. When PAR::Filter::PodStrip is running, it'll create a PodStrip.pm file in the build directory. 5. Cancel out of the build with Ctrl-C. 6. Search for the PodStrip.pm file in the c:\strawberry directory (I just used windows search), and copy that into a new directory structure that you'll manually create: C:\strawberry\perl\lib\PAR\Filter\ Copying the file into that directory will place PodStrip.pm in the @INC path, which is what the PAR::Packer build was complaining about in the first place. 8. Use CPAN in strawberry perl to install PAR::Packer. This time it'll succeed. Cedric On Tue Dec 15 13:10:07 2009, javs wrote: Show quoted text
> I'm using stock strawberry perl 5.8.9.3 on a windows xp vm. I'm seeing > a lot of similar fails while running tests for the module (output > below). I've seen the same behavior on strawberry perl 5.10.1.0. I'm > not sure what to look at here, any help would be appreciated. > > Thanks in advance. > > t/20-pp.t ................ Can't locate PAR/Filter/PodStrip.pm in @INC > (@INC contains: C:\strawberry\perl\vendor\li > b . C:\strawberry\perl\lib C:\strawberry\perl\lib > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\strawb > erry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line 754, > <_FH> chunk 1. > > t/20-pp.t ................ 1/34 # Failed test 'pp_hello_1 > # [430] > # Test 1_0 The command string " a.exe " in directory > C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\autom > ated_pp_test\pp_switch_tests\temp1,did not produce :: "hello" :: > # Instead, it produced :: Usage: a.exe [ -Alib.par ] [ -Idir ] [ > -Mmodule ] [ src.par ] [ program.pl ] > # a.exe [ -B|-b ] [-Ooutfile] src.par > # Can't locate File/Temp.pm in @INC (@INC contains: > C:\strawberry\perl\vendor\lib .) at -e line 161. > # END failed--call queue aborted at -e line 969. :: > # End of [430] results > # > # Did pp "hello.pl" produce a.exe? > # ' > # at automated_pp_test.pl line 7022. > Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: > C:\strawberry\perl\vendor\lib . C:\strawberry\perl\lib > C:\strawberry\perl\lib C:\strawberry\perl\site\lib > C:\strawberry\perl\site\lib C:\strawberry\perl\vendor\lib C:\str > awberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. > t/20-pp.t ................ 2/34 Can't locate PAR/Filter/PodStrip.pm in > @INC (@INC contains: C:\strawberry\perl\vend > or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s > trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line > 754, <_FH> chunk 1. > > t/20-pp.t ................ 3/34 # Failed test > 'pp_minus_o_foo_foo_dot_pl_bar_dot_pl > # [430] > # Test 3_0 The command string " foo.exe " in directory > C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\aut > omated_pp_test\pp_switch_tests\temp0,did not produce :: "hello foo" :: > # Instead, it produced :: Usage: foo.exe [ -Alib.par ] [ -Idir ] [ > -Mmodule ] [ src.par ] [ program.pl ] > # foo.exe [ -B|-b ] [-Ooutfile] src.par > # Can't locate File/Temp.pm in @INC (@INC contains: > C:\strawberry\perl\vendor\lib .) at -e line 161. > # END failed--call queue aborted at -e line 969. :: > # End of [430] results > # > # Did pp -o foo.exe "foo.pl" "bar.pl" produce foo.exe? > # ' > # at automated_pp_test.pl line 7115. > t/20-pp.t ................ 5/34 Can't locate PAR/Filter/PodStrip.pm in > @INC (@INC contains: C:\strawberry\perl\vend > or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s > trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line > 754, <_FH> chunk 1. > t/20-pp.t ................ 6/34 Can't locate PAR/Filter/PodStrip.pm in > @INC (@INC contains: C:\strawberry\perl\vend > or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s > trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line > 754, <_FH> chunk 1. > t/20-pp.t ................ 10/34 Can't locate PAR/Filter/PodStrip.pm > in @INC (@INC contains: C:\strawberry\perl\ven > dor\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\ > strawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line > 754, <_FH> chunk 1. > > t/20-pp.t ................ 11/34 # Failed test > 'pp_minus_e_print_hello > # [430] > # Test 11_0 The command string " a.exe " in directory > C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\auto > mated_pp_test\pp_switch_tests\temp2,did not produce :: "hello" :: > # Instead, it produced :: Usage: a.exe [ -Alib.par ] [ -Idir ] [ > -Mmodule ] [ src.par ] [ program.pl ] > # a.exe [ -B|-b ] [-Ooutfile] src.par > # Can't locate File/Temp.pm in @INC (@INC contains: > C:\strawberry\perl\vendor\lib .) at -e line 161. > # END failed--call queue aborted at -e line 969. :: > # End of [430] results > # > # Did pp -e "print \"hello\n\";" produce a.exe? > # ' > # at automated_pp_test.pl line 7495. > [...]
Download (untitled) / with headers
text/plain 6.4k
Cedric, Thanks for your reply. I wasn't aware that PodStrip was splitted, I thought the problem was something else since I was seeing podstrip in the build dir. I ended up installing it in a similar way than the one you described, however I'm seeing more problems, but I'm not sure if they are related: C:\>pp -e "$,=','; print @INC" C:\>a.exe C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\par-Administrator\cache- 502cac0d5b1ad473cfe241cccadb5692950dfaa5\inc,CODE(0x1174 cec),CODE(0x1174fdc) C:\>move strawberry strawberry_ 1 file(s) moved. C:\>a.exe Can't locate PAR/Heavy.pm in @INC (@INC contains: CODE(0xaab61c) C:\strawberry\perl\vendor\lib .) at -e line 345. Thanks, Javier. On Thu Dec 17 19:47:05 2009, colakong wrote: Show quoted text
> Hi Javier, > > I have run into this exact same issue today, while trying to get
PAR Show quoted text
> installed so that I could update the binary of a program a co-
worker of Show quoted text
> mine needed. I don't have a solution to the bug, but I have gotten
a Show quoted text
> work-around in place. > > What you do is: > > 1. Use CPAN in strawberry perl to attempt to install PAR::Packer. > 2. As its running (and failing) the tests, cancel out of the build
with Show quoted text
> Ctrl-C. > 3. Use CPAN in strawberry perl to attempt to install
PAR::Filter::PodStrip. Show quoted text
> 4. When PAR::Filter::PodStrip is running, it'll create a
PodStrip.pm Show quoted text
> file in the build directory. > 5. Cancel out of the build with Ctrl-C. > 6. Search for the PodStrip.pm file in the c:\strawberry directory
(I Show quoted text
> just used windows search), and copy that into a new directory
structure Show quoted text
> that you'll manually create: C:\strawberry\perl\lib\PAR\Filter\ > > Copying the file into that directory will place PodStrip.pm in the
@INC Show quoted text
> path, which is what the PAR::Packer build was complaining about in
the Show quoted text
> first place. > > 8. Use CPAN in strawberry perl to install PAR::Packer. This time
it'll Show quoted text
> succeed. > > > Cedric > > > On Tue Dec 15 13:10:07 2009, javs wrote:
> > I'm using stock strawberry perl 5.8.9.3 on a windows xp vm. I'm
seeing Show quoted text
> > a lot of similar fails while running tests for the module
(output Show quoted text
> > below). I've seen the same behavior on strawberry perl 5.10.1.0.
I'm Show quoted text
> > not sure what to look at here, any help would be appreciated. > > > > Thanks in advance. > > > > t/20-pp.t ................ Can't locate PAR/Filter/PodStrip.pm
in @INC Show quoted text
> > (@INC contains: C:\strawberry\perl\vendor\li > > b . C:\strawberry\perl\lib C:\strawberry\perl\lib > > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib
C:\strawb Show quoted text
> > erry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e line
754, Show quoted text
> > <_FH> chunk 1. > > > > t/20-pp.t ................ 1/34 # Failed test 'pp_hello_1 > > # [430] > > # Test 1_0 The command string " a.exe " in directory > > C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\autom > > ated_pp_test\pp_switch_tests\temp1,did not produce :: "hello" :: > > # Instead, it produced :: Usage: a.exe [ -Alib.par ] [ -Idir ] [ > > -Mmodule ] [ src.par ] [ program.pl ] > > # a.exe [ -B|-b ] [-Ooutfile] src.par > > # Can't locate File/Temp.pm in @INC (@INC contains: > > C:\strawberry\perl\vendor\lib .) at -e line 161. > > # END failed--call queue aborted at -e line 969. :: > > # End of [430] results > > # > > # Did pp "hello.pl" produce a.exe? > > # ' > > # at automated_pp_test.pl line 7022. > > Can't locate PAR/Filter/PodStrip.pm in @INC (@INC contains: > > C:\strawberry\perl\vendor\lib . C:\strawberry\perl\lib > > C:\strawberry\perl\lib C:\strawberry\perl\site\lib > > C:\strawberry\perl\site\lib C:\strawberry\perl\vendor\lib C:\str > > awberry\perl\vendor\lib) at -e line 754, <_FH> chunk 1. > > t/20-pp.t ................ 2/34 Can't locate
PAR/Filter/PodStrip.pm in Show quoted text
> > @INC (@INC contains: C:\strawberry\perl\vend > > or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s > > trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e
line Show quoted text
> > 754, <_FH> chunk 1. > > > > t/20-pp.t ................ 3/34 # Failed test > > 'pp_minus_o_foo_foo_dot_pl_bar_dot_pl > > # [430] > > # Test 3_0 The command string " foo.exe " in directory > > C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\aut > > omated_pp_test\pp_switch_tests\temp0,did not produce :: "hello
foo" :: Show quoted text
> > # Instead, it produced :: Usage: foo.exe [ -Alib.par ] [ -Idir ]
[ Show quoted text
> > -Mmodule ] [ src.par ] [ program.pl ] > > # foo.exe [ -B|-b ] [-Ooutfile] src.par > > # Can't locate File/Temp.pm in @INC (@INC contains: > > C:\strawberry\perl\vendor\lib .) at -e line 161. > > # END failed--call queue aborted at -e line 969. :: > > # End of [430] results > > # > > # Did pp -o foo.exe "foo.pl" "bar.pl" produce foo.exe? > > # ' > > # at automated_pp_test.pl line 7115. > > t/20-pp.t ................ 5/34 Can't locate
PAR/Filter/PodStrip.pm in Show quoted text
> > @INC (@INC contains: C:\strawberry\perl\vend > > or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s > > trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e
line Show quoted text
> > 754, <_FH> chunk 1. > > t/20-pp.t ................ 6/34 Can't locate
PAR/Filter/PodStrip.pm in Show quoted text
> > @INC (@INC contains: C:\strawberry\perl\vend > > or\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\s > > trawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e
line Show quoted text
> > 754, <_FH> chunk 1. > > t/20-pp.t ................ 10/34 Can't locate
PAR/Filter/PodStrip.pm Show quoted text
> > in @INC (@INC contains: C:\strawberry\perl\ven > > dor\lib . C:\strawberry\perl\lib C:\strawberry\perl\lib > > C:\strawberry\perl\site\lib C:\strawberry\perl\site\lib C:\ > > strawberry\perl\vendor\lib C:\strawberry\perl\vendor\lib) at -e
line Show quoted text
> > 754, <_FH> chunk 1. > > > > t/20-pp.t ................ 11/34 # Failed test > > 'pp_minus_e_print_hello > > # [430] > > # Test 11_0 The command string " a.exe " in directory > > C:\strawberry\cpan\build\PAR-Packer-1.001-AEzo6Y\contrib\auto > > mated_pp_test\pp_switch_tests\temp2,did not produce :: "hello"
:: Show quoted text
> > # Instead, it produced :: Usage: a.exe [ -Alib.par ] [ -Idir ] [ > > -Mmodule ] [ src.par ] [ program.pl ] > > # a.exe [ -B|-b ] [-Ooutfile] src.par > > # Can't locate File/Temp.pm in @INC (@INC contains: > > C:\strawberry\perl\vendor\lib .) at -e line 161. > > # END failed--call queue aborted at -e line 969. :: > > # End of [430] results > > # > > # Did pp -e "print \"hello\n\";" produce a.exe? > > # ' > > # at automated_pp_test.pl line 7495. > > [...]
> >
I have the same problem on Strawberry Perl 5.10.1.0.

The problem occurs in the "require PAR::Filter::PodStrip" statement in script/par.pl's require_modules() sub.

It arises because par_init_env (inside myldr/utils.c), which is called in a BEGIN block in script/par.pl, clears several environment variables, including $ENV{PERL5LIB}. This breaks the two tests that try to pass down blib/lib to child processes through $PERL5LIB.

I've attached a patch. It modifies script/par.pl and the two tests. The patched script/par.pl tests for an additional env var, PAR_PACKER_TEST_INC, that is only set in the test scripts, and extracts and uses it (i.e. prepends it to @INC) if it's defined.
Subject: PAR-Packer-1.002.patch
diff -uwbr PAR-Packer-orig/script/par.pl PAR-Packer-new/script/par.pl --- PAR-Packer-orig/script/par.pl 2009-09-13 16:13:47.000000000 +0100 +++ PAR-Packer-new/script/par.pl 2010-01-05 06:30:42.000000000 +0000 @@ -937,6 +937,11 @@ } sub init_inc { + # fix for rt #52794 + if (defined $ENV{PAR_PACKER_TEST_INC}) { + push @INC, $ENV{PAR_PACKER_TEST_INC}; + } + require Config; push @INC, grep defined, map $Config::Config{$_}, qw( archlibexp privlibexp sitearchexp sitelibexp diff -uwbr PAR-Packer-orig/t/20-pp.t PAR-Packer-new/t/20-pp.t --- PAR-Packer-orig/t/20-pp.t 2009-09-13 16:13:47.000000000 +0100 +++ PAR-Packer-new/t/20-pp.t 2010-01-05 06:28:14.000000000 +0000 @@ -81,6 +81,11 @@ $ENV{PERL5LIB}, ); +# rt #52794 +# script/par.pl calls Internals::PAR::_par_init_env, which unsets $ENV{PERL5LIB}, +# which clobbers the blib/lib path. Pass it in via a test-specific env var instead. +$ENV{PAR_PACKER_TEST_INC} = File::Spec->catdir($cwd, 'blib', 'lib'); + chdir $test_dir; do "automated_pp_test.pl"; diff -uwbr PAR-Packer-orig/t/30-current_exec.t PAR-Packer-new/t/30-current_exec.t --- PAR-Packer-orig/t/30-current_exec.t 2009-09-13 16:13:47.000000000 +0100 +++ PAR-Packer-new/t/30-current_exec.t 2010-01-05 06:29:40.000000000 +0000 @@ -21,10 +21,12 @@ my $sep = $Config{path_sep}; $sep = ':' if not defined $sep; -$blib_lib .= $sep if $ENV{PERL5LIB}; -$ENV{PERL5LIB} = defined($ENV{PERL5LIB}) ? $blib_lib . $ENV{PERL5LIB} : $blib_lib; - +$ENV{PERL5LIB} = defined($ENV{PERL5LIB}) ? $blib_lib . $sep . $ENV{PERL5LIB} : $blib_lib; +# rt #52794 +# script/par.pl calls Internals::PAR::_par_init_env, which unsets $ENV{PERL5LIB}, +# which clobbers the blib/lib path. Pass it in via a test-specific env var instead. +$ENV{PAR_PACKER_TEST_INC} = $blib_lib; #### unlink $EXEC if -f $EXEC;
From: snaury [...] gmail.com
Download (untitled) / with headers
text/plain 1.2k
I think I found what's going on. Strawberry Perl 5.10.1 switched to using perl/vendor/lib, but it uses backslashes for vendor in @INC, i.e.: C:/strawberry/perl/lib C:/strawberry/perl/site/lib C:\strawberry\perl\vendor\lib . There's a line in scripts/par.pl that reads like this: if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc } Thus transforming backslashes to forward slashes. However later on, when processing %files (based on %:: and %INC), it fails to take into account that pathnames there are based on what's in @INC, meaning e.g. PAR/Heavy.pm will have pathname C:\strawberry\perl\vendor\lib/PAR/Heavy.pm. It fails to match against C:/strawberry/perl/vendor. This means that anything that's in vendor/lib will never be packed. As a matter of fact anything that has backslashes in their path will never be packed, including -I blib\lib. Guess what I see in test_harness line when running test PAR::Packer? I see blib\lib, and that's why you are having a failure. This makes me wonder what's this line there for? Just removing it passes all tests and pp becomes fully functional again (i.e. generated executables don't suddenly depend on strawberry installed). Was there something changed in 5.10.1 that made backslashes in @INC work differently?
From: snaury [...] gmail.com
Download (untitled) / with headers
text/plain 735b
On Tue Jan 05 01:59:53 2010, CHOCOLATE wrote: Show quoted text
> I've attached a patch. It modifies script/par.pl and the two tests. > The patched > script/par.pl tests for an additional env var, PAR_PACKER_TEST_INC, > that is > only set in the test scripts, and extracts and uses it (i.e. prepends > it to > @INC) if it's defined.
Unfortunately your patch changes logic completely, since the problem is that neither PAR/Heavy.pm nor PAR/Filter/PodStrip.pm are embedded in the executable. You might as well install it with notest, and when you later try testing, it will suddenly work (because it will pull modules from system perl). Unfortunately it doesn't fix the problem as files generated with pp are defunct and always depend on system perl.
Download (untitled) / with headers
text/plain 761b
On Wed Jan 20 17:34:29 2010, snaury wrote: Show quoted text
> I think I found what's going on. Strawberry Perl 5.10.1 switched to > using perl/vendor/lib, but > it uses backslashes for vendor in @INC, i.e.: > > C:/strawberry/perl/lib > C:/strawberry/perl/site/lib > C:\strawberry\perl\vendor\lib > . > > There's a line in scripts/par.pl that reads like this: > > if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc } > > Thus transforming backslashes to forward slashes. However later on, > when processing %files > (based on %:: and %INC), it fails to take into account that pathnames > there are based on
Good spotting. Then we should "canonicalize" keys %files in the same way as the members of @inc. Can someone that is able to reproduce this bug try the attached patch?
Subject: 52407.patch
Download 52407.patch
text/x-diff 2.2k
--- PAR-Packer-1.001/myldr/mktmpdir.c 2009-11-13 09:29:29.000000000 +0100 +++ PAR-Packer-1.001/myldr/mktmpdir.c.fixed 2009-12-06 17:38:29.000000000 +0100 @@ -65,7 +65,7 @@ const char *subdirbuf_suffix = ""; char *progname = NULL, *username = NULL; - char *stmpdir = NULL; + char *stmpdir = NULL, *stmpdir2 = NULL; int f, j, k, stmp_len = 0; char sha1[41]; SHA_INFO sha_info; @@ -150,8 +150,9 @@ need 2 buffers because snprintf() can't write to a buffer it's reading from. */ stmpdir = malloc( stmp_len ); - sprintf(stmpdir, "%s%s%s%s", tmpdir, dir_sep, subdirbuf_prefix, username); - my_mkdir(stmpdir, 0755); + stmpdir2 = malloc( stmp_len ); + sprintf(stmpdir2, "%s%s%s%s", tmpdir, dir_sep, subdirbuf_prefix, username); + my_mkdir(stmpdir2, 0755); /* Doesn't really work - XXX */ val = (char *)par_getenv( "PATH" ); @@ -194,7 +195,7 @@ sprintf( stmpdir, "%s%scache-%s%s", - stmpdir, dir_sep, buf, subdirbuf_suffix + stmpdir2, dir_sep, buf, subdirbuf_suffix ); } else { @@ -215,13 +216,12 @@ sprintf( stmpdir, "%s%scache-%s%s", - stmpdir, dir_sep, sha1, subdirbuf_suffix + stmpdir2, dir_sep, sha1, subdirbuf_suffix ); } } else { int i = 0; - size_t len = strlen(stmpdir); /* "$TEMP/par-$USER/temp-$PID" */ @@ -229,7 +229,7 @@ sprintf( stmpdir, "%s%stemp-%u%s", - stmpdir, dir_sep, getpid(), subdirbuf_suffix + stmpdir2, dir_sep, getpid(), subdirbuf_suffix ); /* Ensure we pick an unused directory each time. If the directory @@ -239,15 +239,16 @@ might interfere. */ while (my_mkdir(stmpdir, 0755) == -1 && errno == EEXIST) { - stmpdir[len] = 0; sprintf( stmpdir, "%s%stemp-%u-%u%s", - stmpdir, dir_sep, getpid(), ++i, subdirbuf_suffix + stmpdir2, dir_sep, getpid(), ++i, subdirbuf_suffix ); } } + free(stmpdir2); + /* set dynamic loading path */ par_setenv(PAR_TEMP, stmpdir);
From: snaury [...] gmail.com
Download (untitled) / with headers
text/plain 1.2k
Чтв Янв 21 08:26:05 2010, RSCHUPP писал: Show quoted text
> Then we should "canonicalize" keys %files in the same way as > the members of @inc. Can someone that is able to reproduce this bug > try the attached patch?
Hmm? The patch you attached is just what changed between PAR-Packer 1.001 and 1.002, and this bug happens on both. Also, I don't know if I'm doing it wrong, but when I try to s{\\}{/}g on $_ it works while packing files, but then later when executing them it fails with errors like this: Can't locate loadable object for module IO in @INC (@INC contains: CODE (0xc1f934) C:\strawberry\perl\vendor\lib .) at C:/strawberry/perl/vendor/lib/PAR/Heavy.pm line 103 Compilation failed in require at C:/strawberry/perl/lib/IO/Handle.pm line 266. BEGIN failed--compilation aborted at C:/strawberry/perl/lib/IO/Handle.pm line 266. Compilation failed in require at C:/strawberry/perl/lib/IO/Seekable.pm line 101. BEGIN failed--compilation aborted at C:/strawberry/perl/lib/IO/Seekable.pm line 101. Compilation failed in require at C:/strawberry/perl/lib/IO/File.pm line 133. BEGIN failed--compilation aborted at C:/strawberry/perl/lib/IO/File.pm line 133. Compilation failed in require at -e line 351. See canon-files.patch, why is it happening?
Subject: canon-files.patch
Download canon-files.patch
text/x-diff 344b
diff --git a/script/par.pl b/script/par.pl index e54c064..f47e6ba 100644 --- a/script/par.pl +++ b/script/par.pl @@ -553,6 +553,7 @@ if ($out) { my %written; foreach (sort keys %files) { + s{\\}{/}g if (!ref($_) && $Config{_delim} eq '\\'); my ($name, $file); foreach my $dir (@inc) {
From: snaury [...] gmail.com
Download (untitled) / with headers
text/plain 374b
Also, I must say this again: attached patch fixes the problem for me on Strawberry Perl 5.10.1: all tests pass, generated executables run, even when I move C:\strawberry away (i.e. it truly doesn't depend on system perl anymore). What makes me wonder is if this patch introduces problems for older versions of Perl? I.e. do we really need to canonicalize paths in @inc?
Subject: proper-fix.patch
Download proper-fix.patch
text/x-diff 481b
diff --git a/script/par.pl b/script/par.pl index e54c064..330565c 100644 --- a/script/par.pl +++ b/script/par.pl @@ -538,8 +538,6 @@ if ($out) { $_ ne $Config::Config{privlibexp}); } @INC; - if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc } - # File exists test added to fix RT #41790: # Funny, non-existing entry in _<....auto/Compress/Raw/Zlib/autosplit.ix. # This is a band-aid fix with no deeper grasp of the issue.
Download (untitled) / with headers
text/plain 942b
On Fri Jan 22 05:42:25 2010, snaury wrote: Show quoted text
> Hmm? The patch you attached is just what changed between PAR-Packer > 1.001 and 1.002, and this bug happens on both. Also, I don't know if
Ah, grabbed the wrong patch from my disk :( I've now attached the intended one, but that's almost the same as your canon-files.patch. Show quoted text
> I'm doing it wrong, but when I try to s{\\}{/}g on $_ it works while > packing files, but then later when executing them it fails with errors > like this: > > Can't locate loadable object for module IO in @INC (@INC contains: CODE > (0xc1f934) C:\strawberry\perl\vendor\lib .) at
Don't know what's happening here either (and don't have an environment to test), but @INC is already wrong: C:\strawberry\perl\vendor\lib shouldn't be there - @INC of a packed executable should only contain directories below the cache area, like c:/temp/par-USER/SHA1/..., and code refs. Perhaps another slash vs backslash issue?
Subject: 52794.patch
Download 52794.patch
text/x-diff 457b
--- script/par.pl.orig 2010-01-21 13:55:04.000000000 +0100 +++ script/par.pl 2010-01-21 14:11:04.000000000 +0100 @@ -549,6 +549,11 @@ /^_<(.+)$/ and -e $1 and $files{$1}++ for keys %::; $files{$_}++ for values %INC; + # Canonicalize keys %files in the same way as @inc. + if ($Config{_delim} eq '\\') { + %files = map { s{\\}{/}g; ($_, 1) } keys %files; + } + my $lib_ext = $Config::Config{lib_ext}; my %written;
From: snaury [...] gmail.com
Download (untitled) / with headers
text/plain 773b
Птн Янв 22 05:48:14 2010, snaury писал: Show quoted text
> What makes me wonder is if this patch introduces problems for older > versions of Perl? I.e. do we really need to canonicalize paths in
@inc? I just tested this with Strawberry Perl 5.10.0.6 and this problem also occured. Since I could remember that I installed PAR::Packer before I went to my sources cache and found version 0.991, which indeed doesn't have this problem. I went thru archives and found this bug first appeared in 0.992_04. One notable difference is that for the first time myldr/utils.c unsets a bunch of PERL* environment variables, ensuring that it does not depend on system perl. So maybe this bug with backslashes was there for a very long time, suddenly starting to cause test failures.
From: snaury [...] gmail.com
Птн Янв 22 06:28:38 2010, snaury писал: Show quoted text
> So maybe this bug with backslashes was there for a very long time, > suddenly starting to cause test failures.
Ok, I did some more tests and to recap what was and is going on: - As far back as pp 0.991 it failed to pack files with backslashes in its path, but it until 0.992_04 it didn't show up in tests, because PERL* variables weren't cleared and test executables picked up from blib/lib (path to blib/lib during test has lots of backslashes) - With Strawberry 5.10.0, once pp is installed, it appeared to sort of work, since @INC typically contained forward slashes only and all needed files were packed - With Strawberry 5.10.1 path to vendor has backslashes and generated executables no longer pack PAR/Heavy.pm, among other things, leading to completely useless executables. Even though 0.991 doesn't fail tests, problems are really visible on packed executables, since they don't work without Strawberry Perl anymore. I will try testing it with Perl 5.8, but now I really don't think s{\\} {/} is needed for @inc.
From: m.nooning [...] comcast.net
Download (untitled) / with headers
text/plain 1.9k
<code> I am betting you have not installed PAR::Packer before, or you have a clean Perl install. PAR Packer will not install on a clean Windows Perl 5.10.1 installation. I think there are two problems. First, it has a circular reference to PAR/Filter/PodStrip.pm. That is, PAR.pl needs it in a number of places. However, it is installed along with PAR itself. Once PAR is installed at least once, that problem goes away because the tests can then find PAR/Filter/PodStrip.pm in the normal places. The first problem above masks the second. Namely, that one of the t/20 tests has a test failure when using Win32/Exe.pm. It masks the failure because the t/20 tests do not run with the first problem. Let me explain. Most of the t/20 tests use the pp command to create an executable that, when run, prints out something like "Hello". The tests are therefore looking for such responses. However, in addition to things like Hello, ithe tests are getting back things like "Can't locate PAR/Filter/PodStrip.pm", which causes the test to fail. Since so many fail, we never get to see the "Win32/Exe.pm" failure. Or at least, with all the other error messages, we do not spot it. I installed with force so that PAR/Filter/PodStrip.pm was installed. Upon rerun, all the t/20 tests pass but the Win32/Exe.pm I will paste the relevent parts of the results below. C:\temp\PAR-Packer-1.002>dmake test ... etcetera, etcetera, ... t/10-parl-generation.t ... ok t/20-pp.t ................ 31/34 Can't call method "remove" on an undefined value at C:/Perl/site/lib/Win32/Exe.pm line 220. # Failed test 'pp_gui_tests t/20-pp.t ................ 32/34 # amsg572: sub pp_gui_tests cannot system pp --gui --icon hi.ico -o hello.exe hello.pl:No such file or directory: # ' # at automated_pp_test.pl line 8446. t/20-pp.t ................ 34/34 # Looks like you failed 1 test of 34. t/20-pp.t ................ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/34 subtests t/30-current_exec.t ... etcetera, etcetera, ... </code>
From: snaury [...] gmail.com
Download (untitled) / with headers
text/plain 1.2k
Чтв Янв 28 14:39:49 2010, m.nooning@comcast.net писал: Show quoted text
> I am betting you have not installed PAR::Packer before, or you have a > clean Perl install. > PAR Packer will not install on a clean Windows Perl 5.10.1
installation. Show quoted text
> > I think there are two problems. First, it has a circular reference to > PAR/Filter/PodStrip.pm. That is, PAR.pl needs it in a number of
places. You seem to misunderstand the issue. There are no circular dependencies like that. The problem is that it should pack this file into the executable, but it doesn't (on Strawberry Perl) due to backslashes in $INC. And we didn't see this error on earlier versions, because earlier versions didn't clear PERL5LIB/etc. Show quoted text
> I installed with force so that PAR/Filter/PodStrip.pm was installed. > Upon rerun, all the t/20 tests pass but the Win32/Exe.pm
When you install with force you are just masking the issue. You are installing PAR::Packer into site and it means that now when testing it picks PAR/Filter/PodStrip.pm from site instead of blib, but it still fails to pack PAR itself (PAR/Heavy.pm), that's installed in vendor (with backslashes). Yes, executables will work on your machine, but will fail to work on any other machine that doesn't have Strawberry Perl installed.
Subject: [rt.cpan.org #52794] Multiple tests failing on strawberry perl
Date: Wed, 7 Apr 2010 10:07:55 -0400
To: <bug-PAR-Packer [...] rt.cpan.org>
From: John.Pfeiffer [...] L-3Com.com
Download (untitled) / with headers
text/plain 215b
Hello, Thank you so much for this helpful post. I spent an entire day trying to get PAR::Packer installed before I found this thread. I used your patch and everything appears to work. Thanks, Andy Pfeiffer
Download (untitled) / with headers
text/plain 142b
Finally applied Alexey Borzenkov's patch, since this problem has already caused several tickets and nobody has demonstrated evil side effects.


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.