Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 260170

Summary: net-analyzer/smokeping bundles and conflicts with multiple Perl modules
Product: Gentoo Linux Reporter: Jeremy Stent <stentj>
Component: New packagesAssignee: Peter Volkov (RETIRED) <pva>
Status: RESOLVED FIXED    
Severity: normal CC: brian, chtekk, infowolfe, joost.ruis, lame, mephinet, qa
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 251464    
Attachments: emerge --info
Proposed fix ebuild
Differences between 2.4.2 and my 2.4.2-r1

Description Jeremy Stent 2009-02-24 20:36:05 UTC
Trying to merge net-analyzer/smokeping-2.4.2 I get told that there are file conflicts with dev-perl/JSON-2.13 and dev-perl/CGI-Session-4.40

Reproducible: Always

Steps to Reproduce:
1.  Attempt to merge net-analyzer/smokeping-2.4.2


Actual Results:  
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at http://bugs.gentoo.org unless you report exactly which
 * two packages install the same file(s). Once again, please do NOT file
 * a bug report unless you have completely understood the above message.
 *
 * package net-analyzer/smokeping-2.4.2 NOT merged
 *
 * Detected file collision(s):
 *
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ErrorHandler.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Tutorial.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/storable.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/default.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/freezethaw.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/file.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/mysql.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/postgresql.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/sqlite.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/db_file.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/DBI.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ID/md5.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ID/static.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ID/incr.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Test/Default.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON/PP5005.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON/PP56.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON/PP.pm
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *
 * dev-perl/JSON-2.13
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON/PP.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON/PP5005.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/JSON/PP56.pm
 *
 * dev-perl/CGI-Session-4.40
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/DBI.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/db_file.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/file.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/mysql.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/postgresql.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Driver/sqlite.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ErrorHandler.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ID/incr.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ID/md5.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/ID/static.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/default.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/freezethaw.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/storable.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Test/Default.pm
 *      /usr/lib64/perl5/vendor_perl/5.8.8/CGI/Session/Tutorial.pm
 *
 * Package 'net-analyzer/smokeping-2.4.2' NOT merged due to file
 * collisions. If necessary, refer to your elog messages for the whole
 * content of the above message.


Expected Results:  
Successful merge
Comment 1 Jeremy Stent 2009-02-24 20:36:59 UTC
Created attachment 183060 [details]
emerge --info
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-03-08 03:45:36 UTC
I just ran into this as well.

JSON is going to be a major major headache, unless upstream smokeping gets involved.

JSON 1.x (bundled _twice_ with smokeping) and JSON 2.x are incompatible.
http://search.cpan.org/~makamaka/JSON-2.14/lib/JSON.pm#INCOMPATIBLE_CHANGES_TO_OLD_VERSION

Most specific to smokeping, notice that all of JSONRPC is completely removed and you're told to use JSON::RPC instead (with a completely different interface).
Comment 3 Joost Ruis 2009-08-10 09:36:58 UTC
Same thing happening here on 2 different arches.
Comment 4 Joost Ruis 2009-09-24 06:37:53 UTC
 * dev-perl/CGI-Session-4.36
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/DBI.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/db_file.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/file.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/mysql.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/postgresql.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/sqlite.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ErrorHandler.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ID/incr.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ID/md5.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ID/static.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/default.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/freezethaw.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/storable.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Test/Default.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Tutorial.pm
 *
 * dev-perl/JSON-2.12
 *      /usr/lib/perl5/vendor_perl/5.8.8/JSON.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/JSON/PP.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/JSON/PP5005.pm
 *      /usr/lib/perl5/vendor_perl/5.8.8/JSON/PP56.pm
Comment 5 mephinet 2009-10-11 14:56:01 UTC
at least with perl 5.10, there is another conflict with dev-perl/SNMP_Session-0.92-r1:

 * 	/usr/lib64/perl5/vendor_perl/5.10.1/BER.pm
 * 	/usr/lib64/perl5/vendor_perl/5.10.1/SNMP_util.pm
 * 	/usr/lib64/perl5/vendor_perl/5.10.1/SNMP_Session.pm
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-12-31 12:29:29 UTC
Confirmed SNMP_Session as well.

This is getting a big problem, Peter can we fix this or should be dropped?
Comment 7 Allen Parker 2010-01-03 08:26:44 UTC
There's an easy solution to these problems. Instead of pushing all of the upstream shipped libs into vendor_perl, give smokeping its own private library path where it won't interfere, and 'use lib $targetdir'

I'll hopefully be working on this soon (within the next month).
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-01-03 13:33:12 UTC
That would only solve half the issue (the conflicts) without solving the problem of bundling external libraries.
Comment 9 Allen Parker 2010-01-03 17:54:54 UTC
(In reply to comment #8)
> That would only solve half the issue (the conflicts) without solving the
> problem of bundling external libraries.
> 

Actually, the problem is a violation of perl 'best practice.' If you look at larger applications, such as otrs, they ship their own complete cpan-lib so that the application knows which versions of modules it depends on it's dealing with. The issue with JSON-2 api changes is known.

If you've got a suggestion for where smokeping's cpan-lib should go, please share it.

 59     # Install the CGI webserver scripts
 60     sed 's:^use lib:#use lib:g' -i htdocs/*.cgi.dist

These lines show that the maintainer has made the choice to completely disregard upstream's 'wishes' with regards to packaging upstream's shipped versions of Digest::HMAC, Config::Grammar, JSON-1, and CGI::Session.
Comment 10 Allen Parker 2010-01-03 18:07:43 UTC
Comments from upstream in doc/smokeping_install.txt (best viewed w/ less||more||cat):
       bin/smokeping
           Make sure all the required libraries are available and the first
           line of the script points to your copy of perl. Adjust the use lib
           lines to point to your RRDtool installation and to the
           Smokeping/lib directory and edit the path of the config file to be
           in sync with reality.

That looks like upstream intends for lib/* to not be installed in vendor_perl to me, thus removing all conflicts and causing the least amount of headache to its users.
Comment 11 Joost Ruis 2010-03-02 09:07:36 UTC
The issue is still there with latest smokeping-2.4.2

please fix it or mask smokeping?
Did somebody actually contact upstream?
Comment 12 Brian Smith 2010-03-26 19:52:54 UTC
Created attachment 225365 [details]
Proposed fix ebuild
Comment 13 Brian Smith 2010-03-26 19:53:20 UTC
Created attachment 225367 [details, diff]
Differences between 2.4.2 and my 2.4.2-r1
Comment 14 Brian Smith 2010-03-26 19:55:04 UTC
(In reply to comment #10)
> That looks like upstream intends for lib/* to not be installed in vendor_perl
> to me, thus removing all conflicts and causing the least amount of headache to
> its users.
> 

That's how we felt, and wrote an ebuild that moves them into /usr/lib/smokeping. I've attached the ebuild we use as a proposed fix (or at least for others to use until a better fix comes along.)

Note that you'll probably want to turn off 'use warnings;', as it throws quite a lot of them due to prototype mismatches.
Comment 15 Peter Volkov (RETIRED) gentoo-dev 2010-03-29 15:07:53 UTC
dev-perl/CGI-Session and dev-perl/SNMP_Session now dropped from bundled libs and system version will be used. With dev-perl/JSON I think bloker is current solution until somebody suggest something better (like upstream patch to rename it to JSON1). FIXED.
Comment 16 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-03-16 08:29:20 UTC
*** Bug 461902 has been marked as a duplicate of this bug. ***