szabgab has asked for the wisdom of the Perl Monks concerning the following question:
The local legal department decied that they want to check and approve or reject each module before we can use them, so I collect the names and versions of the module we need.
I am looking for a strategy to consolidate this mess so we won't go crazy in maintaining the scripts and the required CPAN modules and legal won't need to approve 3-4 version of the same CPAN module. I thought of several strategies:
One central CPAN installation
We install all the CPAN modules in @INC, all the scripts use this installation.
For this we pick one version from each module - probably the newest among those I saw in use or even the latest from CPAN - get legal to approve it and make sure all the scripts work with this version.
Every script needs to use these versions and only in very special cases we accept the use of another version of a module. In this case we need to supply the module in perllib directory private to that script.
This approach reduces the duplication in module installations but makes it quite difficult or impossible to upgrade a CPAN module as we have to make sure that all the scripts work properly with the new version.
Each script comes with its own perllib directory
Every script author manages the list of his own CPAN modules and versions.
This way noone is foced to look at what others are doing in terms of CPAN versions.
The problem arises if we have a common library using some CPAN modules and a script that is using CPAN modules and this library. If they use different version of the same CPAN module or if the library is upgrading it CPAN module we are back in the same problem as with "one CPAN installation". If we handled this internal library the same way as we do with the CPAN modules then every script author can decide when to upgrade to the new version and deal with the version collision then.
The problem of course is that we have many duplicate installations of the same modules and I am sure we will soon have different versions of the same modules.
We also need to have an easy way to install these CPAN modules on the production systems.
Separate perllib for each CPAN module
In this case we install every cpan module in a directory of its own:
perllib/dbi_1.49
perllib/dbi_1.50
each script can then "use lib" whatever directories it wants and will get exactly the module versions it needs.
This might make module installation easier as we can ask the system group to install each module, but we might break interdependencies easily. E.g. DBD::SQLite might depend on DBI::1:50 and during the installation of DBD::SQLite we might have used perllib/dbi_1.50 but there is nothing to stop us from trying to use it now with perllib/dbi_1.49.
This does not sound like a good idea, after all.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Versions of CPAN modules for several perl scripts
by Fletch (Bishop) on May 16, 2006 at 13:51 UTC | |
|
Re: Versions of CPAN modules for several perl scripts
by jdtoronto (Prior) on May 16, 2006 at 14:17 UTC | |
|
Re: Versions of CPAN modules for several perl scripts
by chromatic (Archbishop) on May 16, 2006 at 16:48 UTC | |
by szabgab (Priest) on May 16, 2006 at 21:03 UTC |