Full error: Writing /var/tmp/portage/XML-SAX-ExpatXS-1.08/image//usr/lib/perl5/vendor_perl/5.8.6/i686-linux/auto/XML/SAX/ExpatXS/ .packlist Appending installation info to /var/tmp/portage/XML-SAX-ExpatXS-1.08/image//usr/lib/perl5/5.8.6/i686-linux/perllocal. pod Can't locate XML/SAX/ExpatXS.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/site_perl/5.8.6/i686-linux /usr/lib/ perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.2/i686-linux /usr/lib/perl5/site_pe rl /usr/lib/perl5/vendor_perl/5.8.6/i686-linux /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.2 /usr /lib/perl5/vendor_perl/5.8.2/i686-linux /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.5/i686-linux /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.6/i686-linux /usr/lib/perl5/5.8.6 /usr/local/lib/site_perl /usr/lib/per l5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.2/i686-linux .) at /usr/lib/perl5/vendor_perl/5.8.6/XML/SAX.pm line 1 47. make: *** [install_expat_xs] Error 2 emerge info: Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.3, glibc-2.3.5-r0, 2.6.12-gentoo-r6 i686) ================================================================= System uname: 2.6.12-gentoo-r6 i686 AMD Athlon(tm) XP 2500+ Gentoo Base System version 1.6.13 dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.11 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -frerun-loop-opt -frerun-cse-after-loop -falign-functions=4 -ftracer -mmmx -m3dnow -msse" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -frerun-loop-opt -frerun-cse-after-loop -falign-functions=4 -ftracer -mmmx -m3dnow -msse" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks fixpackages sandbox sfperms strict" GENTOO_MIRRORS="ftp://192.168.1.162 http://gentoo.blueyonder.co.uk" LANG="en_GB" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://192.168.1.162/gentoo-portage" USE="x86 3dnow 3dnowex X aac alsa apache apache2 apm avi bash-completion berkdb bitmap-fonts bonobo canna cddb cdparanoia cdr clamav crypt cups curl divx4linux dvd eds emboss encode escreen f-prot fam firefox flac foomaticdb fortran freetds gd gd-external gdbm gif gnome gnomedb gpm gstreamer gtk gtk2 gtkhtml guile hal imagemagick imlib innodb java jpeg junit lcms ldap libcaca libg++ libwww mad mailwrapper mikmod mmx mmx2 mono motif mozilla mp3 mpeg mssql mysql ncurses nls no-old-linux nptl nptlonly nvidia odbc ogg oggvorbis opengl pam pcre pdflib perl php png ppds python qt quicktime readline real rtc ruby samba scanner sdl sendmail slang spamassassin spell sqlite sse ssl svga tcpd tidy tiff truetype truetype-fonts type1-fonts unicode usb vhosts vorbis xine xml xml2 xmms xprint xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS Reproducible: Always Steps to Reproduce: 1. 2. 3.
Mass re-assign.
Below is part of Makefile.PL from XML::SAX::ExpatXS that is causing the installation error. Notice how install_expat_xs is appended to the install target. When the install target is called it starts a new Perl process which expects the XML::SAX::ExpatXS .pm to already be installed. Adding the "image" directory to @INC so the Makefile can continue ie: PERL5LIB=/var/tmp/portage/XML-SAX-ExpatXS-1.08/image/usr/lib/perl5/vendor_perl/5.8.6 g-cpan -i XML-SAX-ExpatXS returns a sandbox error because it tries to write to the file: /usr/lib/perl5/vendor_perl/5.8.6/XML/SAX/ParserDetails.ini Makefile.PL snippet that is the source of the problem: sub MY::install { package MY; my $script = shift->SUPER::install(@_); if (ExtUtils::MakeMaker::prompt("Do you want to alter ParserDetails.ini?", "Y") =~ /^y/i) { $script =~ s/install :: (.*)$/install :: $1 install_expat_xs/m; $script .= <<"INSTALL"; install_expat_xs : \t\@\$(PERL) -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::ExpatXS))->save_parsers()" INSTALL
yeeeks, I didn't even realize this bug existed until the last cc added themselves overnight. Let's see - interactive modules (like the prompting for adding to parsedetails in this case) are always going to be a problem for g-cpan (even if there have been a ton of changes since this original post). In this particular case, I'd recommend editing the generated ebuild and adding this to the bottom: src_unpack() { unpack ${A} sed -i -e "s|y/|n/|" ${S}/Makefile.PL } then running ebuild XML-SAX-ExpatXS-1.20.ebuild digest to regenerate the digest.
That is not the primary bug on this. And in fact, there is another Bugzilla bug opened for that kind of problem by me (42189). The bigger problem is that the module expects itself to be installed during a postinstall make target so that it can modify a file that really does need to be modified so that the XML::SAX::ParserFactory can instantiate this module if called upon to do so. Unfortunately, I had already worked around this problem by using cpan to install the module and then using g-cpan to re-install the module so that I can track any future updates through portage.
g-cpan isn't perfect - can't be. Module authors rarely follow the same recipe twice. I'm afraid this is a can't fix kind of bug -its outside the scope of an app like g-cpan to be able to account for absolutely every possibility in cpan i'm afraid.
many moons later, actually marking it cantfix this time (sorry for the shout from the past)