Thread

Posted on Wed Dec 14 00:57:57 2005 by robertb
Errors with make test
I am trying to install XML::Simple on a Redhat Enterprise Linux ES release 4 (Nahant Update 2) box. The perl installed is v5.8.5 built for i386-linux-thread-multi.
I did not get these errors installing on several Redhat Enterprise Linux ES release 3 boxes and a White Box release 3 box.
Is it safe to force the install or does something need fixing?
The output from make test is below:
Thanks in advance for any help/advice.
# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/a +rch')" t/*.t # Package Version # perl 5.8.5 # XML::Simple 2.14 # Storable 2.15 # XML::Parser Not Installed # XML::SAX 0.13 # XML::NamespaceSupport 1.09 # XML::SAX::PurePerl 0.90 (default parser) t/0_Config........ok t/1_XMLin.........ok 5/122Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 7/122Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 8/122Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 9/122Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 10/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 11/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 12/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 13/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 14/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 15/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 16/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 17/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 18/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 19/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 20/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 21/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 22/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 23/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 24/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 25/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 31/122# Failed test (t/1_XMLin.t at line 380) t/1_XMLin.........NOK 32# got: 'Unable to recognise encoding of this document at /usr/lib/ +perl5/site_perl/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. # ' # expected: '' t/1_XMLin.........ok 36/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/1_XMLin.........ok 37/122# Failed test (t/1_XMLin.t at line 426) t/1_XMLin.........NOK 38# Structures begin differing at: # $got->{cdata} = '<greeting>Hello, world!</greeting>>' # $expected->{cdata} = '<greeting>Hello, world!</greeting>' # Failed test (t/1_XMLin.t at line 432) t/1_XMLin.........NOK 39# Structures begin differing at: # $got->{x} = '<y>one</y>><y>two</y>>' # $expected->{x} = '<y>one</y><y>two</y>' t/1_XMLin.........ok 54/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 55/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 56/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 57/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 58/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 59/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 66/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 67/122Unable to recognise encoding of this document at /usr/lib/perl5/site_per +l/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96, <STDIN> line 1. t/1_XMLin.........ok 121/122# Failed test (t/1_XMLin.t at line 1443) t/1_XMLin.........NOK 122# Structures begin differing at: # $got->{pubpath}{test1}{title} = 'web_source -> web_target1' # $expected->{pubpath}{test1}{title} = 'web_source -&gt; web_target1' # Looks like you failed 4 tests of 122. t/1_XMLin.........dubious Test returned status 4 (wstat 1024, 0x400) DIED. FAILED tests 32, 38-39, 122 Failed 4/122 tests, 96.72% okay t/2_XMLout........ok 46/196# Failed test (t/2_XMLout.t at line 302) # Structures begin differing at: # $got->{c} = '&amp;C&amp;' # $expected->{c} = '&C&' t/2_XMLout........ok 186/196Unable to recognise encoding of this document at /usr/lib/perl5/site_pe +rl/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/2_XMLout........ok 187/196Unable to recognise encoding of this document at /usr/lib/perl5/site_pe +rl/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/2_XMLout........ok 188/196Unable to recognise encoding of this document at /usr/lib/perl5/site_pe +rl/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/2_XMLout........ok 196/196# Looks like you failed 1 tests of 196. t/2_XMLout........dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 47 Failed 1/196 tests, 99.49% okay t/3_Storable......ok t/4_MemShare......ok t/5_MemCopy.......ok t/6_ObjIntf.......ok t/7_SaxStuff......ok t/8_Namespaces....ok t/9_Strict........ok 11/38Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/9_Strict........ok 13/38Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/9_Strict........ok 30/38Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/9_Strict........ok 32/38Unable to recognise encoding of this document at /usr/lib/perl5/site_perl +/5.8.5/XML/SAX/PurePerl/EncodingDetect.pm line 96. t/9_Strict........ok t/A_XMLParser.....skipped all skipped: no XML::Parser Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/1_XMLin.t 4 1024 122 4 3.28% 32 38-39 122 t/2_XMLout.t 1 256 196 1 0.51% 47 1 test skipped. Failed 2/11 test scripts, 81.82% okay. 5/454 subtests failed, 98.90% okay. make: *** [test_dynamic] Error 255
Direct Responses: 1475 | Write a response
Posted on Wed Dec 14 01:13:40 2005 by grantm in response to 1473
Re: Errors with make test

Short answer, it is a bug with the latest version of XML::SAX (specifically the XML::SAX::PurePerl parser module in that distribution):

http://aspn.activestate.com/ASPN/Mail/Message/Perl-XML/2927108

You probably don't want to use the PurePerl parser anyway for performance reasons. The simplest fix is to install XML::SAX::Expat. That will then become the default SAX parser. Once you've done that, try the XML::Simple install again. The errors should be gone.

Direct Responses: 1476 | Write a response
Posted on Wed Dec 14 01:31:22 2005 by robertb in response to 1475
Re: Errors with make test
Thanks for quick response!

However...
Tried cpan XML::SAX::Expat
That says: Warning: prerequisite XML::Parser 2.27 not found so I let it try to install XML::Parser ...

I get:
: : make[1]: Entering directory `/root/.cpan/build/XML-Parser-2.34/Expat' cp Expat.pm ../blib/lib/XML/Parser/Expat.pm /usr/bin/perl /usr/lib/perl5/5.8.5/ExtUtils/xsubpp -noprototypes -typemap /usr/lib/perl5/5.8.5/ExtU +tils/typemap -typemap typemap Expat.xs > Expat.xsc && mv Expat.xsc Expat.c gcc -c -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_ +LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=p +entium4 -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread +-multi/CORE" Expat.c Expat.xs:12:19: expat.h: No such file or directory Expat.xs:60: error: syntax error before "XML_Parser" Expat.xs:60: warning: no semicolon at end of struct or union Expat.xs:78: error: syntax error before ':' token : :
The same happens if I just try: cpan XML::Parser

Should I uninstall XML::SAX first (although this does not look like the cause of this error to me).
Direct Responses: 1477 | Write a response
Posted on Wed Dec 14 03:04:21 2005 by robertb in response to 1476
Re: Errors with make test
I have reverted to XML::SAX v0.12 and the tests look fine:
# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/a +rch')" t/*.t # Package Version # perl 5.8.5 # XML::Simple 2.14 # Storable 2.15 # XML::Parser Not Installed # XML::SAX 0.12 # XML::NamespaceSupport 1.09 # XML::SAX::PurePerl 0.90 (default parser) t/0_Config........ok t/1_XMLin.........ok t/2_XMLout........ok t/3_Storable......ok t/4_MemShare......ok t/5_MemCopy.......ok t/6_ObjIntf.......ok t/7_SaxStuff......ok t/8_Namespaces....ok t/9_Strict........ok t/A_XMLParser.....skipped all skipped: no XML::Parser All tests successful, 1 test skipped. Files=11, Tests=454, 21 wallclock secs ( 9.45 cusr + 0.94 csys = 10.39 CPU)
Please let me know if anyone thinks that this will cause a future problem.

Thanks
Direct Responses: 1478 | Write a response
Posted on Wed Dec 14 03:17:52 2005 by grantm in response to 1477
Re: Errors with make test

No, running the previous version of XML::SAX is unlikely to cause a problem although parsing of XML will be very slow.

The error you got when trying to install XML::Parser was simply because you don't have the expat header files installed. Typically the expat library would be in a package called something like libexpat and the headers would be in a package called libexpat-dev. You'd need both to build XML::Parser.

On Linux servers, it's generally easier to install the OS packages for CPAN modules if they're available.

Direct Responses: 1479 | Write a response
Posted on Wed Dec 14 11:34:42 2005 by robertb in response to 1478
Re: Errors with make test
Thanks again. I will try that tomorrow. The rpm looks like it would be expat-devel-1.95.7-4.i386 .

I had noticed that processing small XML files was slow but I have had little experience with XML before. To get the best performance with XML::Simple should I deinstall XML::SAX v 0.12 and install XML::Parser 2.27 and the latest XML::SAX::Expat ( or leave XML::SAX v 0.12 in place?).

Sorry, but I don't have a picture (yet) of how all these components fit together - do you know of a good guide to perl/XML processing using CPAN modules?
Direct Responses: 1483 | Write a response
Posted on Wed Dec 14 22:03:37 2005 by grantm in response to 1479
Re: Errors with make test

No, don't uninstall XML::SAX, it provides the base class used by all the SAX parsers, so it's a prerequisite for XML::SAX::Expat.

In the beginning, there was only XML::Parser. It provides a good fast parser (via libexpat) but it's API isn't very friendly. Then the SAX API was created to serve as a common API. This means that you can plug in different parsers without changing your code. The last SAX parser you install will be the system default from that point on. The Perl XML FAQ has links to Kip Hampton's introductory articles.

Direct Responses: 1489 | Write a response
Posted on Fri Dec 16 11:58:34 2005 by robertb in response to 1483
Re: Errors with make test
That all seems to work as you suggested. I have a better idea how it fits together now.

'make test' for XML::Simple now uses about 50% less CPU with the SAX::Expat (as compared to the PurePerl version with XML::SAX 0.12)

Took a while to find that the last section in .../XML/SAX/ParserDetails.ini indicates the default parser.

Many thanks
Write a response