Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 80540
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: kmx [...] cpan.org
Cc:
AdminCc:

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



Subject: 2.0008 breaks libxml2 detection in strawberry perl
Strwaberry perl comes with libxml2 library that used to be correctly detected by XML-LibXML 2.0007 and earlier

2.0008 seems to introduce a change that broke this detection.

--
kmx
The trouble maker is a newly added line:

LIBS => $config{LIBS}

in Makefile.PL / sub _libxml_check_lib

To be honest the detection routine is for me kind of dark magic but I suspect that the root of the trouble is in Mafefile.PL section "# fix the ld flags" where strawbery perl for some reason falls into else block setting:

$config{LIBS} .= ' -llibxml2 -lzlib -llibgettextlib.dll';.

which is obviously nonsense (the detection used to worked on strawberry perl probably only by accident) and after applying the following patch things work again:

--- XML-LibXML-2.0008\Makefile.PL       Mon Oct 22 12:10:49 2012
+++ XML-LibXML-2.0008_patched\Makefile.PL       Thu Nov 01 09:44:57 2012
@@ -293,7 +293,7 @@
     if( $ENV{ACTIVEPERL_MINGW} ) {
       $config{LIBS} .= ' -llibxml2.lib -lzlib.lib';
     } else {
-      $config{LIBS} .= ' -llibxml2 -lzlib -llibgettextlib.dll';
+      $config{LIBS} .= ' -lxml2 -lzlib'; # applied e.g. for strawberry perl
     }
   } else {
     $config{LIBS} .= ' -lxml2 -lz -lm';



Hi KMX, On Thu Nov 01 04:50:47 2012, KMX wrote: Show quoted text
> The trouble maker is a newly added line: > > LIBS => $config{LIBS} > > in Makefile.PL / sub _libxml_check_lib > > To be honest the detection routine is for me kind of dark magic but I > suspect > that the root of the trouble is in Mafefile.PL section "# fix the ld > flags" > where strawbery perl for some reason falls into else block setting: > > $config{LIBS} .= ' -llibxml2 -lzlib -llibgettextlib.dll';. > > which is obviously nonsense (the detection used to worked on > strawberry perl > probably only by accident) and after applying the following patch > things work > again: > > --- XML-LibXML-2.0008\Makefile.PL Mon Oct 22 12:10:49 2012 > +++ XML-LibXML-2.0008_patched\Makefile.PL Thu Nov 01 09:44:57 2012 > @@ -293,7 +293,7 @@ > if( $ENV{ACTIVEPERL_MINGW} ) { > $config{LIBS} .= ' -llibxml2.lib -lzlib.lib'; > } else { > - $config{LIBS} .= ' -llibxml2 -lzlib -llibgettextlib.dll'; > + $config{LIBS} .= ' -lxml2 -lzlib'; # applied e.g. for strawberry > perl > } > } else { > $config{LIBS} .= ' -lxml2 -lz -lm';
Well, I wanted to keep the line so I implemented a more complicated fix which checks for all alternatives in the repository. Can you download the tip tarball from https://bitbucket.org/shlomif/perl-xml-libxml/downloads (or alterantively use Mercurial to clone it) and let me know if it works for you? I'll try to run it in a Windows VM or partition. Regards, -- Shlomi Fish
On Thu Nov 01 06:46:04 2012, SHLOMIF wrote: Show quoted text
> Hi KMX, > > On Thu Nov 01 04:50:47 2012, KMX wrote:
> > The trouble maker is a newly added line: > > > > LIBS => $config{LIBS} > > > > in Makefile.PL / sub _libxml_check_lib > > > > To be honest the detection routine is for me kind of dark magic but I > > suspect > > that the root of the trouble is in Mafefile.PL section "# fix the ld > > flags" > > where strawbery perl for some reason falls into else block setting: > > > > $config{LIBS} .= ' -llibxml2 -lzlib -llibgettextlib.dll';. > > > > which is obviously nonsense (the detection used to worked on > > strawberry perl > > probably only by accident) and after applying the following patch > > things work > > again: > > > > --- XML-LibXML-2.0008\Makefile.PL Mon Oct 22 12:10:49 2012 > > +++ XML-LibXML-2.0008_patched\Makefile.PL Thu Nov 01 09:44:57 2012 > > @@ -293,7 +293,7 @@ > > if( $ENV{ACTIVEPERL_MINGW} ) { > > $config{LIBS} .= ' -llibxml2.lib -lzlib.lib'; > > } else { > > - $config{LIBS} .= ' -llibxml2 -lzlib -llibgettextlib.dll'; > > + $config{LIBS} .= ' -lxml2 -lzlib'; # applied e.g. for strawberry > > perl > > } > > } else { > > $config{LIBS} .= ' -lxml2 -lz -lm';
> > Well, I wanted to keep the line so I implemented a more complicated fix > which checks for all alternatives in the repository. Can you download > the tip tarball from > https://bitbucket.org/shlomif/perl-xml-libxml/downloads (or > alterantively use Mercurial to clone it) and let me know if it works for > you? I'll try to run it in a Windows VM or partition. >
OK, I ran it on a Windows XP 32-bit VM with Dwimperl 5.14.2 (a Strawberry Perl derivative). perl Makefile.PL ; dmake ; and dmake test were all successful with the Mercurial tip. I'm still going to wait a little for a confirmation from you. Note that there were some warnings about undefined values used in concatenation, but everything is otherwise OK. Regards, -- Shlomi Fish
Subject: Re: [rt.cpan.org #80540] 2.0008 breaks libxml2 detection in strawberry perl
Date: Thu, 01 Nov 2012 13:50:25 +0100
To: bug-XML-LibXML [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
I confirm that the latest version (commit:b149cdc <https://bitbucket.org/shlomif/perl-xml-libxml/changeset/b149cdc7247d9987adf96c6d9f1211ee38e41ee8>) works fine with strawberry perl Just 2 warnings like this: Use of uninitialized value $config{"LIBS"} in concatenation (.) or string at Makefile.PL line 299. Use of uninitialized value $config{"LIBS"} in concatenation (.) or string at Makefile.PL line 299. Checking for ability to link against xml2...yes Thanks for prompt reply -- kmx
Hi KMX, On Thu Nov 01 08:50:38 2012, kmx@volny.cz wrote: Show quoted text
> I confirm that the latest version (commit:b149cdc > <https://bitbucket.org/shlomif/perl-xml- > libxml/changeset/b149cdc7247d9987adf96c6d9f1211ee38e41ee8>) > works fine with strawberry perl > > Just 2 warnings like this: > > Use of uninitialized value $config{"LIBS"} in concatenation (.) or > string > at Makefile.PL line 299. > Use of uninitialized value $config{"LIBS"} in concatenation (.) or > string > at Makefile.PL line 299. > Checking for ability to link against xml2...yes >
Thanks for the report and the proposed fix. The warnings should be fixed now. Please check XML-LibXML-2.0009 which was now uploaded to CPAN (and is available on the bitbucket repo). I'm going to mark this bug as RESOLVED. Regards, -- Shlomi Fish Show quoted text
> Thanks for prompt reply >
You're welcome.