Skip Menu |

This queue is for tickets about the Parse-RecDescent CPAN distribution.

Report information
The Basics
Id: 54897
Status: resolved
Priority: 0/
Queue: Parse-RecDescent

People
Owner: Nobody in particular
Requestors: mst [...] shadowcat.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Version numbers must never decrease length for ease of packaging
Date: Tue, 23 Feb 2010 02:36:07 +0000
To: bugs-Parse-RecDescent [...] rt.cpan.org
From: Matt S Trout <mst [...] shadowcat.co.uk>
In order to deal with the fact that people don't always reliably use 0.1 0.2 ... 0.9 0.10 versus 0.01 0.02 ... 0.09 0.10 version numbers should compare greater both numerically -and- as a string. Since 1.962 had subversions, subsequent releases also should - so please can you release either 1.964.1 or 1.964001 to taste and ensure that the length is maintained from now on. -- 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/
Subject: Re: [rt.cpan.org #54897] Version numbers must never decrease length for ease of packaging
Date: Tue, 23 Feb 2010 15:44:48 +1100
To: bug-Parse-RecDescent [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> please can you release either 1.964.1 or 1.964001 to taste and ensure > that the length is maintained from now on.
Okay. Will do. But I'm clearly missing something obvious here because I don't see how 1.964 (or any future version numbers in that D.DDD, format) will ever compare incorrectly against any previous version number the module has had, either numerically or stringifically. I'm evidently not smart enough to grasp the actual issue, so I'd really be grateful if you could spare a minute to give me an example of the problem those extra three digits are solving. Thanks, Damian
Subject: Re: [rt.cpan.org #54897] Version numbers must never decrease length for ease of packaging
Date: Tue, 23 Feb 2010 21:19:04 +0000
To: "damian [...] conway.org via RT" <bug-Parse-RecDescent [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
On Mon, Feb 22, 2010 at 11:45:53PM -0500, damian@conway.org via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=54897 > >
> > please can you release either 1.964.1 or 1.964001 to taste and ensure > > that the length is maintained from now on.
> > Okay. Will do. > > But I'm clearly missing something obvious here because I don't see how > 1.964 (or any future version numbers in that D.DDD, format) will ever > compare incorrectly against any previous version number the module has > had, either numerically or stringifically.
Ok. 1.962.2 expands as 1.962002 so that's how people dep on it, since that's how the numeric equality works. But this means that the system gets a requirement for that, and 1.962002 > 1.964 but 9620002 < 1.964 So if you're going to do three part version numbers, you need to always use them once you've adopted them - or convert to a six digit minor version and stay there. Reducing the number of digits in a two part version has the same problem - 1.81 > 1.8001 but 81 < 8001 and you run into the same problem. Basically, version numbers suck, BUT if you never DECREASE the size of your minor version (within a given major version) then your version numbers are consistent under both interpretations and work for everybody. Show quoted text
> I'm evidently not smart enough to grasp the actual issue, so I'd really be > grateful if you could spare a minute to give me an example of the > problem those extra three digits are solving. > > Thanks, > > Damian >
-- 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/
Subject: Re: [rt.cpan.org #54897] Version numbers must never decrease length for ease of packaging
Date: Wed, 24 Feb 2010 09:54:53 +1100
To: bug-Parse-RecDescent [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
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: 1. Multipart version 1.962.1 released 2. User assumes all future versions will be in "multipart" format 3. Decimal version 1.962002 released 4. Under multipart assumption, user treats it as 1.962002.0 5. Decimal version 1.964 released 6. Under multipart assumption, user treats it as 1.964.0 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 :-( 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, and so must ensure that the ordering of version numbers works under both interpretations. Or, in other words... Show quoted text
> Basically, version numbers suck
AMEN to that! Thanks again for taking the trouble to explain this issue to me. Damian 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. The partial understanding illustrated above is enough to convince me that there's a real problem here that needs to be anticipated and avoided.
Subject: Re: [rt.cpan.org #54897] Version numbers must never decrease length for ease of packaging
Date: Wed, 24 Feb 2010 05:00:31 +0000
To: "damian [...] conway.org via RT" <bug-Parse-RecDescent [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
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/
Subject: Re: [rt.cpan.org #54897] Version numbers must never decrease length for ease of packaging
Date: Wed, 24 Feb 2010 16:35:07 +1100
To: bug-Parse-RecDescent [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> Does that clear things up, in so far as this subject can ever be clear?
Yep. Thanks. Though it reveals such an appalling mess on misdesigned notations, misimplemented tools, and misunderstood conventions that I'm *strongly* tempted to avoid the entire problem in the future and just switch to date-based integer version numbers, like Abigail uses. Damian
Subject: Re: [rt.cpan.org #54897] Version numbers must never decrease length for ease of packaging
Date: Wed, 24 Feb 2010 06:25:10 +0000
To: "damian [...] conway.org via RT" <bug-Parse-RecDescent [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
On Wed, Feb 24, 2010 at 12:36:17AM -0500, damian@conway.org via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=54897 > >
> > Does that clear things up, in so far as this subject can ever be clear?
> > Yep. Thanks. > > Though it reveals such an appalling mess on misdesigned notations, > misimplemented tools, and misunderstood conventions that I'm *strongly* > tempted to avoid the entire problem in the future and just switch to date-based > integer version numbers, like Abigail uses.
Decimal with the proviso of "never reduce the number of digits after the ." works fine. Multipart as a human version with X.YYYzzz as the machine/decimal version works fine. I personally dislike date-based because a good human readable version indicates things to the user - notably "api version, feature additions within this api version, bugfix release" for the X, Y and Z respectively. And I can read 0.08112 > 0.08109 much much easier than 20081102 > 20081030 when skimming information. Once you get the rule of thumb down it's actually very easy to do right and still be able to do reasonable things with your versions; the hard part is understanding the baroque madness that requires the "never reduce" rule. It'd be a shame to switch versioning styles now after you've already lost the SAN points ... :) -- 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/
Subject: Re: [rt.cpan.org #54897] Version numbers must never decrease length for ease of packaging
Date: Wed, 24 Feb 2010 19:07:33 +1100
To: bug-Parse-RecDescent [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> I personally dislike date-based because a good human readable version indicates > things to the user - notably "api version, feature additions within this api > version, bugfix release" for the X, Y and Z respectively.
Yep. That was why I was tempted, but not yet convinced. I'd be less tempted if people (myself included) were more consistent about actually adhering to those conventions. On the other hand, date-based conveys useful information at a glance too: how actively the module is being maintained, how stable/dead it is. Show quoted text
> And I can read .08112 > 0.08109 much much easier than 20081102 > > 20081030 when skimming information.
I guess that's down to practice. I actually find the datestamps much easier to compare, probably because I always use YYYYMMDD or YYYYMMDD.hhmmss as my datestamping notation, so I'm used to interpreting numbers in that format. Show quoted text
> Once you get the rule of thumb down it's actually very easy to do right and > still be able to do reasonable things with your versions; the hard part is > understanding the baroque madness that requires the "never reduce" rule.
As this conversation has demonstrated so well. Show quoted text
> It'd be a shame to switch versioning styles now after you've already lost > the SAN points ... :)
Indeed. Though it's generous of you to assume I had any SAN points left to lose. ;-) Damian
Thank you for the bug report, and detailed explanations. Following Damian's lead, I'll be keeping version numbers in the following forms: X.YYYzzz X.YYY_zzz Along with this code from perlmodsub: our $VERSION = "X.YYY_zzz"; $version = eval $VERSION; to allow for decimal comparisons by modules that use Parse::RecDescent. Also, X, YYY and zzz will only ever increment. I believe that this will address the issues you've raise. If this isn't sufficient, please reopen the bug. Thanks! Jeremy