On Tue, Feb 23, 2010 at 05:55:51PM -0500, damian@conway.org via RT wrote:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=54897 >
>
> Thanks for taking the time, Matt.
>
> After having struggled to understand the issue for an embarrassingly
> long time, I *think* I have it straight now.
>
> You can never reduce the number of significant decimals in a version
> number because of the following scenario:
Actually, it's worse than that.
Show quoted text> 1. Multipart version 1.962.1 released
> 2. User assumes all future versions will be in "multipart" format
2. Everything that isn't sure its users can handle multipart represents this
as 1.962001
In this case, SQL::Translator did so which caused that version number to be
introduced into the arch linux packaging system.
Show quoted text> 5. Decimal version 1.964 released
And this is all that was required. Because that has decimal version 1.964.
So if somebody *then* treats decimal 1.962001 as multipart 1.962001.0 it
doesn't compare right to multipart 1.964.0.
Show quoted text> 7. User then compares the last two versions using multipart semantics...
> 7a. Try first compartment first: 1 == 1
> 7b. So try second compartment: 964 < 962002
> 7c. So latest version number < previous version number :-(
And some packaging systems treat CPAN versions as decimal and some as
multipart (same goes for cpan authors, SQL::Abstract went 0.1 ... 0.9, 0.10,
0.11, ...).
Show quoted text> In other words, once multipart versioning has been used anywhere, you
> have to assume that dependency systems can no longer reliably
> distinguish between decimal and multipart version numbers
Actually, no, it's worse than that. You have to assume that dependency systems
never reliably distinguish between them and that any given system you
encounter may simply assume one or the author.
Show quoted text> , and so must
> ensure that the ordering of version numbers works under both interpretations.
You always have to ensure that. But once you've used multipart at all, you
have to ensure that the decimalisation of your versioning from then on works
under both interpretations.
You can reliably expect a decimal system to treat 1.962.1 as
sprintf("%i.%03i%03i", split(/\./, $version)) - or at least I've not *yet*
seen that violated.
But really what that means is "you now have a 6-digit fractional part for
the decimal version of your multipart".
That's one rule. The second is "your decimal version must also work as a
two-part multipart".
Rule 2 is what makes 0.81 after 0.8001 bad in general. Rule 1 is how you
managed not to realise you'd effectively had a 6 digit decimal and then
gone to a 3 digit one.
Does that clear things up, in so far as this subject can ever be clear?
Show quoted text> PS: I'm aware that I'm probably still not understanding this issue
> properly, but I don't want to waste your time any further.
I'm not finding it a waste, I'm finding it an effective means of eliciting
a clear explanation of this that can be re-used to educate other CPAN authors.
--
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
Technical Director and a commit bit:
http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
mst (@) shadowcat.co.uk
http://shadowcat.co.uk/blog/matt-s-trout/