Alternatives to version numbering
Toby Corkindale
tjc at wintrmute.net
Mon Dec 10 03:15:46 GMT 2007
Hi,
Version numbers are a well-understood way of telling whether a perl module, or
indeed entire application, has the features or behaviour you are looking for.
It works well for applications with a central point of release and
distribution. You know version 1.2.0 comes after versions 1.1.0-1.1.x.
What about the case where your module/package/application is large and worked
upon by many people, with several distributions?
(
The Linux kernel is an example of this in the real world - think of the
different branches you can subscribe to, the -ac, -mm, etc postfixes to the
versions.
If you were writing a 3rd party device driver for the kernel, which
required some functionality that was recently added, it could be difficult
to tell which was the appropriate kernel version. Maybe 2.6.23-mm2 had the
feature, but it didn't turn up in -ac until 2.6.25-ac1?
)
Going back to Perl, we currently use a system in Makefiles of looking for a
minimum required version.
But what if we have several branches of the module available? What if the
behaviour we desire is limited to a min/max range within a particular branch?
In fact, what if we desire behaviour which is matched by various versions, and
potentially more in the future that we're not yet aware of yet?
Wouldn't it make sense then to allow module version requirements to be
specified by some kind of desired-behaviour-specification?
So you might end up with something like:
# we want a specific range of versions:
use perl {
VERSION => {
'>=' => 5.6.1,
'<' => 5.9.0
}
};
# We want on of the branched versions with extra stuff:
use Graph::Drawer {
WITH_TRUETYPE_SUPPORT => 1,
WITH_GIF_OUTPUT => 1,
}
I am concerned one could end up with something like this though:
use Another::Module {
WITH_BUGFIX_10234 => 1,
WITH_BUGFIX_11478 => 1,
WITH_BUGFIX_14466 => 1,
... # repeat a LOT
}
so I'm not sure it'd work for ALL behaviours, but maybe at least work for
detecting if you had a few of the right patches in your current version.
I think that would be kind of neat, but I'm not sure how useful it would be in
the long run.. Still, I wondered if there had already been some work on this,
or even just any thoughts?
Cheers,
Toby
More information about the london.pm
mailing list