CPAN's XML::SAX update conflicts with libxml-sax-perl's XML::SAX

Bug #13917 reported by Gabriel de Perthuis on 2005-03-13
406
This bug affects 45 people
Affects Status Importance Assigned to Milestone
libxml-sax-perl (Debian)
Fix Released
Unknown
libxml-sax-perl (Ubuntu)
Medium
Unassigned

Bug Description

POSSIBLE WORKAROUND
-------------------------------------

If you're stuck in an upgrade you might be able to fool `dpkg`, by placing "PERL5LIB=/usr/share/perl5" before the command you use to invoke for the upgrade.

Such as `PERL5LIB=/usr/share/perl5 apt-get dist-upgrade`, or `PERL5LIB=/usr/share/perl5 do-release-upgrade`

SUMMARY
--------------

BUG: XML::SAX can not be updated with CPAN/CPANP without totally breaking dpkg or other debian components that assume debian modifications are in XML::SAX.

DESCRIPTION OF BUG
---------------------------------

The currently distributed libxml-sax-perl conflicts with upstream XML::SAX. The debian developers hacked libxml-sax-perl's XML::SAX and added the function save_parsers_debian, and short circuited the sub save_parsers.

The precedence order of perl's @INC demands /usr/local/share/perl5 holds precedence over /usr/share/perl5, so the newer vanilla version from CPAN will be used by all any include of XML::SAX. This reates a problem because the cpan version of XML::SAX lacks the Debian specific functionality.

The fix is to remove Debian's pollution of XML::SAX class and subclass it (XML::SAX), into XML::SAX::Debian with the added Debian functionality. This will permit CPAN and CPANP updates of XML::SAX, and it will permit Debian guys to extend XML::SAX as they wish

CLUE STRING:: Can't locate object method "save_parsers_debian" via package "XML::SAX"
WORK AROUND:: `cpanp uninstall XML::SAX`

NOTES FROM README.debian: Original CPAN Package vs. Debian Package
------------------------------------------------------------------------------------------------------------------

Installing the original package from CPAN into /usr/local breaks the
Debian package, since the former is in Perl's @INC before the latter.
So, please don't do this.

If there's a new version of XML::SAX simply file a wishlist against
the Debian package and wait for the update.

Download full text (3.9 KiB)

Hi,

And all this would be a bug in libxml-sax-perl because of what exactly?

We don't have a policy about Debian and CPAN to coexist. This certainly
doesn't mean they should not, but it's not a requirement at this point in
time. Please bring this issue up at the debian-perl mailing list.

I've written a README.Debian for this module which I suggest you read. It
probably should be expanded to explain the background of why I wrote the
'update-perl-sax-parsers' script and the issues it solves. I'm working with
the upstream authors on a more widely usable solution for these issues (or at
least more support for it work smoothly in Debian).

The basic problem is that XML:SAX parsers are expected to register themselves
at installation time using the XML::SAX API resulting in a ParserDetails.ini
file originally in the same location where XML::SAX lives. Debian doesn't
allow package A to directly change a file owned by package B. Since the file
ParserDetails.ini is owned by XML::SAX, no other parser can register itself.
The 'update-perl-sax-parsers' script is a solution around this problem and every
parser (including the one in XML::SAX) is expected to call this script in the
postinst and prerm scripts. I enhanced the XML::SAX API by a subroutine called
'save_parsers_debian' and stubbed the original subroutine 'save_parsers'.

The Makefile.PL of local XML::SAX parsers has be to changed to comment out the
part where it registers itself using the original XML::SAX API. After install
you then have to call the 'update-perl-sax-parsers' script manually to register
the parser. I plan to put support in the 'update-perl-sax-parsers' script for
local ParserDetails.ini files (e.g. for users to have parsers under their home
directory).

So, unfortunately this is hopefully one of the rare occasions where Debian and
CPAN cannot coexist out of the box.

I'm not sure what to do exactly with this bug report. We don't have to support
/usr/local and you're responsible yourself for what you're doing there. If you
install software under /usr/local which also is already available under /usr and
made to work within the Debian framework, you're probably in for more situations
like this.

Thanks,
Ardo

Peter Sinnott (<email address hidden>) wrote:
> Package: libxml-sax-perl
> Version: 0.03-1
> Severity: important
>
> I installed the cpan version of XML::SAX after installing the
> debian packaged version. When the package was updated it failed to install
> because the cpan version at /usr/local/share/perl/5.6.1/XML/SAX.pm
> was found in the @INC before /usr/share/perl5/XML/SAX.pm.
> libxml-libxml-perl was also being updated at the time.
>
> Setting up libxml-sax-perl (0.03-1) ...
> update-perl-sax-parsers: adding Perl SAX parser module info file of XML::SAX::PurePerl...
> Can't locate object method "save_parsers_debian" via package "XML::SAX" (perhaps you forgot to load "XML::SAX"?) at /usr/bin/update-perl-sax-parsers
> line 96.
> dpkg: error processing libxml-sax-perl (--configure):
> subprocess post-installation script returned error exit status 255
> dpkg: dependency problems prevent configuration of libxml-libxml-perl:
> libxml-libxml-perl depends on lib...

Read more...

tags 129439 pending
tags 129685 pending
tags 129891 pending
tags 130208 pending
tags 131763 pending
tags 132261 pending
tags 130186 pending
tags 129413 pending
severity 130376 wishlist
tags 132989 pending
thanks
--
Ardo van Rangelrooij
home email: <email address hidden>
home page: http://people.debian.org/~ardo
GnuPG fp: 3B 1F 21 72 00 5C 3A 73 7F 72 DF D9 90 78 47 F9

tag 147460 upstream
tag 153991 upstream
tag 174067 upstream
tag 131831 upstream
tag 141330 upstream
tag 151029 upstream
tag 172616 upstream
tag 174516 upstream
tag 174793 upstream
tag 175485 pending
tag 155214 upstream
tag 63318 pending
tag 130376 pending
tag 137998 pending
thanks
--
Ardo van Rangelrooij
home email: <email address hidden>
home page: http://people.debian.org/~ardo
GnuPG fp: 3B 1F 21 72 00 5C 3A 73 7F 72 DF D9 90 78 47 F9

We believe that the bug you reported is fixed in the latest version of
libxml-sax-perl, which is due to be installed in the Debian FTP archive:

libxml-sax-perl_0.12-1.diff.gz
  to pool/main/libx/libxml-sax-perl/libxml-sax-perl_0.12-1.diff.gz
libxml-sax-perl_0.12-1.dsc
  to pool/main/libx/libxml-sax-perl/libxml-sax-perl_0.12-1.dsc
libxml-sax-perl_0.12-1_all.deb
  to pool/main/libx/libxml-sax-perl/libxml-sax-perl_0.12-1_all.deb
libxml-sax-perl_0.12.orig.tar.gz
  to pool/main/libx/libxml-sax-perl/libxml-sax-perl_0.12.orig.tar.gz

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ardo van Rangelrooij <email address hidden> (supplier of updated libxml-sax-perl package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----

Format: 1.7
Date: Sun, 2 Feb 2003 11:56:49 -0600
Source: libxml-sax-perl
Binary: libxml-sax-perl
Architecture: source all
Version: 0.12-1
Distribution: unstable
Urgency: low
Maintainer: Ardo van Rangelrooij <email address hidden>
Changed-By: Ardo van Rangelrooij <email address hidden>
Description:
 libxml-sax-perl - Perl module for using and building Perl SAX2 XML processors
Closes: 130376 175485
Changes:
 libxml-sax-perl (0.12-1) unstable; urgency=low
 .
   * New upstream release
   * debian/copyright: updated
   * debian/control: upgraded to Debian Policy 3.5.8 (no changes)
   * debian/libxml-sax-perl.postrm: fixed to not to try to remove '/etc'
     (closes: Bug#175485)
   * Moved '/etc/XML' to '/etc/perl/XML'
   * update-perl-sax-parsers: updated copyright
   * update-perl-sax-parsers: ported to Getopt::Long;
   * update-perl-sax-parsers: added '--file' and '--directory' options to
     support local Perl SAX parser module registration (see manual page and
     README.Debian for all the details)
     (closes: Bug#130376)
   * update-perl-sax-parsers.8: updated to reflect changes
   * README.Debian: updated to reflect changes and added more info
   * Added examples for postinst and prerm scripts
Files:
 5792663a206591cac2906acdc549777f 741 interpreters optional libxml-sax-perl_0.12-1.dsc
 bff58bd077a9693fc8cf32e2b95f571f 59537 interpreters optional libxml-sax-perl_0.12.orig.tar.gz
 d159bc1c827a693ac7a63b2b12cace98 6582 interpreters optional libxml-sax-perl_0.12-1.diff.gz
 d1e2f960fe83c53ff494b56cf7f1fd59 78660 interpreters optional libxml-sax-perl_0.12-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iQCVAwUBPj1dYz6XMRfcxSjpAQGgVAP/TpF1h8imhbs1FBUHZhNtYztB0pD+ZnB9
LhyGJGAr2JyjghNUvOZ5a4LLdMJMfJh9YKGkJqkOi7Oicml4GTYN5P9BE6R1v8bT
xYO6zAuxZ/h6NIqxrdiuWB2rhpLtw+wiU8kk0LDlMwVowi/nNfCMVTwFtyA2+Vi+
QDaNDC6L5K8=
=LrbS
-----END PGP SIGNATURE-----

Here's the error:

Paramétrage de libxml-sax-perl (0.12-5) ...
Can't locate object method "save_parsers_debian" via package "XML::SAX" at
/usr/bin/update-perl-sax-parsers line 90.
dpkg : erreur de traitement de libxml-sax-perl (--configure) :
 le sous-processus post-installation script a retourné une erreur de sortie
d'état 255

Daniel Holbach (dholbach) wrote :

works charmingly nice:

daniel@bert:~$ LC_ALL=C sudo apt-get install --reinstall libxml-sax-perl
Password:
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  libxml-namespacesupport-perl
The following NEW packages will be installed:
  libxml-namespacesupport-perl libxml-sax-perl
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 94.5kB of archives.
After unpacking 537kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://archive.ubuntu.com breezy/main libxml-namespacesupport-perl 1.09-1
[15.0kB]
Get:2 http://archive.ubuntu.com breezy/main libxml-sax-perl 0.12-5 [79.5kB]
Fetched 94.5kB in 0s (138kB/s)

Preconfiguring packages ...
Selecting previously deselected package libxml-namespacesupport-perl.
(Reading database ... 165541 files and directories currently installed.)
Unpacking libxml-namespacesupport-perl (from
.../libxml-namespacesupport-perl_1.09-1_all.deb) ...
Selecting previously deselected package libxml-sax-perl.
Unpacking libxml-sax-perl (from .../libxml-sax-perl_0.12-5_all.deb) ...
Setting up libxml-namespacesupport-perl (1.09-1) ...
Setting up libxml-sax-perl (0.12-5) ...

daniel@bert:~$

Closing as FIXED.

David Silverkors (xduffy) wrote :

I get the same error as my french friend got:

david@GentileHunter:~$ sudo apt-get install --reinstall libxml-sax-perl
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  libxml-namespacesupport-perl
The following NEW packages will be installed:
  libxml-namespacesupport-perl libxml-sax-perl
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 94.5kB of archives.
After unpacking 537kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://archive.ubuntu.com breezy/main libxml-namespacesupport-perl 1.09-1
[15.0kB]
Get:2 http://archive.ubuntu.com breezy/main libxml-sax-perl 0.12-5 [79.5kB]
Fetched 94.5kB in 0s (241kB/s)

Preconfiguring packages ...
Selecting previously deselected package libxml-namespacesupport-perl.
(Reading database ... 75898 files and directories currently installed.)
Unpacking libxml-namespacesupport-perl (from
.../libxml-namespacesupport-perl_1.09-1_all.deb) ...
Selecting previously deselected package libxml-sax-perl.
Unpacking libxml-sax-perl (from .../libxml-sax-perl_0.12-5_all.deb) ...
Setting up libxml-namespacesupport-perl (1.09-1) ...
Setting up libxml-sax-perl (0.12-5) ...
Can't locate object method "save_parsers_debian" via package "XML::SAX" at
/usr/bin/update-perl-sax-parsers line 90.
dpkg: error processing libxml-sax-perl (--configure):
 subprocess post-installation script returned error exit status 255
Errors were encountered while processing:
 libxml-sax-perl
E: Sub-process /usr/bin/dpkg returned an error code (1)

And it doesn't matter if I use archive.ubuntu.com or se.archive.ubuntu.com.
I did complete removals between my 4-5 tries to install libxml-sax-perl...
Something smells fishy.(In reply to comment #1)
> works charmingly nice:
>
> daniel@bert:~$ LC_ALL=C sudo apt-get install --reinstall libxml-sax-perl
> Password:
> Reading package lists... Done
> Building dependency tree... Done
> The following extra packages will be installed:
> libxml-namespacesupport-perl
> The following NEW packages will be installed:
> libxml-namespacesupport-perl libxml-sax-perl
> 0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
> Need to get 94.5kB of archives.
> After unpacking 537kB of additional disk space will be used.
> Do you want to continue [Y/n]?
> Get:1 http://archive.ubuntu.com breezy/main libxml-namespacesupport-perl 1.09-1
> [15.0kB]
> Get:2 http://archive.ubuntu.com breezy/main libxml-sax-perl 0.12-5 [79.5kB]
> Fetched 94.5kB in 0s (138kB/s)
>
> Preconfiguring packages ...
> Selecting previously deselected package libxml-namespacesupport-perl.
> (Reading database ... 165541 files and directories currently installed.)
> Unpacking libxml-namespacesupport-perl (from
> .../libxml-namespacesupport-perl_1.09-1_all.deb) ...
> Selecting previously deselected package libxml-sax-perl.
> Unpacking libxml-sax-perl (from .../libxml-sax-perl_0.12-5_all.deb) ...
> Setting up libxml-namespacesupport-perl (1.09-1) ...
> Setting up libxml-sax-perl (0.12-5) ...
>
> daniel@bert:~$
>
>
> Closing as FIXED.

Ryan Hurley (spitty) wrote :

I'm having the same problem. I'm running Dapper, installed cleanly from a Flight 4 iso this morning. AFAIK, everything's updated. I've tried installing it, removing it, installing it again, removing it completely, and changing the address in the source.list line from archive.ubuntu.com to se.archive.com as suggested earlier, and repeating the whole thing over again. Something definitely looks broken here.

Here's the error produced:

spitfire@Cerberus:~$ sudo apt-get install libxml-sax-perl
Reading package lists... Done
Building dependency tree... Done
libxml-sax-perl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up libxml-sax-perl (0.12-5) ...
Can't locate object method "save_parsers_debian" via package "XML::SAX" at /usr/bin/update-perl-sax-parsers line 90.
dpkg: error processing libxml-sax-perl (--configure):
 subprocess post-installation script returned error exit status 255
Errors were encountered while processing:
 libxml-sax-perl
E: Sub-process /usr/bin/dpkg returned an error code (1)

(This is my first bug report, so please pardon any stupidities.)

I also have the same problem, using the final release. After the initial problems, I get nonstop errors whenever using apt:

michael@michael-laptop:~/Desktop/mcatalog-0.2$ sudo apt-get install gtk2-engines-clearlooks
Reading package lists... Done
Building dependency tree... Done
gtk2-engines-clearlooks is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up libxml-sax-perl (0.12-5) ...
Can't locate object method "save_parsers_debian" via package "XML::SAX" at /usr/bin/update-perl-sax-parsers line 90.
dpkg: error processing libxml-sax-perl (--configure):
 subprocess post-installation script returned error exit status 255
dpkg: dependency problems prevent configuration of libxml-libxml-perl:
 libxml-libxml-perl depends on libxml-sax-perl (>= 0.11); however:
  Package libxml-sax-perl is not configured yet.
dpkg: error processing libxml-libxml-perl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gtk-sharp2-gapi:
 gtk-sharp2-gapi depends on libxml-libxml-perl; however:
  Package libxml-libxml-perl is not configured yet.
dpkg: error processing gtk-sharp2-gapi (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gtk-sharp2:
 gtk-sharp2 depends on gtk-sharp2-gapi; however:
  Package gtk-sharp2-gapi is not configured yet.
dpkg: error processing gtk-sharp2 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libxml-sax-perl
 libxml-libxml-perl
 gtk-sharp2-gapi
 gtk-sharp2
E: Sub-process /usr/bin/dpkg returned an error code (1)
michael@michael-laptop:~/Desktop/mcatalog-0.2$

This is a VERY serious issue, I have no idea how this happened. Please address it!

I had the same problem as you, guys. The cause was, that I had XML::Sax installed twice - once as a compiled binary via the Ubuntu/Debian packaging system apt and once installed via CPAN.

The problem was that perl used the CPAN module (located in /usr/local/share/perl/5.8.7/XML/) instead of the modified debian version (located in /usr/share/perl5/XML/SAX.pm) that is required for the binary installation of libxml-sax-perl and libxml-sax-expat-perl.

RESOLUTION:
Uninstall the XML::Sax installed via CPAN (e.g. by means of CPANPLUS).

Good luck / bonne chance!

malyvelky's tip works.

I had the problem on ubuntu 6.06 after installing flickr::backup (or however its called)

there is one mistake in malyvelky's note: after you have installed CPANPLUS, you uninstall XML:SAX (uppercase sax) instead of XML:Sax

Evan Carroll (evancarroll) wrote :

This bug is not complete, it is an old bug the current "fix" is a workaround and will plague each successive version of all debian based distros.
Here you can find it on bugs.debian.org http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=130376
I'm working on fixing this now, and I've submitted a post upstream to the debian perl group.

Changed in libxml-sax-perl (Ubuntu):
assignee: nobody → EvanCarroll (evancarroll)
status: Fix Released → Incomplete
description: updated
description: updated
summary: - Doesn't install
+ CPAN's XML::SAX update conflicts with libxml-sax-perl's XML::SAX
Evan Carroll (evancarroll) wrote :
description: updated
description: updated
Changed in libxml-sax-perl (Ubuntu):
status: Incomplete → Confirmed
Evan Carroll (evancarroll) wrote :

You can see my post to Debian Perl Maintainers list here:
http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/2009-June/022079.html

tags: added: debian perl
Changed in libxml-sax-perl (Debian):
status: Unknown → Fix Released

A big thanks to you and others for your work on this bug. Awesome. :)

Evan Carroll (evancarroll) wrote :

Bug still not fixed and set to plague Jaunty upgrades that have a CPANP ugraded XML::Sax -- I'm sure a bunch of people will be reading this in two weeks, this is my "I told you so" from the past.

description: updated
description: updated
Ryan Niebur (ryan52) wrote :

instead of saying "I told you so", why don't you fix it? the only patch I've seen from you didn't work. if you can't handle fixing it, give up ownership of the bug so that I can.

Evan Carroll (evancarroll) wrote :

Take ownership, just to get you up to date. The response from Debian, where this bug should be fixed by all accounts, was "CPAN is not supported." You see, they don't think this a problem and they use other like violations to justify this one. Hacking stuff into a module for them, ensures that other things that use that module will get the behavior Debian wants. Which sits opposite to the genius of a perl package management system, and other generally supported means of doing this through subclassing, and forking.

In perl the mindset is do whatever you want, just do it such that it doesn't break whatever I want. In Debian the mindset is do what I want and if it breaks I don't care, and if you replace it you're unsupported.

I've submitted an offer to subclass and change dependencies on Debian to an XML::SAX::Debian, but that doesn't solve Debian's desire to screw up things not created by them. There was talk about changing the @INC path for all base-debian-scripts, but again this hasn't been done (as far as I can see), and it is still broken by the above.

The issue here is simple: either Debian has the right to alter fundamental behaviors of things they haven't created and publish them under the same name to break things that rely on them, or Debian doesn't. Debian continues to argue they do. This isn't a massive technical bug, it is a minor technical bug layered on top of a huge political one whereby all of the Debian perl team is retarded. They're behavior of /wanting/ to break my system and telling me that theirs holds precedence in light of an option to have two systems that can play together is insulting at best.

Changed in libxml-sax-perl (Ubuntu):
assignee: EvanCarroll (evancarroll) → nobody
Ryan Niebur (ryan52) on 2009-10-17
Changed in libxml-sax-perl (Ubuntu):
assignee: nobody → Ryan Niebur (ryan52)
Ansgar Burchardt (aburch) wrote :

Taking over as discussed with Ryan on IRC.

Changed in libxml-sax-perl (Ubuntu):
assignee: Ryan Niebur (ryan52) → Ansgar Burchardt (ansgar-43-1)
Changed in libxml-sax-perl (Ubuntu):
status: Confirmed → In Progress

I am out of the office from Tue 05/01/2010 until Mon 11/01/2010.

I will respond to your message when I return.

If you have an urgent enquiry, please call 0800 SOLNET or contact Stewart
Gebbie <email address hidden>.

Regards
Martyn Young

Note: This is an automated response to your message "[Bug 13917] Re:
CPAN's XML::SAX update conflicts with libxml-sax-perl's XML::SAX" sent
on 1/6/10 6:42:17 AM.

This is the only notification you will receive while this person is away.

Attention:
This email may contain information intended for the sole use of
the original recipient. Please respect this when sharing or
disclosing this email's contents with any third party. If you
believe you have received this email in error, please delete it
and notify the sender or <email address hidden> as
soon as possible. The content of this email does not necessarily
reflect the views of Solnet Solutions Ltd.

Ansgar Burchardt (aburch) wrote :

Fix uploaded to Debian, will be fixed in Ubuntu when the package is synced.

Changed in libxml-sax-perl (Ubuntu):
assignee: Ansgar Burchardt (ansgar-43-1) → nobody
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libxml-sax-perl - 0.96+dfsg-2

---------------
libxml-sax-perl (0.96+dfsg-2) unstable; urgency=low

  [ Ansgar Burchardt ]
  * Move Debian-specific functions to a subclass as suggested by Evan Carroll.
    If XML::SAX is installed via CPAN, it will not see the ParserDetails.ini
    in /etc/perl/XML/SAX, ie. users will have to enable additional parsers by
    hand or install them via CPAN as well. (LP: #13917)
  * Use minimal debian/rules.
  * Add myself to Uploaders.
  * Bump Standards-Version to 3.8.3 (no changes).

  [ gregor herrmann ]
  * Adjust debian/{rules,copyright} to debian/repack.stub.
  * debian/patches: update formatting and headers.
  * New patch pod-spelling: fix some spelling errors in the POD.
 -- Ubuntu Archive Auto-Sync <email address hidden> Mon, 18 Jan 2010 07:31:43 +0000

Changed in libxml-sax-perl (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.