xslate / p5-Text-Xslate

Scalable template engine for Perl5
https://metacpan.org/release/Text-Xslate
Other
121 stars 47 forks source link

Test failure with threaded perl 5.21.4 and higher #139

Closed jplesnik closed 9 years ago

jplesnik commented 9 years ago

Tests failed with threaded Perl 5.21.4 and higher. Unthreaded 5.21.x passes all tests.

See http://www.cpantesters.org/cpan/report/c081e306-f7e6-11e4-b80d-f1571b12eb46 for a sample fail report and http://matrix.cpantesters.org/?dist=Text-Xslate+3.3.4 for a fail/pass overview.

zdm commented 9 years ago

Not installed under strabberry perl 5.22 due to this error.

Here is the log

t/010_internals/039_taint_issue84.t ............. ok
t/010_internals/100_threads.t ................... 1/13 Use of uninitialized value $syntax in concatenation (.) or string at D:\tmp\.cpanm\work\1434921820.29
04\Text-Xslate-3.3.4\blib\lib/Text/Xslate/Compiler.pm line 211.
Thread 2 terminated abnormally: Invalid class name (undef) at D:/devel/perl/perl/site/lib/Mouse/Util.pm line 276 thread 2.
        Mouse::Util::_try_load_one_class(undef) called at D:/devel/perl/perl/site/lib/Mouse/Util.pm line 250 thread 2
        Mouse::Util::load_first_existing_class("Text::Xslate::Syntax::", undef) called at D:\tmp\.cpanm\work\1434921820.2904\Text-Xslate-3.3.4\blib\lib/Text
/Xslate/Compiler.pm line 211 thread 2
        Text::Xslate::Compiler::_build_parser(Text::Xslate::Compiler=HASH(0x31893e0)) called at D:\tmp\.cpanm\work\1434921820.2904\Text-Xslate-3.3.4\blib\li
b/Text/Xslate/Compiler.pm line 291 thread 2
        Text::Xslate::Compiler::compile(Text::Xslate::Compiler=HASH(0x31893e0), "Hello, <:= \$lang :> world!\x{a}", "file", "D:\\tmp\\.cpanm\\work\\14349218
20.2904\\Text-Xslate-3.3.4\\t\\V9zzKW"..., "name", "D:\\tmp\\.cpanm\\work\\1434921820.2904\\Text-Xslate-3.3.4\\t\\V9zzKW"..., "omit_augment", "") called at
D:\tmp\.cpanm\work\1434921820.2904\Text-Xslate-3.3.4\blib\lib/Text/Xslate.pm line 649 thread 2
        Text::Xslate::Engine::compile(Text::Xslate=HASH(0x3182c28), "Hello, <:= \$lang :> world!\x{a}", "file", "D:\\tmp\\.cpanm\\work\\1434921820.2904\\Tex
t-Xslate-3.3.4\\t\\V9zzKW"..., "name", "D:\\tmp\\.cpanm\\work\\1434921820.2904\\Text-Xslate-3.3.4\\t\\V9zzKW"...) called at D:\tmp\.cpanm\work\1434921820.29
04\Text-Xslate-3.3.4\blib\lib/Text/Xslate.pm line 410 thread 2
        Text::Xslate::Engine::_load_source(Text::Xslate=HASH(0x3182c28), HASH(0x315acd8), 0) called at D:\tmp\.cpanm\work\1434921820.2904\Text-Xslate-3.3.4\
blib\lib/Text/Xslate.pm line 362 thread 2
        Text::Xslate::Engine::load_file(Text::Xslate=HASH(0x3182c28), "hello.tx", 0, "") called at t/010_internals/100_threads.t line 36 thread 2
        eval {...} called at t/010_internals/100_threads.t line 36 thread 2
        main::__ANON__() called at t/010_internals/100_threads.t line 37 thread 2
        eval {...} called at t/010_internals/100_threads.t line 37 thread 2
t/010_internals/100_threads.t ................... 5/13 Use of uninitialized value $syntax in concatenation (.) or string at D:\tmp\.cpanm\work\1434921820.29
04\Text-Xslate-3.3.4\blib\lib/Text/Xslate/Compiler.pm line 211.
Thread 3 terminated abnormally: Invalid class name (undef) at D:/devel/perl/perl/site/lib/Mouse/Util.pm line 276 thread 3.
        Mouse::Util::_try_load_one_class(undef) called at D:/devel/perl/perl/site/lib/Mouse/Util.pm line 250 thread 3
        Mouse::Util::load_first_existing_class("Text::Xslate::Syntax::", undef) called at D:\tmp\.cpanm\work\1434921820.2904\Text-Xslate-3.3.4\blib\lib/Text
/Xslate/Compiler.pm line 211 thread 3
        Text::Xslate::Compiler::_build_parser(Text::Xslate::Compiler=HASH(0x344b408)) called at D:\tmp\.cpanm\work\1434921820.2904\Text-Xslate-3.3.4\blib\li
b/Text/Xslate/Compiler.pm line 291 thread 3
        Text::Xslate::Compiler::compile(Text::Xslate::Compiler=HASH(0x344b408), "<: [10, 20, 30].count(-> \$a { true }) :>", "omit_augment", undef) called a
t D:\tmp\.cpanm\work\1434921820.2904\Text-Xslate-3.3.4\blib\lib/Text/Xslate.pm line 649 thread 3
        Text::Xslate::Engine::compile(Text::Xslate=HASH(0x344ab48), "<: [10, 20, 30].count(-> \$a { true }) :>") called at D:\tmp\.cpanm\work\1434921820.290
4\Text-Xslate-3.3.4\blib\lib/Text/Xslate.pm line 277 thread 3
        Text::Xslate::Engine::load_string(Text::Xslate=HASH(0x344ab48), "<: [10, 20, 30].count(-> \$a { true }) :>") called at t/010_internals/100_threads.t
 line 57 thread 3
        main::__ANON__() called at t/010_internals/100_threads.t line 58 thread 3
        eval {...} called at t/010_internals/100_threads.t line 58 thread 3
# Looks like you planned 13 tests but ran 9.
t/010_internals/100_threads.t ................... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 4/13 subtests
t/010_internals/200_leaktrace.t ................. ok
zdm commented 9 years ago

I have found, that problem is in "default" property of Text::Xslate::Compiler attributes. Under threads default value is not applied for some reasons. If I rewrite attribute declaration to use "lazy" and "builder" - everything works. Maybe the problem somewhere in Mouse? Maybe it time to apply Moo patch? ;-)

tokuhirom commented 9 years ago

ref. https://github.com/gfx/p5-Mouse/issues/29

syohex commented 9 years ago

I wrote patch https://github.com/gfx/p5-Mouse/pull/50

syohex commented 9 years ago

Please check latest version.