metamod:adding_dependencies

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
metamod:adding_dependencies [2011-06-29 11:27:17]
oysteint
metamod:adding_dependencies [2022-05-31 09:29:32] (current)
Line 1: Line 1:
 ====== Adding Perl module dependencies ====== ====== Adding Perl module dependencies ======
  
-To deal with Perl module dependencies in a safe way the METAMOD project has developed its own dependencies handler that at all times keeps track of a dependency graphThe dependency graph contains information on which modules depend on each other and what version is needed. The dependency handler was mainly created to solve the following problems: +Deprecated since 2.13, which now uses [[http://search.cpan.org/~miyagawa/carton-v0.9.15/lib/Carton.pm|Carton]].
- +
-  * If installing Perl modules from an OS repository (like the Ubuntu repo) you are dependent on the version used by the OS version. +
-    * This modules can often be out-dated. +
-    * You are not guaranteed that the version X and version Y of the OS use compatible versions of the same module. +
-    * The module might not be available. +
-  * If installing Perl modules via a CPAN client you will always get the lastest version of a module. The module version will therefore depend on the time of installation and different machines will get different configurations. This often leads to bugs that are hard to track down and are a complete waste of time. +
- +
-The dependency handler used in METAMOD is one possible approach to this problem. The rest of the document describes how a new module can be added to graph. +
- +
-===== Checking out dependency handler with graphs ===== +
- +
-More to come.... +
- +
-===== Check what is required for adding the module to the graph ===== +
- +
-Before adding a module to the graph is recommended to check what this will required of module upgrades and adding of new modules. +
- +
-<code> +
-$ perl dependency_handler.pl --config deps-config.json --check POE +
-The following modules needs to be added:  +
-Module: IO Required for phase(s): runtime +
-Module: IO::Handle Required for phase(s): runtime +
-Module: IO::Tty Required for phase(s): runtime +
-Module: JSON::PP Required for phase(s): runtime +
-Module: Version::Requirements Required for phase(s): runtime +
-Module: CPAN::Meta Required for phase(s): runtime +
-Module: POE::Test::Loops Required for phase(s): configure,build,runtime +
-Module: POE Required for phase(s): configure,build,test,runtime,develop +
-The following modules needs to be updated:  +
-Module: Parse::CPAN::Meta Current version: 1.40 Wanted version: 1.4401 +
-</code> +
- +
-This output tells you the list of modules that will be added and that we need to upgrade 'Parse::CPAN::Meta' before we add the module to the graph. +
- +
-===== Upgrade necessary modules ===== +
- +
-If you want to update a module or are required to upgrade a module before adding a new dependency do as follows. Note that modules will NEVER be auto-update to a new versionThis is prevent nasty surprises that can arise when modules are updated to a new version. +
- +
-<code> +
-$ dependency_handler.pl --config deps-config.json --update Parse::CPAN::Meta +
-[INFO] Starting download of Parse-CPAN-Meta-1.4401 +
-[INFO] Download complete for Parse-CPAN-Meta-1.4401 +
-</code> +
- +
-===== Add a new module ===== +
- +
-Now we can add the module that we wantedAdding a module will also automatically add all dependencies. +
- +
-<code> +
-$ dependency_handler.pl --config deps-config.json --add POE +
-[INFOSkipping download of ExtUtils-MakeMaker-6.56, already in repository +
-[INFOSkipping download of PathTools-3.33, already in repository +
- +
-... +
- +
-[INFO] Starting download of POE-1.311 +
-[INFO] Download complete for POE-1.311 +
-</code> +
- +
- +
-===== Build all modules in the graph ===== +
- +
-Now that we have added a new module to the graph it is recommended to re-build all the dependencies in the graph. Depending on the size of your graph this will take quite a lot of time. +
- +
-<code> +
-$ dependency_handler.pl --config deps-config.json --install <install dir> +
-</code>+
  • metamod/adding_dependencies.1309346837.txt.gz
  • Last modified: 2022-05-31 09:23:19
  • (external edit)