Skip to content
dom96 edited this page Feb 19, 2011 · 4 revisions

Currently babel installs all library and application packages to ~/.babel/lib and ~/.babel/bin respectively. ~/.babel/packages is used as a database to store all the information about installed packages; the .babel files.

Versioning

The latest version of a library always resides in ~/.babel/lib/package/, when the library is upgraded the currently installed version gets moved to ~/.babel/lib/package/x.x.x and the new version is installed to ~/.babel/lib/package/.

Failures with this method

This method will fail if a package requires a specific version of a package. For example:

Package A 0.1 and 0.2 is installed.

Package B requires Package A 0.1

Package B refers(in the source code) to Package A without explicitly specifying the version of Package A wanted: import "packageA/file"

This will cause Package B to be compiled with 0.2 version of Package A which we do NOT want.

Solution

Normally the latest version is stored in ../lib/packageName/, with the other versions being stored in ../lib/packageName/x.x.x/. All we need to do is simply move the latest version (temporarily) to a different folder and move the version that is required by the package being compiled to ../lib/packageName/.

Other solutions

Extending the nimrod compiler so that it supports a requires pragma

{.requires packageA "0.1".}

import "packageA/module" will then cause Nimrod to pick packageA/0.1/module.

If there is no requires pragma, import "packageA/module" should still import the latest version of that package, this also means that even the latest version of a package will reside in a x.x.x folder to denote the version.