Skip Menu |

This queue is for tickets about the HTML-Template-Pro CPAN distribution.

Report information
The Basics
Id: 51218
Status: resolved
Priority: 0/
Queue: HTML-Template-Pro

People
Owner: Nobody in particular
Requestors: cnighswonger [...] foundations.edu
Cc:
AdminCc:

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



Subject: built-in find_file pro.xs
T::P build under Strawberry 10.0.1 on Win32 fails HTML-Template.t. It appears to be an issue with pathing and a built in 'file_find' function. Let me know if you need anything else. Chris ----------------------- C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\t>perl HTML-Template.t ok 1 - use HTML::Template::Pro; built-in find_file: can't find file simple.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 2 Died at HTML-Template.t line 19. 1..2 # Looks like your test exited with 2 just after 2. C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\t>perl HTML-Template.t ok 1 - use HTML::Template::Pro; built-in find_file: can't find file simple.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 2 built-in find_file: can't find file medium.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 3 built-in find_file: can't find file simple-loop.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 4 # Failed test at HTML-Template.t line 61. built-in find_file: can't find file simple-loop-nonames.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 5 # Failed test at HTML-Template.t line 72. built-in find_file: can't find file long_loops.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 6 built-in find_file: can't find file include.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 7 # Failed test at HTML-Template.t line 90. built-in find_file: can't find file include.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 8 # Failed test at HTML-Template.t line 101. built-in find_file: can't find file include.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 9 # Failed test at HTML-Template.t line 114. built-in find_file: can't find file simple.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 10 # Failed test at HTML-Template.t line 132. built-in find_file: can't find file other-loop.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 11 built-in find_file: can't find file if.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 12 built-in find_file: can't find file if.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 13 # Failed test at HTML-Template.t line 166. built-in find_file: can't find file ifelse.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 14 # Failed test at HTML-Template.t line 176. built-in find_file: can't find file ifelse.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 15 # Failed test at HTML-Template.t line 187. built-in find_file: can't find file double_loop.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 16 # Failed test at HTML-Template.t line 202. built-in find_file: can't find file escape.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 17 built-in find_file: can't find file simple.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 18 # Failed test at HTML-Template.t line 227. ok 19 # skip Skipping die test. Not supported in Pro # built-in find_file: can't find file unless.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 20 # Failed test at HTML-Template.t line 254. built-in find_file: can't find file unless.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 21 # Failed test at HTML-Template.t line 266. built-in find_file: can't find file context.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 22 # Failed test at HTML-Template.t line 286. built-in find_file: can't find file loop-if.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 23 # Failed test at HTML-Template.t line 295. built-in find_file: can't find file loop-if.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 24 ok 25 # skip Skipping shared memory cache test. See README to enable # ok 26 # skip Skipping shared memory cache test. See README to enable # built-in find_file: can't find file simple.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 27 # Failed test at HTML-Template.t line 371. built-in find_file: can't find file simple.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 28 # Failed test at HTML-Template.t line 382. built-in find_file: can't find file simple.tmpl with path = [ 'templates/' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 29 # Failed test at HTML-Template.t line 401. built-in find_file: can't find file urlescape.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. ok 30 ok 31 # skip Skipping query test. Not supported in Pro # ok 32 # skip Skipping query test. Not supported in Pro # built-in find_file: can't find file globals.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 33 # Failed test at HTML-Template.t line 457. ok 34 # skip Skipping vanguard test. Not supported in Pro # built-in find_file: can't find file loop-context.tmpl with path = [ 'templates' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 35 # Failed test at HTML-Template.t line 480. built-in find_file: can't find file include.tmpl with path = [ 'templates/searchpath/' 'templates/' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 36 # Failed test at HTML-Template.t line 490. ok 37 # skip Skipping die test. Not supported in Pro # built-in find_file: can't find file simple.tmpl with path = [ 'templates/' ] Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 38 # Failed test at HTML-Template.t line 525. built-in find_file: can't find file templates/simple-loop.tmpl with empty path list Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 39 # Failed test at HTML-Template.t line 545. built-in find_file: can't find file ./templates/include_path/a.tmpl with empty path list Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. not ok 40 # Failed test at HTML-Template.t line 549. No such file or directory at HTML-Template.t line 551. 1..40 # Looks like you failed 24 tests of 40. # Looks like your test exited with 2 just after 40. C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\t>
Show quoted text
> C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\t>perl > HTML-Template.t
You are showing me an invalid command :( there is no 'templates' dir in t, isn't it? try perl t/HTML-Template.t from upper level directory.
Пнд. Ноя. 09 06:27:09 2009, VIY писал: Show quoted text
> > C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\t>perl > > HTML-Template.t
> You are showing me an invalid command :( > there is no 'templates' dir in t, isn't it? > try perl t/HTML-Template.t from upper level directory.
If everything is OK, feel free to report.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Mon, 9 Nov 2009 08:01:12 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
Hi Igor, On Mon, Nov 9, 2009 at 6:49 AM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > Пнд. Ноя. 09 06:27:09 2009, VIY писал:
>> > C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\t>perl >> > HTML-Template.t
>> You are showing me an invalid command :( >> there is no 'templates' dir in t, isn't it? >> try perl t/HTML-Template.t from upper level directory.
> > If everything is OK, feel free to report.
The test fails the same way when run via 'dmake test' I'll be glad to supply output if you would like it later this evening as I'm not near my win32 machine atm. Kind Regards, Chris
The test fails the same way when run via 'dmake test' I'll be glad to supply output if you would like it later this evening as I'm not near my win32 machine atm.
Пнд. Ноя. 09 08:02:31 2009, cnighswonger писал: Show quoted text
> The test fails the same way when run via 'dmake test' > > I'll be glad to supply output if you would like it later this evening > as I'm not near my win32 machine atm.
Тhank you. Please, try it then from project root directory. This test should be run from project root directory only. It is expected that it fails if called from somewhere else.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Mon, 9 Nov 2009 10:03:47 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Mon, Nov 9, 2009 at 9:10 AM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > Пнд. Ноя. 09 08:02:31 2009, cnighswonger писал:
>> The test fails the same way when run via 'dmake test' >> >> I'll be glad to supply output if you would like it later this evening >> as I'm not near my win32 machine atm.
> > Тhank you. Please, try it then from project root directory. > > This test should be run from project root directory only. > It is expected that it fails if called from somewhere else.
Thanks for the assistance. As mentioned above, the test fails when run via 'dmake test'. Here is the output: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm>dmake test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\ar ch')" t/*.t t/01coderefs.t .................. ok t/02basic.t ..................... ok t/02random.t .................... ok t/03complex.t ................... ok t/04register.t .................. ok t/05path_like_variable_scope.t .. ok t/HTML-Template-Expr.t .......... ok t/HTML-Template-Pro.t ........... ok t/HTML-Template.t ............... 1/? built-in find_file: can't find file three.tmpl with path = [ ' searchpath' ] Pro.xs: non-zero exit code 2 at C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\blib\lib/HTML /Template/Pro.pm line 198. # Failed test at t/HTML-Template.t line 736. # Looks like you failed 1 test of 74. t/HTML-Template.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/74 subtests (less 9 skipped subtests: 64 okay) t/magic.t ....................... ok t/pod.t ......................... ok t/realloc.t ..................... ok Test Summary Report ------------------- t/HTML-Template.t (Wstat: 256 Tests: 74 Failed: 1) Failed test: 56 Non-zero exit status: 1 Files=12, Tests=475, 5 wallclock secs ( 0.19 usr + 0.06 sys = 0.25 CPU) Result: FAIL Failed 1/12 test programs. 1/475 subtests failed. dmake: Error code 255, while making 'test_dynamic' C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm>
thank you! It is definitely a bug. I'd also like to ask you to provide output from modified HTML-Template.t just, please, add 'verbose' option. diff --git a/t/HTML-Template.t b/t/HTML-Template.t index 73189dc..e5fd74a 100644 --- a/t/HTML-Template.t +++ b/t/HTML-Template.t @@ -729,6 +729,7 @@ ok($output =~ /ONE/ and $output =~ /TWO/ and $output =~ /THREE/); { local $ENV{HTML_TEMPLATE_ROOT} = "templates"; $template = HTML::Template->new( + verbose => 7, path => ['searchpath'], filename => 'three.tmpl', );
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Mon, 9 Nov 2009 10:50:25 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Mon, Nov 9, 2009 at 10:15 AM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > thank you! It is definitely a bug. > I'd also like to ask you to provide output from modified HTML-Template.t > just, please, add 'verbose' option. > > diff --git a/t/HTML-Template.t b/t/HTML-Template.t > index 73189dc..e5fd74a 100644 > --- a/t/HTML-Template.t > +++ b/t/HTML-Template.t > @@ -729,6 +729,7 @@ ok($output =~ /ONE/ and $output =~ /TWO/ and $output > =~ /THREE/); >  { >     local $ENV{HTML_TEMPLATE_ROOT} = "templates"; >     $template = HTML::Template->new( > +                                    verbose => 7, >                                     path => ['searchpath'], >                                     filename => 'three.tmpl', >                                    ); >
I added the requested line and here is the output: (though it looks the same to me...) C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm>dmake test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\ar ch')" t/*.t t/01coderefs.t .................. ok t/02basic.t ..................... ok t/02random.t .................... ok t/03complex.t ................... ok t/04register.t .................. ok t/05path_like_variable_scope.t .. ok t/HTML-Template-Expr.t .......... ok t/HTML-Template-Pro.t ........... ok t/HTML-Template.t ............... 1/? built-in find_file: can't find file three.tmpl with path = [ ' searchpath' ] Pro.xs: non-zero exit code 2 at C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm\blib\lib/HTML /Template/Pro.pm line 198. # Failed test at t/HTML-Template.t line 737. # Looks like you failed 1 test of 74. t/HTML-Template.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/74 subtests (less 9 skipped subtests: 64 okay) t/magic.t ....................... ok t/pod.t ......................... ok t/realloc.t ..................... ok Test Summary Report ------------------- t/HTML-Template.t (Wstat: 256 Tests: 74 Failed: 1) Failed test: 56 Non-zero exit status: 1 Files=12, Tests=475, 3 wallclock secs ( 0.33 usr + 0.06 sys = 0.39 CPU) Result: FAIL Failed 1/12 test programs. 1/475 subtests failed. dmake: Error code 255, while making 'test_dynamic' C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm>
sorry for the delay, the bug seems to be specific to win32 platform. Still I am uncertan what it is, either it is some kind of memory corruption or an error in find_file under win32. the suspictious part is that it looks like there is a strange newline before searchpath. Please, try the shortened version of the test with the only test that failed (I attached it). Also, I would like to try reproducing the bug. I have VirtualBox emulator. could you give me links how to set up win32 mashine to build a module for Strawberry perl?
#!/usr/bin/perl -w use strict; use Test::More qw(no_plan); use_ok('HTML::Template::Pro'); my ($output, $template, $result); # test using HTML_TEMPLATE_ROOT with path { local $ENV{HTML_TEMPLATE_ROOT} = "templates"; $template = HTML::Template->new( verbose => 7, path => ['searchpath'], filename => 'three.tmpl', ); $output = $template->output; ok($output =~ /THREE/); }
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Tue, 10 Nov 2009 18:41:37 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
Hi Igor, On Tue, Nov 10, 2009 at 12:32 PM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > sorry for the delay, the bug seems to be specific to win32 platform. > Still I am uncertan what it is, either it is some kind of > memory corruption or an error in find_file under win32. > the suspictious part is that it looks like there is a strange newline > before searchpath.
It must be a regression as T::P 0.70 works fine. I'll try to do a binary search to locate when the bug was introduced. Show quoted text
> > Please, try the shortened version of the test with the only test that > failed (I attached it).
This test alone works fine. Here's the output: C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm>perl t/HTML-Template-2.t ok 1 - use HTML::Template::Pro; ok 2 1..2 C:\strawberry\cpan\build\HTML-Template-Pro-0.92-os8Txm> Show quoted text
> > > Also, I would like to try reproducing the bug. I have VirtualBox emulator. > could you give me links how to set up win32 mashine to build a module > for Strawberry perl?
It is very easy to setup. Download and run the following: http://strawberry-perl.googlecode.com/files/strawberry-perl-5.10.1.0.msi Once installed, you should have a menu item for Strawberry Perl. In that menu there is a cpan client. You can start it and install T::P from there. You can also just download and extract the tarball into the c:\strawberry\cpan\build directory. Then open a cmd.exe prompt and cd into the T::P directory. From there you can 'perl Makefile.PL', 'dmake', dmake test', dmake install'. I use WinRAR for extracting tarballs on win32: http://www.rarlab.com/ Let me know if I can do anything else. My C is extremely rusty, so I'll not be much help with the C libraries.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Tue, 10 Nov 2009 20:59:47 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Tue, Nov 10, 2009 at 6:41 PM, Chris Nighswonger <cnighswonger@foundations.edu> wrote: Show quoted text
>> sorry for the delay, the bug seems to be specific to win32 platform. >> Still I am uncertan what it is, either it is some kind of >> memory corruption or an error in find_file under win32. >> the suspictious part is that it looks like there is a strange newline >> before searchpath.
> > It must be a regression as T::P 0.70 works fine. I'll try to do a > binary search to locate when the bug was introduced.
Below is a summary of my tests. It appears that the present bug was introduced during the update from 0.86 to 0.90. There were also issues between 0.75 and 0.86, but I seem to recall some notes in the change.log about a win32 problem that was fixed during that period. 0.90 compiles ok, but fails the same test as 0.92. The test output is below. 0.86 compiles ok and passes all tests 0.83 will not compile complaining about syntax errors in tmplpro.h and Pro.xs 0.82 will not compile complaining about syntax errors in tmplpro.h and Pro.xs 0.81 compiles ok, but fails a test. The output is below. 0.75 compiles ok and passes all tests After further debugging: File_find was disabled in 0.86. At line 468 of Pro.xs I read this comment: " /* enable to use buit-in find_file */" and the if block condition is false. Making the condition true and re-compiling causes 0.86 to fail on exactly the same test as 0.90 and 0.92. So it does indeed seem to be an issue with file_find. More work: I find in the changelog: 0.87 Wed Aug 26 22:08:41 EEST 2009 - perl: by default, built-in find_file implementation is used. the old perl find_file implementation can be re-enabled with __use_perl_find_file option. Please, report any misbehavior of built-in find_file implementation This seems to confirm that the use of the built-in file_find breaks T::P on win32. And if I modify Pro.xs to force the use of the "old perl find_file implementation" (see attached diff) the tests all pass. I hope this helps. 0.90 'dmake test' output: ------------------ C:\strawberry\cpan\build\HTML-Template-Pro-0.90>dmake test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\ar ch')" t/*.t t/01coderefs.t .................. ok t/02basic.t ..................... ok t/02random.t .................... ok t/03complex.t ................... ok t/04register.t .................. ok t/05path_like_variable_scope.t .. ok t/HTML-Template-Expr.t .......... ok t/HTML-Template-Pro.t ........... ok t/HTML-Template.t ............... 1/? built-in find_file: can't find file three.tmpl with path = [ ' searchpath' ] Pro.xs: non-zero exit code 2 at C:\strawberry\cpan\build\HTML-Template-Pro-0.90\blib\lib/HTML/Templa te/Pro.pm line 198. # Failed test at t/HTML-Template.t line 736. # Looks like you failed 1 test of 74. t/HTML-Template.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/74 subtests (less 9 skipped subtests: 64 okay) t/magic.t ....................... ok t/pod.t ......................... ok t/realloc.t ..................... ok Test Summary Report ------------------- t/HTML-Template.t (Wstat: 256 Tests: 74 Failed: 1) Failed test: 56 Non-zero exit status: 1 Files=12, Tests=475, 3 wallclock secs ( 0.25 usr + 0.13 sys = 0.38 CPU) Result: FAIL Failed 1/12 test programs. 1/475 subtests failed. dmake: Error code 255, while making 'test_dynamic' C:\strawberry\cpan\build\HTML-Template-Pro-0.90> ------------------ 0.81 'dmake test' output: ------------------ C:\strawberry\cpan\build\HTML-Template-Pro-0.81>dmake test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\ar ch')" t/*.t t/01coderefs.t .................. ok t/02basic.t ..................... ok t/02random.t .................... ok t/03complex.t ................... ok t/04register.t .................. ok t/05path_like_variable_scope.t .. ok t/HTML-Template-Expr.t .......... 1/21 Comparing files test_expr8.out and TEST_EXPR8.RAW ***** test_expr8.out <b>70</b> <b>200001000000</b> <b>70</b> ***** TEST_EXPR8.RAW <b>70</b> <b>-1862462912</b> <b>70</b> ***** # Failed test 16 in t/HTML-Template-Expr.t at line 88 fail #8 # t/HTML-Template-Expr.t line 88 is: ok (defined $output and $output eq &catfile("$file.out")); t/HTML-Template-Expr.t .......... Failed 2/21 subtests t/HTML-Template-Pro.t ........... ok t/HTML-Template.t ............... ok t/pod.t ......................... ok t/realloc.t ..................... ok Test Summary Report ------------------- t/HTML-Template-Expr.t (Wstat: 0 Tests: 20 Failed: 1) Failed test: 16 Parse errors: Bad plan. You planned 21 tests but ran 20. Files=11, Tests=400, 2 wallclock secs ( 0.17 usr + 0.14 sys = 0.31 CPU) Result: FAIL Failed 1/11 test programs. 1/400 subtests failed. dmake: Error code 255, while making 'test_dynamic' C:\strawberry\cpan\build\HTML-Template-Pro-0.81> ------------------

Message body is not shown because sender requested not to inline it.

so it looks like a memory corruption bug. I am in process of setting up Strawberry perl, thank you for advice, meanwhile the following patch should help (it switches off built-in find_file). diff --git a/lib/HTML/Template/Pro.pm b/lib/HTML/Template/Pro.pm index f6355e7..9367d1a 100644 --- a/lib/HTML/Template/Pro.pm +++ b/lib/HTML/Template/Pro.pm @@ -84,6 +84,7 @@ sub new { associate => [], case_sensitive => 0, __strict_compatibility => 1, + __use_perl_find_file => 1, force_untaint => 0, # ---- unsupported distinct ------- die_on_bad_params => 0,
thank you for help, I successfully installed Strawberry Perl and reproduced the bug. Now just wait for 0.93 release, it will be definitely fixed there.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Wed, 11 Nov 2009 15:46:02 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Wed, Nov 11, 2009 at 3:12 PM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > thank you for help, I successfully installed Strawberry Perl > and reproduced the bug. Now just wait for 0.93 release, > it will be definitely fixed there.
No problem! I'll look forward to 0.93.
Срд. Ноя. 11 15:12:39 2009, VIY писал: Show quoted text
> thank you for help, I successfully installed Strawberry Perl > and reproduced the bug. Now just wait for 0.93 release, > it will be definitely fixed there.
sorry, It is again that I need your help. I found that it is likely due to the Strawberry perl. test below fails, ---------------------------------- #!/usr/bin/perl -w use strict; use Test::More qw(no_plan); use_ok('HTML::Template::Pro'); my ($output, $template, $result); # test using HTML_TEMPLATE_ROOT with path { local $ENV{HTML_TEMPLATE_ROOT} = "templates"; $template = HTML::Template->new( debug => 7, path => ['searchpath'], filename => 'three.tmpl', ); $output = $template->output; ok($output =~ /THREE/); } ------------------------------------- but if I set the variable manually SET HTML_TEMPLATE_ROOT=templates from the command line, it works as expected. So it is the problem of the test itself, namely, both local $ENV{HTML_TEMPLATE_ROOT} = "templates"; and $ENV{HTML_TEMPLATE_ROOT} = "templates"; do not work as expected. Could you recommend me a correct way? Or is it a bug in Strawberry perl?
Чтв. Ноя. 12 09:16:21 2009, VIY писал: Show quoted text
> So it is the problem of the test itself, > namely, both > local $ENV{HTML_TEMPLATE_ROOT} = "templates"; > and > $ENV{HTML_TEMPLATE_ROOT} = "templates"; > do not work as expected. > > Could you recommend me a correct way? > Or is it a bug in Strawberry perl?
The trick there is that the environment variable should be set in perl but the set value should be accessed from C code un.sing getenv function.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Fri, 13 Nov 2009 08:27:37 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Thu, Nov 12, 2009 at 9:19 AM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > Чтв. Ноя. 12 09:16:21 2009, VIY писал:
>> So it is the problem of the test itself, >> namely, both >> local $ENV{HTML_TEMPLATE_ROOT} = "templates"; >> and >> $ENV{HTML_TEMPLATE_ROOT} = "templates"; >> do not work as expected. >> >> Could you recommend me a correct way? >> Or is it a bug in Strawberry perl?
> > The trick there is that the environment variable > should be set in perl but the set value should be accessed > from C code un.sing getenv function. >
Sorry for the delay. I'm going to try to get some of the guys from the Strawberry project to take a look at this.
On Fri Nov 13 08:28:12 2009, cnighswonger wrote: Show quoted text
> On Thu, Nov 12, 2009 at 9:19 AM, Igor Yu. Vlasenko via RT > <bug-HTML-Template-Pro@rt.cpan.org> wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > > > Чтв. Ноя. 12 09:16:21 2009, VIY писал:
> >> So it is the problem of the test itself, > >> namely, both > >> local $ENV{HTML_TEMPLATE_ROOT} = "templates"; > >> and > >> $ENV{HTML_TEMPLATE_ROOT} = "templates"; > >> do not work as expected. > >> > >> Could you recommend me a correct way? > >> Or is it a bug in Strawberry perl?
> > > > The trick there is that the environment variable > > should be set in perl but the set value should be accessed > > from C code un.sing getenv function. > >
> > Sorry for the delay. > > I'm going to try to get some of the guys from the Strawberry project > to take a look at this.
They say the getenv should work as you expect. I notice that if I run 'perl t/HTML-Template.t' alone all tests pass fine. However, going on and installing T::P with the built-in find_file function results in failures during usage. So there must be some subtle bug. I'll keep hacking at it. Maybe it will show up. For now, compiling T::P without the built-in file_find function is an acceptable work-around.
On Sat Nov 14 12:11:46 2009, cnighswonger wrote: Show quoted text
> On Fri Nov 13 08:28:12 2009, cnighswonger wrote:
> > On Thu, Nov 12, 2009 at 9:19 AM, Igor Yu. Vlasenko via RT > > <bug-HTML-Template-Pro@rt.cpan.org> wrote:
> > > <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > > > > > Чтв. Ноя. 12 09:16:21 2009, VIY писал:
> > >> So it is the problem of the test itself, > > >> namely, both > > >> local $ENV{HTML_TEMPLATE_ROOT} = "templates"; > > >> and > > >> $ENV{HTML_TEMPLATE_ROOT} = "templates"; > > >> do not work as expected. > > >> > > >> Could you recommend me a correct way? > > >> Or is it a bug in Strawberry perl?
> > > > > > The trick there is that the environment variable > > > should be set in perl but the set value should be accessed > > > from C code un.sing getenv function. > > >
> > > > Sorry for the delay. > > > > I'm going to try to get some of the guys from the Strawberry project > > to take a look at this.
> > > They say the getenv should work as you expect. > > I notice that if I run 'perl t/HTML-Template.t' alone all tests pass fine. > > However, going on and installing T::P with the built-in find_file > function results in failures during usage. So there must be some
subtle bug. Show quoted text
> > I'll keep hacking at it. Maybe it will show up. > > For now, compiling T::P without the built-in file_find function is an > acceptable work-around.
When enabling debug, where should I look for the debug log referred to in Pro.xs?
Show quoted text
> > However, going on and installing T::P with the built-in find_file > > function results in failures during usage. So there must be some
> subtle bug.
feel free to report any bug you have found. Show quoted text
> > I'll keep hacking at it. Maybe it will show up. > > > > For now, compiling T::P without the built-in file_find function is an > > acceptable work-around.
> > When enabling debug, where should I look for the debug log referred to > in Pro.xs?
by default, debug log is printed to stderr. In my experience, it works fine with plain perl.exe from cmd.exe "Command Prompt" window.
I wrote a simple test (attached) and it worked on both linux and win32. So %ENV does work, at least sometimes. Well, I will dig further.
Download test-perl-env.zip
application/octet-stream 12.6k

Message body not shown because it is not plain text.

Суб. Ноя. 14 15:15:39 2009, VIY писал: Show quoted text
> I wrote a simple test (attached) and it worked on both linux and win32. > So %ENV does work, at least sometimes. > Well, I will dig further.
I found that it is another test that fails, on line 490. I am sorry.
Show quoted text
> I found that it is another test that fails, on line 490. I am sorry.
It was due to SET HTML_TEMPLATE_ROOT. I'll continue tomorrow, as nothing good will come from the sleepy head.
Chris, thank you for all the help and patience. Now I have located the problem. Attached file is the simplest test case for the Strawberry perl. it shows that environment variables set through %ENV are do accessible from the Perl/XS code (Perl.h included), (test 3 passes). but are not accessible from pure C code (via getenv from stdlib.h). (test 4 fails on Win32 but passes on Linux). I guess that Strawberry perl provides its own getenv to emulate its behaviour. It would be wise to ask Strawberry perl upstream though I afraid they will say that it is a feature, there might be some kind of workaround.
Download test-perl-env2.zip
application/octet-stream 20.3k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Sat, 14 Nov 2009 17:12:04 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
Hi Igor, On Sat, Nov 14, 2009 at 4:54 PM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > Chris, thank you for all the help and patience. > Now I have located the problem.
No problem. I'm enjoying the challenge. Show quoted text
> > Attached file is the simplest test case for the Strawberry perl. > it shows that environment variables set through %ENV > are do accessible from the Perl/XS code (Perl.h included), > (test 3 passes). > but are not accessible from pure C code (via getenv from stdlib.h). > (test 4 fails on Win32 but passes on Linux).
I cannot seem to get it to build. Here is the results of dmake: C:\strawberry\cpan\build\test-perl-env.git>dmake Makefile out-of-date with respect to Makefile.PL Cleaning current config before rebuilding Makefile... dmake -f Makefile.old clean > NUL C:\strawberry\perl\bin\perl.exe Makefile.PL Writing Makefile for TestENV ==> Your Makefile has been rebuilt. <== ==> Please rerun the dmake command. <== C:\strawberry\perl\bin\perl.exe -e "exit 1" -- dmake: Error code 129, while making 'Makefile' Show quoted text
> > I guess that Strawberry perl provides its own getenv > to emulate its behaviour. > > It would be wise to ask Strawberry perl upstream > though I afraid they will say that it is a feature, > there might be some kind of workaround.
I'll do this as soon as I can duplicate your tests.
Суб. Ноя. 14 17:12:38 2009, cnighswonger писал: Show quoted text
> Hi Igor, > > On Sat, Nov 14, 2009 at 4:54 PM, Igor Yu. Vlasenko via RT > <bug-HTML-Template-Pro@rt.cpan.org> wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > > > Chris, thank you for all the help and patience. > > Now I have located the problem.
> > No problem. I'm enjoying the challenge. >
> > > > Attached file is the simplest test case for the Strawberry perl. > > it shows that environment variables set through %ENV > > are do accessible from the Perl/XS code (Perl.h included), > > (test 3 passes). > > but are not accessible from pure C code (via getenv from stdlib.h). > > (test 4 fails on Win32 but passes on Linux).
> > I cannot seem to get it to build. Here is the results of dmake: > > C:\strawberry\cpan\build\test-perl-env.git>dmake > Makefile out-of-date with respect to Makefile.PL > Cleaning current config before rebuilding Makefile... > dmake -f Makefile.old clean > NUL > C:\strawberry\perl\bin\perl.exe Makefile.PL > Writing Makefile for TestENV > ==> Your Makefile has been rebuilt. <== > ==> Please rerun the dmake command. <== > C:\strawberry\perl\bin\perl.exe -e "exit 1" -- > dmake: Error code 129, while making 'Makefile'
hm, that Makefile.old is for Linux/gcc/gmake. just remove it it worked as follows: perl makefile.PL dmake test
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Sat, 14 Nov 2009 17:23:10 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Sat, Nov 14, 2009 at 5:17 PM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > >
>> >> C:\strawberry\cpan\build\test-perl-env.git>dmake >> Makefile out-of-date with respect to Makefile.PL >> Cleaning current config before rebuilding Makefile... >> dmake -f Makefile.old clean > NUL >> C:\strawberry\perl\bin\perl.exe Makefile.PL >> Writing Makefile for TestENV >> ==> Your Makefile has been rebuilt. <== >> ==> Please rerun the dmake command.  <== >> C:\strawberry\perl\bin\perl.exe  -e "exit 1" -- >> dmake:  Error code 129, while making 'Makefile'
> > hm, that Makefile.old is for Linux/gcc/gmake. > just remove it > it worked as follows: > perl makefile.PL > dmake test >
Sorry, but am I missing something here: C:\strawberry\cpan\build\test-perl-env.git>dir Volume in drive C has no label. Volume Serial Number is 6C8C-968A Directory of C:\strawberry\cpan\build\test-perl-env.git 11/14/2009 05:21 PM <DIR> . 11/14/2009 05:21 PM <DIR> .. 12/02/2007 05:59 PM 6,111 ARTISTIC 11/14/2009 11:35 PM 470 Makefile.PL 11/14/2009 11:34 PM 334 myenv.c 08/20/2009 09:05 PM 29,828 ppport.h 11/14/2009 05:07 PM <DIR> t 11/14/2009 09:58 PM 190 TestENV.pm 11/14/2009 11:37 PM 676 TestENV.xs 6 File(s) 37,609 bytes 3 Dir(s) 44,205,899,776 bytes free C:\strawberry\cpan\build\test-perl-env.git>perl Makefile.PL Writing Makefile for TestENV C:\strawberry\cpan\build\test-perl-env.git>dmake test Makefile out-of-date with respect to Makefile.PL Cleaning current config before rebuilding Makefile... dmake -f Makefile.old clean > NUL C:\strawberry\perl\bin\perl.exe Makefile.PL Writing Makefile for TestENV ==> Your Makefile has been rebuilt. <== ==> Please rerun the dmake command. <== C:\strawberry\perl\bin\perl.exe -e "exit 1" -- dmake: Error code 129, while making 'Makefile' C:\strawberry\cpan\build\test-perl-env.git>
I am not familiar with Windows, here is my copy of terminal -------------------------------------------------------- Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\L>cd c:\ C:\>cd strawberry C:\strawberry>cd cpan C:\strawberry\cpan>cd build C:\strawberry\cpan\build>cd test-perl-env.git C:\strawberry\cpan\build\test-perl-env.git>dmake clean dmake: Error: -- Don't know how to make `clean' C:\strawberry\cpan\build\test-perl-env.git>dir Volume in drive C has no label. Volume Serial Number is F489-8512 Directory of C:\strawberry\cpan\build\test-perl-env.git 11/14/2009 01:39 PM <DIR> . 11/14/2009 01:39 PM <DIR> .. 12/02/2007 07:59 AM 6,111 ARTISTIC 11/14/2009 01:39 PM 28,636 Makefile.old 11/14/2009 01:35 PM 470 Makefile.PL 11/14/2009 01:34 PM 334 myenv.c 08/20/2009 10:05 AM 29,828 ppport.h 11/14/2009 01:38 PM <DIR> t 11/14/2009 11:58 AM 190 TestENV.pm 11/14/2009 01:37 PM 676 TestENV.xs 7 File(s) 66,245 bytes 3 Dir(s) 5,579,251,712 bytes free C:\strawberry\cpan\build\test-perl-env.git>del Makefile.old C:\strawberry\cpan\build\test-perl-env.git>dir Volume in drive C has no label. Volume Serial Number is F489-8512 Directory of C:\strawberry\cpan\build\test-perl-env.git 11/14/2009 02:29 PM <DIR> . 11/14/2009 02:29 PM <DIR> .. 12/02/2007 07:59 AM 6,111 ARTISTIC 11/14/2009 01:35 PM 470 Makefile.PL 11/14/2009 01:34 PM 334 myenv.c 08/20/2009 10:05 AM 29,828 ppport.h 11/14/2009 01:38 PM <DIR> t 11/14/2009 11:58 AM 190 TestENV.pm 11/14/2009 01:37 PM 676 TestENV.xs 6 File(s) 37,609 bytes 3 Dir(s) 5,579,251,712 bytes free C:\strawberry\cpan\build\test-perl-env.git> C:\strawberry\cpan\build\test-perl-env.git>perl Makefile.PL Writing Makefile for TestENV C:\strawberry\cpan\build\test-perl-env.git>dmake test cp TestENV.pm blib\lib\TestENV.pm C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp -typemap C:\strawberry\perl\lib\ExtUtils\typemap TestENV.xs > TestENV.xsc && C:\strawbe rry\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- TestENV.xsc TestENV.c Please specify prototyping behavior for TestENV.xs (see perlxs manual) gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPL ICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s - O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\strawberry\perl\lib \CORE" TestENV.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPL ICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s - O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\strawberry\perl\lib \CORE" myenv.c Running Mkbootstrap for TestENV () C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 TestENV.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"TestENV\", 'DLBASE' => 'TestENV', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def TestENV.def --output-exp dll.exp g++ -o blib\arch\auto\TestENV\TestENV.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" TestENV.o myenv.o -Wl,--image-base,0x112b0000 C:\strawberry\perl\lib\CORE\libperl510.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp3 2 dll.exp dlltool --def TestENV.def --base-file dll.base --output-exp dll.exp g++ -o blib\arch\auto\TestENV\TestENV.dll -mdll -s -L"C:\strawberry\perl\lib\COR E" -L"C:\strawberry\c\lib" TestENV.o myenv.o -Wl,--image-base,0x112b0000 C:\ strawberry\perl\lib\CORE\libperl510.a -lmoldname -lkernel32 -luser32 -lgdi32 -lw inspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lw s2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 dll.exp C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 blib\arch\ auto\TestENV\TestENV.dll C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- TestENV.bs blib\a rch\auto\TestENV\TestENV.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 blib\arch\ auto\TestENV\TestENV.bs C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/02basic.t .. Use of uninitialized value in string eq at t/02basic.t line 7. t/02basic.t .. 1/4 # Failed test at t/02basic.t line 7. # Looks like you failed 1 test of 4. t/02basic.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests Test Summary Report ------------------- t/02basic.t (Wstat: 256 Tests: 4 Failed: 1) Failed test: 4 Non-zero exit status: 1 Files=1, Tests=4, 1 wallclock secs ( 0.05 usr + 0.02 sys = 0.07 CPU) Result: FAIL Failed 1/1 test programs. 1/4 subtests failed. dmake: Error code 129, while making 'test_dynamic' C:\strawberry\cpan\build\test-perl-env.git>
Download screen.copy
application/octet-stream 5.1k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Sat, 14 Nov 2009 17:40:05 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Sat, Nov 14, 2009 at 5:35 PM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > I am not familiar with Windows, here is my copy of terminal > -------------------------------------------------------- > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp.
ok, I'm stuck for the moment. I have to run and eat. I'll look at this again tomorrow afternoon.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Sat, 14 Nov 2009 21:37:36 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Sat, Nov 14, 2009 at 5:40 PM, Chris Nighswonger <cnighswonger@foundations.edu> wrote: Show quoted text
> On Sat, Nov 14, 2009 at 5:35 PM, Igor Yu. Vlasenko via RT > <bug-HTML-Template-Pro@rt.cpan.org> wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > >> >> I am not familiar with Windows, here is my copy of terminal >> -------------------------------------------------------- >> Microsoft Windows XP [Version 5.1.2600] >> (C) Copyright 1985-2001 Microsoft Corp.
> > ok, I'm stuck for the moment. I have to run and eat. I'll look at this > again tomorrow afternoon. >
The problem here turned out to be the date stamp on Makefile.PL As you can see below, the date stamp bears 11:35PM as the time the file was last written to. My local time was much earlier being GMT -5. Once the timestamp was corrected, the test compiled and ran as you said it should. I'll take this back to the Strawberry maintainers. C:\strawberry\cpan\build\test-perl-env.git>dir /T:W Volume in drive C has no label. Volume Serial Number is 6C8C-968A Directory of C:\strawberry\cpan\build\test-perl-env.git 11/14/2009 09:27 PM <DIR> . 11/14/2009 09:27 PM <DIR> .. 12/02/2007 05:59 PM 6,111 ARTISTIC 11/14/2009 09:27 PM 28,636 Makefile 11/14/2009 09:27 PM 28,636 Makefile.old 11/14/2009 11:35 PM 470 Makefile.PL 11/14/2009 11:34 PM 334 myenv.c 08/20/2009 09:05 PM 29,828 ppport.h 11/14/2009 05:07 PM <DIR> t 11/14/2009 09:58 PM 190 TestENV.pm 11/14/2009 11:37 PM 676 TestENV.xs 8 File(s) 94,881 bytes 3 Dir(s) 44,192,878,592 bytes free
Show quoted text
> I'll take this back to the Strawberry maintainers.
Hello, Chris, I have my doubts whether they can fix the problem under Windows (this platform is always rumored to be the hell for sinful programmers) I guess this strange behavior is some kind of workaround against Win oddities. so I added a hackaround/workaround to H::T::P 0.93 --. a handle to forcefully overwrite HTML_TEMPLATE_ROOT. Now it works everywhere. You can try 0.93 prerelease attached, it works fine. If it will work for you, it will be in 0.93 release.
Download HTML-Template-Pro-0.93.tar.gz
application/gzip 162.9k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Tue, 17 Nov 2009 19:47:55 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
Hi Igor, On Tue, Nov 17, 2009 at 2:36 PM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > >
>> I'll take this back to the Strawberry maintainers.
> Hello, Chris, > I have my doubts whether they can fix the problem under Windows > (this platform is always rumored to be the hell for sinful programmers) > I guess this strange behavior is some kind of workaround > against Win oddities. > > so I added a hackaround/workaround to H::T::P 0.93 --. > a handle to forcefully overwrite HTML_TEMPLATE_ROOT. > > Now it works everywhere. > > You can try 0.93 prerelease attached, it works fine. > If it will work for you, it will be in 0.93 release.
All tests pass with this "hack", but I'm sad to report that it does not work in production. Perhaps just using the perl find file is the best workaround for use on Win32. Maybe you could add a check in Pro.pm for platform ($^O) and condition the flavor of find_file based on that. Thanks for all of the time you've taken with this issue.
Втр. Ноя. 17 19:48:32 2009, cnighswonger писал: Show quoted text
> Hi Igor, > All tests pass with this "hack", but I'm sad to report that it does > not work in production.
Could you reduce it to the test case? Is it related to HTML_TEMPLATE_ROOT usage?
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Wed, 18 Nov 2009 06:27:47 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Wed, Nov 18, 2009 at 5:34 AM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > Втр. Ноя. 17 19:48:32 2009, cnighswonger писал:
>> Hi Igor, >> All tests pass with this "hack", but I'm sad to report that it does >> not work in production.
> Could you reduce it to the test case?
I'll try to build a test for it later today. Show quoted text
> Is it related to HTML_TEMPLATE_ROOT usage? >
Here are the lines from the application error log: [Tue Nov 17 19:37:43 2009] [error] [client 127.0.0.1] [Tue Nov 17 19:37:43 2009] mainpage.pl: Pro.xs: non-zero exit code 2 at C:/strawberry/perl/site/lib/HTML/Template/Pro.pm line 198. [Tue Nov 17 19:37:43 2009] [error] [client 127.0.0.1] built-in find_file: can't find file C:\\progra~1\\koha\\intranet\\htdocs\\intranet-tmpl/prog/en/modules/auth.tmpl with path = [ 'C:\\progra~1\\koha\\intranet\\htdocs\\intranet-tmpl/prog/en/includes' ]
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Wed, 18 Nov 2009 09:36:48 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
Here is some new info from a conversation I had with the lead C programmer on Strawberry Perl: <chris_n2> kmx: is there a difference in the way that strawberry handles getenv in xs versus the way *nix perl handles the same function? <kmx> chris_n2: getenv(..) in xs = how mingw c-runtime (not strawberry) does it; however I am not aware of any big difference from UNIX (apart from the issue you have pointed me to) <kmx> there are ENV issues like variable names in Win32 always beeing upper-case but ... <chris_n2> kmx: regarding the $ENV issue I've been trying to help with on the Template::Pro module, the maintainer has built a test which seems to show some difference between perl's getenv and c's getenv on strawberry which does not exist on unix perl <chris_n2> is this a matter to take to the mingw maintainers? * chris_n2 is trying to help in an area he is not real familiar with <kmx> could you please point me to the test you are talking about? <chris_n2> om <chris_n2> kmx: https://rt.cpan.org/Public/Bug/Display.html?id=51218#txn-690876 <dipsy> [ #51218: built-in find_file pro.xs ] * pece2 (~pczerkas@4.suw.abpl.pl) has joined #win32 * pece has quit (Ping timeout: 360 seconds) <kmx> chris_n2: the problem in your example is that in TestENV.xs calling getenv() does not call c-runtime getenv() but in fact PerlEnv_getenv() from perl core (see XSUB.h - #define getenv PerlEnv_getenv) <kmx> and perl core does some "magic" with env Show quoted text
>
So it appears that Pro.xs may not be calling the "real" C getenv(), but rather an overridden version referred to in XSUB.h. My C is extremely old and out of use, but I'm wondering if there is not a way to call the C runtime version of getenv() in TestENV.xs and see how that behaves in Strawberry.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Wed, 18 Nov 2009 10:56:21 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
More of the conversation which took place later is below. On Wed, Nov 18, 2009 at 9:36 AM, Chris Nighswonger <cnighswonger@foundations.edu> wrote: Show quoted text
> Here is some new info from a conversation I had with the lead C > programmer on Strawberry Perl: > > > <chris_n2> kmx: is there a difference in the way that strawberry > handles getenv in xs versus the way *nix perl handles the same > function? > <kmx> chris_n2: getenv(..) in xs = how mingw c-runtime (not > strawberry) does it; however I am not aware of any big difference from > UNIX (apart from the issue you have pointed me to) > <kmx> there are ENV issues like variable names in Win32 always beeing > upper-case but ... > <chris_n2> kmx: regarding the $ENV issue I've been trying to help with > on the Template::Pro module, the maintainer has built a test which > seems to show some difference between perl's getenv and c's getenv on > strawberry which does not exist on unix perl > <chris_n2> is this a matter to take to the mingw maintainers? > * chris_n2 is trying to help in an area he is not real familiar with > <kmx> could you please point me to the test you are talking about? > <chris_n2> om > <chris_n2> kmx: https://rt.cpan.org/Public/Bug/Display.html?id=51218#txn-690876 > <dipsy> [ #51218: built-in find_file pro.xs ] > * pece2 (~pczerkas@4.suw.abpl.pl) has joined #win32 > * pece has quit (Ping timeout: 360 seconds) > <kmx> chris_n2: the problem in your example is that in TestENV.xs > calling getenv() does not call c-runtime getenv() but in fact > PerlEnv_getenv() from perl core (see XSUB.h  - #define getenv > PerlEnv_getenv) > <kmx> and perl core does some "magic" with env
>>
> > So it appears that Pro.xs may not be calling the "real" C getenv(), > but rather an overridden version referred to in XSUB.h. My C is > extremely old and out of use, but I'm wondering if there is not a way > to call the C runtime version of getenv() in TestENV.xs and see how > that behaves in Strawberry. >
<kmx> chris_n2: inclusion of XSUB.h overrides getenv() function - so calling getenv() after including XSUB.h does not call real c-runtime getenv() <chris_n2> kmx: so no way to access overridden functions in C? <kmx> chris_n2: beware - you do not want to access the overriden c-runtime function (it will return an empty value on env variable set vie $ENV{VAR}), you need to access the value that perl stored into its internal structures - from XS you simply call getenv() - which is at that point fake (it is Perl_getenv()) <chris_n2> kmx: so if the "magic" done by perl core is causing the issues I see, there is no fix apart from fixing the part of the perl core which does the magic? <kmx> chris_n2: I am afraid that this is a feature, perl simply keeps all env changes done via $ENV{xxx} in its internal structures, if you for example call some external command from perl via system("command") it uses env values from internal structures when launching this command. <kmx> it is also good to mention that it might work differently on non-Win32 platforms where the perl is compiled without setting PERL_IMPLICIT_SYS <kmx> you simply has to deal with values set via $ENV{xx} at XS level and pass it to c-code as a param or so So it does appear that there may be no "easy" fix.
Срд. Ноя. 18 10:57:05 2009, cnighswonger писал: Show quoted text
> <kmx> you simply has to deal with values set via $ENV{xx} at XS level > and pass it to c-code as a param or so
It is exactly the hack I implemented. It fixes the tests, but yet not good -- you have reported that there are other bugs with built-in find_file. I guess that there are some windows filemname specific bugs. Please, could you give me a test case? I will readily fix them all :) The less perl code will be left, the faster it will be.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Thu, 19 Nov 2009 19:21:01 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
Hi Igor, On Thu, Nov 19, 2009 at 7:42 AM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > > > Срд. Ноя. 18 10:57:05 2009, cnighswonger писал:
>> <kmx> you simply has to deal with values set via $ENV{xx} at XS level >> and pass it to c-code as a param or so
> It is exactly the hack I implemented. > It fixes the tests, but yet not good  -- > you have reported that there are other bugs with built-in find_file. > I guess that there are some windows filemname specific bugs. > Please, could you give me a test case? > I will readily fix them all :) > The less perl code will be left, the faster it will be.
Perhaps this will help us find what is wrong. Here is how we create a new H::T::P object: my $template = HTML::Template::Pro->new( filename => "C:/progra~1/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/intranet-main.tmpl", die_on_bad_params => 1, global_vars => 1, case_sensitive => 1, loop_context_vars => 1, # enable: __first__, __last__, __inner__, __odd__, __counter__ path => ["C:/progra~1/koha/intranet/htdocs/intranet-tmpl/prog/en/includes"], search_path_on_include => 1 ); 1. In this code, we do not invoke the "path => ['searchpath']" option. 2. It appears that "searchpath" is invoked at some point because this code results in the failure logged as mentioned in my previous post. 3. This exact code works fine on *nix installs. I have found that the following code works on Strawberry on Win32: my $template = HTML::Template::Pro->new( filename => "C:/progra~1/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/intranet-main.tmpl", die_on_bad_params => 1, global_vars => 1, case_sensitive => 1, loop_context_vars => 1, # enable: __first__, __last__, __inner__, __odd__, __counter__ path => ["C:/progra~1/koha/intranet/htdocs/intranet-tmpl/prog/en/modules", "C:/progra~1/koha/intranet/htdocs/intranet-tmpl/prog/en/includes"], search_path_on_include => 1 ); So the question is: Is the first method of creating a template object incorrect and just happens to work on *nix? Should we be invoking the HTML::Template::Pro->new() method the second way? I am a bit confused as to how H::T::P handles pathing at this point.
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Thu, 19 Nov 2009 19:58:44 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Thu, Nov 19, 2009 at 7:21 PM, Chris Nighswonger <cnighswonger@foundations.edu> wrote: Show quoted text
> Hi Igor, > On Thu, Nov 19, 2009 at 7:42 AM, Igor Yu. Vlasenko via RT > <bug-HTML-Template-Pro@rt.cpan.org> wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > >> >> Срд. Ноя. 18 10:57:05 2009, cnighswonger писал:
>>> <kmx> you simply has to deal with values set via $ENV{xx} at XS level >>> and pass it to c-code as a param or so
>> It is exactly the hack I implemented. >> It fixes the tests, but yet not good  -- >> you have reported that there are other bugs with built-in find_file. >> I guess that there are some windows filemname specific bugs. >> Please, could you give me a test case? >> I will readily fix them all :) >> The less perl code will be left, the faster it will be.
>
I have modified t/HTML-Template.t to include a test which tests the exact method currently used in Koha to call a new H::T::P object. If you decompress the attached RAR file, run Makefile.PL, then 'dmake' and 'dmake test' you will see the test fail in the same manner when find_file is resorted to. Note that generally the direction of slashes in the path does not matter to cmd.exe.
Download HTML-Template-Pro-0.93.rar
application/octet-stream 201.5k

Message body not shown because it is not plain text.

Show quoted text
> I have modified t/HTML-Template.t to include a test which tests the > exact method currently used in Koha to call a new H::T::P object.
thank you! I have attached 0.93 RC2, it fixes the bug in find_file that was specific to WIN platform. detailed timeline is available in .git. http://git.altlinux.org/people/viy/packages/?p=HTML-Template-Pro.git;a=summary

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Sat, 21 Nov 2009 09:56:59 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
Hi Igor, On Sat, Nov 21, 2009 at 9:05 AM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51218 > >
>> I have modified t/HTML-Template.t to include a test which tests the >> exact method currently used in Koha to call a new H::T::P object.
> > thank you! > I have attached 0.93 RC2, it fixes the bug in find_file that was specific > to WIN platform. > > detailed timeline is available in .git. > http://git.altlinux.org/people/viy/packages/?p=HTML-Template-Pro.git;a=summary
I can confirm that this fix works fine in production on Win32. Again, thank-you so much for sticking with me on this and taking the time to work through it. Kind Regards, Chris
Суб. Ноя. 21 09:57:34 2009, cnighswonger писал: Show quoted text
> I can confirm that this fix works fine in production on Win32.
Thank you, Chris! I have a few thing to polish in 0.93 yet, so I think the official release of 0.93 will be in a week or so.
fixed
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Mon, 23 Nov 2009 23:33:34 +0200
To: Chris Nighswonger via RT <bug-HTML-Template-Pro [...] rt.cpan.org>
From: Igor Vlasenko <vlasenko [...] imath.kiev.ua>
On Sat, Nov 21, 2009 at 09:57:35AM -0500, Chris Nighswonger via RT wrote: Show quoted text
> I can confirm that this fix works fine in production on Win32.
Dear Chris, I've released 0.93 on CPAN and SF with the fixes. By the way, could you add Rate and Review to the SF project page? https://sourceforge.net/projects/html-tmpl-pro/ -- Dr. Igor Vlasenko -------------------- Topology Department Institute of Math Kiev, Ukraine
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Mon, 23 Nov 2009 22:49:11 -0500
To: bug-HTML-Template-Pro [...] rt.cpan.org
From: Chris Nighswonger <cnighswonger [...] foundations.edu>
On Mon, Nov 23, 2009 at 4:33 PM, Igor Yu. Vlasenko via RT <bug-HTML-Template-Pro@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=51218 > > > On Sat, Nov 21, 2009 at 09:57:35AM -0500, Chris Nighswonger via RT wrote:
>> I can confirm that this fix works fine in production on Win32.
> > Dear Chris, > I've released 0.93 on CPAN and SF with the fixes.
Thanks! Show quoted text
> > By the way, could you add Rate and Review > to the SF project page? > > https://sourceforge.net/projects/html-tmpl-pro/
Done. Kind Regards, Chris Show quoted text
> > > -- > > Dr. Igor Vlasenko > -------------------- > Topology Department > Institute of Math > Kiev, Ukraine > > >
Subject: Re: [rt.cpan.org #51218] built-in find_file pro.xs
Date: Tue, 24 Nov 2009 12:14:27 +0200
To: Chris Nighswonger via RT <bug-HTML-Template-Pro [...] rt.cpan.org>
From: Igor Vlasenko <vlasenko [...] imath.kiev.ua>
On Mon, Nov 23, 2009 at 10:49:47PM -0500, Chris Nighswonger via RT wrote: Show quoted text
> Done.
Thanks! -- Dr. Igor Vlasenko -------------------- Topology Department Institute of Math Kiev, Ukraine