Skip Menu |

This queue is for tickets about the Config-Any CPAN distribution.

Report information
The Basics
Id: 85539
Status: resolved
Priority: 0/
Queue: Config-Any

People
Owner: Nobody in particular
Requestors: moritz [...] bunkus.org
Cc:
AdminCc:

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



Subject: tests fail if XML::LibXML is not installed
Date: Wed, 22 May 2013 14:58:40 +0200
To: bug-Config-Any [...] rt.cpan.org
From: Moritz Bunkus <moritz [...] bunkus.org>
Hey, two tests fail with an exception if XML::LibXML is not installed at all: t/20-parse.t .......... Error parsing t/conf/conf.xml: Can't locate XML/LibXML/SAX.pm in @INC (@INC contains: /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any-0.23/inc /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any-0.23/blib/lib /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any-0.23/blib/arch /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at (eval 34) line 1. at t/20-parse.t line 42. # Looks like your test exited with 2 before it could output anything. t/20-parse.t .......... Dubious, test returned 2 (wstat 512, 0x200) and t/54-xml.t ............ Can't locate XML/LibXML/SAX.pm in @INC (@INC contains: /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any-0.23/inc /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any-0.23/blib/lib /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any-0.23/blib/arch /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at (eval 7) line 1. # Looks like your test exited with 2 before it could output anything. t/54-xml.t ............ Dubious, test returned 2 (wstat 512, 0x200) Failed 6/6 subtests For 54-xml.t I can already see a logic error: my $broken_libxml = eval { require XML::LibXML; XML::LibXML->VERSION lt '1.59'; }; skip 'XML::LibXML < 1.58 has issues', 2 if $broken_libxml; Now if the require aborts eval returns falsish and "skip" is not executed. I haven't looked into 20-parse.t yet. Note that I do have XML::Simple and XML::NamespaceSupport installed, and "use"ing both works just fine (from looking at Config/Any/XML.pm). Maybe you should simply mention XML::LibXML as a build pre-requisite. Kind regards, mosu
On Wed May 22 09:59:02 2013, moritz@bunkus.org wrote: Show quoted text
> Hey, > > two tests fail with an exception if XML::LibXML is not installed at > all: > > t/20-parse.t .......... Error parsing t/conf/conf.xml: Can't locate > XML/LibXML/SAX.pm in @INC (@INC contains: > /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any- > 0.23/inc > /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any- > 0.23/blib/lib > /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any- > 0.23/blib/arch > /usr/lib/perl5/site_perl /usr/share/perl5/site_perl > /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl > /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at (eval 34) > line 1. > at t/20-parse.t line 42. > # Looks like your test exited with 2 before it could output anything. > t/20-parse.t .......... Dubious, test returned 2 (wstat 512, 0x200) > > and > > t/54-xml.t ............ Can't locate XML/LibXML/SAX.pm in @INC (@INC > contains: /home/mbunkus/build/mosu/maintained/perl-config- > any/src/Config-Any-0.23/inc > /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any- > 0.23/blib/lib > /home/mbunkus/build/mosu/maintained/perl-config-any/src/Config-Any- > 0.23/blib/arch > /usr/lib/perl5/site_perl /usr/share/perl5/site_perl > /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl > /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at (eval 7) > line 1. > # Looks like your test exited with 2 before it could output anything. > t/54-xml.t ............ Dubious, test returned 2 (wstat 512, 0x200) > Failed 6/6 subtests > > For 54-xml.t I can already see a logic error: > > my $broken_libxml > = eval { require XML::LibXML; XML::LibXML->VERSION lt '1.59'; > }; > skip 'XML::LibXML < 1.58 has issues', 2 if $broken_libxml; > > Now if the require aborts eval returns falsish and "skip" is not > executed.
This is very strange. XML::LibXML is actually not required at all. The check above was for a particular issue we had with an older version of XML::LibXML, which will provide an alternate SAX parser *if installed*. So, I believe the logic is sound: $broken_libxml will be true if XML::LibXML was installed AND it is older than '1.59' (the version comparison is a bit weak, i know). I wonder if your ParserDetails.ini file is out-of-sync with what you have available on your system? What happens if you run this: XML_SIMPLE_PREFERRED_PARSER=XML::SAX::PurePerl prove -lv t/54-xml.t Let me know! -Brian
Subject: Re: [rt.cpan.org #85539] tests fail if XML::LibXML is not installed
Date: Fri, 24 May 2013 09:24:12 +0200
To: bug-Config-Any [...] rt.cpan.org
From: Moritz Bunkus <moritz [...] bunkus.org>
Hey, with the command you suggested both tests pass (I tried 20-parse.t as well as 54-xml.t). Your reasoning about $broken_libxml sounds OK to me, yes. My ParserDetails.ini contains the following: ------------------------------------- [XML::SAX::PurePerl] http://xml.org/sax/features/namespaces = 1 [XML::LibXML::SAX::Parser] http://xml.org/sax/features/namespaces = 1 [XML::LibXML::SAX] http://xml.org/sax/features/namespaces = 1 ------------------------------------- Even though I've never touched the file myself it also does not belong to any package installed on my system. So I cannot try things like re-installing the owning package -- I simply don't know when it was created, nor by whom. Kind regards, mosu
On Fri May 24 04:24:42 2013, moritz@bunkus.org wrote: Show quoted text
> Hey, > > with the command you suggested both tests pass (I tried 20-parse.t as > well as 54-xml.t). > > Your reasoning about $broken_libxml sounds OK to me, yes. > > My ParserDetails.ini contains the following: > > ------------------------------------- > [XML::SAX::PurePerl] > http://xml.org/sax/features/namespaces = 1 > > [XML::LibXML::SAX::Parser] > http://xml.org/sax/features/namespaces = 1 > > [XML::LibXML::SAX] > http://xml.org/sax/features/namespaces = 1 > -------------------------------------
So, it looks like this is an issue with your machine rather than the module. I will be closing this ticket. Possible work-arounds would be: 1) Set that ENV variable somewhere in your code/script -- that way it will use the specified parser 2) Modify the ParserDetails.ini file to remove the offending entries You may want to file a bug with your respective OS vendor as well, though that may be a fruitless exercise. Cheers, -Brian