Suggestions for improving version management
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ASDF |
New
|
Undecided
|
Unassigned |
Bug Description
This is a proposal for improving the way ASDF handles systems/components versions. The problem is that it currently forces systems to follow its own (simplistic) versioning scheme. The idea is to remove that constraint, letting system authors version their software as they wish, without breaking backward compatibility. In case a system uses a non default versioning scheme, then ASDF should delegate the versioning logic to the system itself.
ASDF currently does 2 things with version information: checking for version compatibility and normalizing version strings (in its own, arbitrary way).
Checking for version compatilibity is done via VERSION-SATISFIES. The good thing is that this already is a generic function, so delegation is possible by subclassing the ASDF:SYSTEM class and providing a new method specialized on this new class (see below).
Normalizing version strings is done via NORMALIZE-VERSION. Unfortunately, this is a regular function. The attached patch implements a solution. It provides a new generic function NORMALIZE-
With this in place, a system author could implement his own versioning scheme like this:
(defclass my-system (asdf:system) ())
(defmethod asdf:version-
#| implement your logic here |#)
(defmethod asdf/parse-
((system my-system) form &key pathname component parent)
(declare (ignore pathname component parent))
#| normalize as you wish, or just return FORM|#)
(asdf:defsystem :my.system
:class my-system
:version '(however you wish to store it)
#|...|#)
On top of that, Pascal Bourguignon suggested that we maintain both a raw (canonical) version slot and a human-readable one. Names could be :version / :version-string, :short-version / :long-version or whatever else...
How about we provide a FORMATTED-VERSION (probably a better name is needed) generic function that the programmer can specialize in order to format otherwise hard-to-read contents of the VERSION slot?