You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2004/12/11 05:42:28 UTC

mp2: RC1..N..2.0 plan

So if the nightly smoke goes well, tomorrow gozer releases RC1. We aren't 
going do the usual drill of release candidates, we are just going to 
release RCs. So the plan is:

we release RC1
- people report problems - we fix them
- we still work on knowns issues to be resolved before 2.0
we release RC2
- people report problems
- we still work on knowns issues to be resolved before 2.0
we release RC3
...
we release RCN
- people report no problems
- we have no more planned fixes for 2.0
we release 2.0

Now versioning. First of all mp2 is going to be 2.0.x, since it looks like 
Apache 2.2 might be different enough that modperl-2.2.x will appear.

We can't give interim RCs $VERSION = 2.0.0 since once we release 2.0 we 
can't change any API, with RCs we hope we won't but if something is really 
bad we will. Moreover we must keep raising the version numbers so we can 
continue tracing the bugs. If RC1 is called 2.0.0 and the final release is 
called 2.0.0 this is going to be a big mess. So the solution is:

continue RCs versions as 1.99_18, 19, 20, etc. But change Makefile.PL to have:

   VERSION modperl-2.0.0-RC1

so it's clear from the package that's an RC for 2.0.0.

Now wish us good luck and hopefully RC1 will be out tomorrow.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> Stas Bekman wrote:
> 
> Sorry, I wasn't clear in my explanation of what I was proposing (but it 
> may not matter, as you say below).
> 
>>> if ( $mod_perl::VERSION > 2.000 ) # this is now an overloaded comparison
>>
>>
>>
>> that won't work, simply because there is no mod_perl2 (only mod_perl) 
>> and mod_perl.pm coming with mp1 won't have version() bundled, so 
>> mod_perl->new will fail.
> 
> 
> What I was saying was that the $mod_perl object (wherever that is 
> created) is currently used to test the package $VERSION that mod_perl is 
> reporting, correct?  If that scalar is defined as an overloaded object
> of type Mod_Perl::VERSION (but only in the 2.x series), then the normal 
> comparison operation will be overloaded by the version comparison code, 
> and hence will Do The Right Thing(TM) regardless of Perl version and 
> presence of absence of the version.pm module itself.

I guess not, since there is no $mod_perl object. mod_perl.pm has nothing 
but $VERSION in it.

>> right, mod_perl-2.0000001.tar.gz certainly doesn't look good. But 
>> that's easily fixable, by making Makefile.PL pass version as "2.0.0" 
>> as WriteMakefile(VERSION => "2.0.0"). Then have:
>>
>> $mod_perl::VERSION = 2.000_000;
>>
>> and having users use the conditions from above to do the checking.
>>
>> in fact I think we can switch to that style right now and move to 
>> 1.099_018, so moving from RCX to 2.0.0 will be even easier and already 
>> tested well.
> 
> 
> That's really my best recommendation.  Much as I'd like to see 
> version.pm adopted by such a high profile project as mod_perl, there is 
> little benefit to your project because of all the hoops that have to be 
> jumped through because of the v-string issues from 5.6.0-5.8.0.  Just 
> tell people to use the full FP notation for their testing:
> 
>     $mod_perl::VERSION > 2.002_001;
> 
> and it will work for you.

Sounds good. Let's give it a try with RC2 and see if there any any problems.

thanks a lot, John, for your very helpful comments. And I hope that 
version.pm gets adopted!


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2 [summary]

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2004-12-13 at 11:24 -0500, Stas Bekman wrote:
> Is everybody happy with this schema (at least give it a try for RC2)?

+1

Thanks for sorting it out.

- Perrin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2 [summary]

Posted by Stas Bekman <st...@stason.org>.
Carl Brewer wrote:
> 
> Hello Stas et al,
> 
> I'm trying to put this into NetBSD pkgsrc versioning,
> which likes a numerical ascendancy I think.
> Any sugestions for how to label this in the context
> of ap2-perl-X.YY.ZZ?
> 
> Should I ask the NBSD pkgsrc people to bump up to 2.0.0-RC1
> or stick with 1.99.18xxx ?  As other pkgs have dependancies
> on this kind of thing (eg p5-libapreq2-2.4.3 etc) I guess
> it needs to be a fairly consistant approach.

I'm not sure what is your question, Carl. Are you talking about the RC 
series or 2.0.x series? For RC series, call them anyway you prefer, 
ideally 2.0.0-RCX. internally it'll be still 1.99_xx, since you can't 
numerically check for $VERSION > 2.0.0-RC1.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2 [summary]

Posted by Carl Brewer <ca...@bl.echidna.id.au>.
Hello Stas et al,

I'm trying to put this into NetBSD pkgsrc versioning,
which likes a numerical ascendancy I think.
Any sugestions for how to label this in the context
of ap2-perl-X.YY.ZZ?

Should I ask the NBSD pkgsrc people to bump up to 2.0.0-RC1
or stick with 1.99.18xxx ?  As other pkgs have dependancies
on this kind of thing (eg p5-libapreq2-2.4.3 etc) I guess
it needs to be a fairly consistant approach.

thanks

Carl

Stas Bekman wrote:
> OK so to sum things up:
> 
> On our side:
> ------------
> 
> in RC2 we move to:
> 
>   $mod_perl::VERSION = 1.099_019;
> 
> which will eventually become:
> 
>   $mod_perl::VERSION = 2.000_000;
> 
> we mangle Makefile.PL to convert x.yyy_zzz into x.y.z and pass it to:
> 
>  WriteMakefile(VERSION => "x.y.z").
> 
> so the package name is generated as mod_perl-x.y.z.tar.gz
> 
> On users side:
> --------------
> 
> Modules can now check:
> 
> - require 2.x
> 
>   if ($mod_perl::VERSION >= 2)
> 
> - require 2.2.x
> 
>   if ($mod_perl::VERSION >= 2.002)
> 
> - require 2.2.5
> 
>   if ($mod_perl::VERSION >= 2.002_005)
> 
> Is everybody happy with this schema (at least give it a try for RC2)?
> 
> Thanks again to John Peacock for the help.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] Re: version syntax for mp2 [summary]

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> Stas Bekman wrote:
> 
>> Stas Bekman wrote:
>>
>>> -    our $VERSION = "1.9920";
>>> +    our $VERSION = "1.099020";
>>
>>
>>
>> It doesn't seem that we can do that until we get to 2.0, since: 1.19 
>> (the current mp1 version) > 1.099020 (the current mp2 version), so any 
>> code doing this checking will break. (A-T breaks already and the fix 
>> would be very ugly).
>>
> 
> When going from a two significant decimal version to a three decimal 
> version, you normally multiply by 10, so this would work:
> 
>     our $VERSION = "1.990020";
> 
> but since you already used 1.99_19 (i.e. 1.9919).  Perhaps you should do 
> this:
> 
>     our $VERSION = "1.999999"; # or really 1.999_020 would work
> 
> and keep adding another nine for each release candidate (just get 
> asymptotically closer to 2.000_000... ;)

That's sweet, John. We now get:

Configuring Apache/2.0.53-dev mod_perl/1.999.20-dev Perl/v5.8.6

doing further testing now and let the list know how does it fare against 
existing code. as 1.999xxx is really 1.99_90xxx i think it should work 
everywhere.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] Re: version syntax for mp2 [summary]

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> Stas Bekman wrote:
> 
>> John, so APR-0.9.x should be 0.009000 and not 0.900000, right?
>>
> 
> Definitely!  Parse as (\d+)\.(\d{3})(\d*) and you will be consistent 
> with everything (the version.pm module splits on three digits like 
> that).  The discussion "Improved Perl version numbering system" in 
> perl56delta guarantees that:
> 
>     5.006_000 => v5.6.0
>     5.006_001 => v5.6.1
>     5.005_03  => v5.5.30
> 
> so the three digit subversions is pretty much set in stone.
> 
> The "suggestion" in the Camel to use /at least/ 2 significant decimal 
> places was to prevent the 1.1...1.9, 1.10 (oops) problem.

Right, thanks John!


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] Re: version syntax for mp2 [summary]

Posted by John Peacock <jp...@rowman.com>.
Stas Bekman wrote:

> John, so APR-0.9.x should be 0.009000 and not 0.900000, right?
> 

Definitely!  Parse as (\d+)\.(\d{3})(\d*) and you will be consistent 
with everything (the version.pm module splits on three digits like 
that).  The discussion "Improved Perl version numbering system" in 
perl56delta guarantees that:

	5.006_000 => v5.6.0
	5.006_001 => v5.6.1
	5.005_03  => v5.5.30

so the three digit subversions is pretty much set in stone.

The "suggestion" in the Camel to use /at least/ 2 significant decimal 
places was to prevent the 1.1...1.9, 1.10 (oops) problem.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] Re: version syntax for mp2 [summary]

Posted by Stas Bekman <st...@stason.org>.
John, so APR-0.9.x should be 0.009000 and not 0.900000, right?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] Re: version syntax for mp2 [summary]

Posted by John Peacock <jp...@rowman.com>.
Stas Bekman wrote:

> Stas Bekman wrote:
> 
>> -    our $VERSION = "1.9920";
>> +    our $VERSION = "1.099020";
> 
> 
> It doesn't seem that we can do that until we get to 2.0, since: 1.19 
> (the current mp1 version) > 1.099020 (the current mp2 version), so any 
> code doing this checking will break. (A-T breaks already and the fix 
> would be very ugly).
> 

When going from a two significant decimal version to a three decimal 
version, you normally multiply by 10, so this would work:

	our $VERSION = "1.990020";

but since you already used 1.99_19 (i.e. 1.9919).  Perhaps you should do 
this:

	our $VERSION = "1.999999"; # or really 1.999_020 would work

and keep adding another nine for each release candidate (just get 
asymptotically closer to 2.000_000... ;)

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] Re: version syntax for mp2 [summary]

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:

> -    our $VERSION = "1.9920";
> +    our $VERSION = "1.099020";

It doesn't seem that we can do that until we get to 2.0, since: 1.19 (the 
current mp1 version) > 1.099020 (the current mp2 version), so any code 
doing this checking will break. (A-T breaks already and the fix would be 
very ugly).

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


[PATCH] Re: version syntax for mp2 [summary]

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> OK so to sum things up:
> 
> On our side:
> ------------
> 
> in RC2 we move to:
> 
>   $mod_perl::VERSION = 1.099_019;
> 
> which will eventually become:
> 
>   $mod_perl::VERSION = 2.000_000;
> 
> we mangle Makefile.PL to convert x.yyy_zzz into x.y.z and pass it to:
> 
>  WriteMakefile(VERSION => "x.y.z").
> 
> so the package name is generated as mod_perl-x.y.z.tar.gz

OK, I think it's a good idea to start moving to the new version scheme in 
the RCs. But to get nice number formatting in certain cases, I've 
introduced a new scalar $mod_perl::VERSION_TRIPLET - (is it a good name?)
So now we get:

Configuring Apache/2.0.53-dev mod_perl/1.99.20-dev Perl/v5.8.6

Please consider this patch:

Index: Makefile.PL
===================================================================
--- Makefile.PL	(revision 123827)
+++ Makefile.PL	(working copy)
@@ -465,8 +465,7 @@
  sub set_modperl_version {
      require './lib/mod_perl.pm';

-    $VERSION = $mod_perl::VERSION;
-    $VERSION =~ s/(\d\d)(\d\d)$/$1_$2/;
+    $VERSION = $mod_perl::VERSION_TRIPLET;

      open my $fh, 'Changes';
      while (<$fh>) {
Index: lib/mod_perl.pm
===================================================================
--- lib/mod_perl.pm	(revision 123827)
+++ lib/mod_perl.pm	(working copy)
@@ -18,7 +18,22 @@
  use strict;

  BEGIN {
-    our $VERSION = "1.9920";
+    our $VERSION = "1.099020";
+    our $VERSION_TRIPLET;
+
+    if ($VERSION =~ /(\d+)\.(\d\d\d)(\d+)/) {
+        my $v1 = $1;
+        my $v2 = int $2;
+        my $v3 = int ($3 . "0" x (3 - length $3));
+        $VERSION_TRIPLET = "$v1.$v2.$v3";
+    }
+    else {
+        die "bad version: $VERSION";
+    }
+
+    # $VERSION        : "1.099020"
+    # int $VERSION    : 1.09902
+    # $VERSION_TRIPLET: 1.99.20
  }

  1;


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2 [summary]

Posted by Stas Bekman <st...@stason.org>.
OK so to sum things up:

On our side:
------------

in RC2 we move to:

   $mod_perl::VERSION = 1.099_019;

which will eventually become:

   $mod_perl::VERSION = 2.000_000;

we mangle Makefile.PL to convert x.yyy_zzz into x.y.z and pass it to:

  WriteMakefile(VERSION => "x.y.z").

so the package name is generated as mod_perl-x.y.z.tar.gz

On users side:
--------------

Modules can now check:

- require 2.x

   if ($mod_perl::VERSION >= 2)

- require 2.2.x

   if ($mod_perl::VERSION >= 2.002)

- require 2.2.5

   if ($mod_perl::VERSION >= 2.002_005)

Is everybody happy with this schema (at least give it a try for RC2)?

Thanks again to John Peacock for the help.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> Stas Bekman wrote:
> 
>> Suppose we bundle version.pm in some way with mp2. How is this going 
>> to help other modules. Let's say I have a module Foo that requires 
>> mp2. How will it check the required version w/o version.pm?
> 
> 
> I was thinking that I could provide a version.pm that could be included 
> as a submodule to any package interested in providing the overloaded 
> version objects without resorting to an external dependency.  In 
> essence, you would have your own personal version objects (which would 
> just be true version objects if the external version.pm was already 
> loaded, or you were running 5.10.0).
> 
> Originally, this came up in relation to Module::Build, which would very 
> much benefit from a unified version object model.  But in that case, I 
> would have to be able to provide a pure Perl version.pm, since 
> Module::Build doesn't require a compiler at all now (and that's 
> considered a good thing).
> 
> For example, the following shows what I am thinking of (I know that this 
> isn't the way that mod_perl itself actually works, but just play along ;)
> 
> ...
> package mod_perl2;
> 
> BEGIN {
>   use mod_perl2::version;
>   $VERSION = mod_perl2::version->new("2.2.3");
> ...
> }
> ...
> 
> package some_other_module;
> 
> use mod_perl2;
> 
> $mod_perl = mod_perl2->new(...);

You meant $mod_perl::VERSION =  mod_perl2->new(...);

> if ( $mod_perl::VERSION > 2.000 ) # this is now an overloaded comparison

that won't work, simply because there is no mod_perl2 (only mod_perl) and 
mod_perl.pm coming with mp1 won't have version() bundled, so mod_perl->new 
will fail.

> I think that should work.  In other words, you can make your $VERSION 
> scalar an object in your own version class, then control the comparisons 
> through the overloading functionality.  And the normal Perl version 
> comparisons happen using whatever code exists.  Since you are using the 
> normal
> 
>     use module 3.0;
> 
> style call, it is much easier to intercept the comparison and do what we 
> want with it.

OK

>> 2.00_00? That will make PAUSE skip indexing of the package, due to _.
> 
> 
> Oops, I forgot about that bit.  I was mostly just saying that a fully 
> floating point notation (since Perl normally ignores the underscore when 
> parsing) was always sufficient for any version of Perl.

i.e. 2.000000

>> Also didn't you mean 2.000_000 (notice the extra zero):
> 
> 
> And yes, I didn't put the right number of zeros.  Duh!

:)

>> John, do you have any good examples on CPAN that use triplets version 
>> numbers (but not vX.Y)
> 
> 
> I don't actually.  I think that version.pm is new enough that there 
> aren't many modules requiring it yet.  Once 5.10.0 is out, that is 
> likely to change (for the better, I hope).

Not so sure about that due to the wish to keep backwards compatibility 
with perl < 5.10. (of course one could require version from CPAN).

>> Hmm, I'd have thought that it should work with any perl with version, 
>> but this doesn't work:
>>
>> perl-5.6.1 -Mversion -le '$x = version->new(2.0.1); print $x'
>> 0.000
> 
> 
> No, the initialization value has to be quoted, because before 
> perl-5.8.1, the v-string code is a lossy transformation (it is 
> impossible to know that the v-string code fired):
> 
> $ perl5.8.0 -MDevel::Peek -e '$v = 1.2.3; Dump $v'
> SV = PV(0x804c540) at 0x806360c
>   REFCNT = 1
>   FLAGS = (POK,pPOK)
>   PV = 0x805d650 "\1\2\3"\0
>   CUR = 3
>   LEN = 4
> 
> $ perl5.8.1 -MDevel::Peek -e '$v = 1.2.3; Dump $v'
> SV = PVMG(0x80845a8) at 0x80659bc
>   REFCNT = 1
>   FLAGS = (RMG,POK,pPOK)
>   IV = 0
>   NV = 0
>   PV = 0x805f610 "\1\2\3"\0
>   CUR = 3
>   LEN = 4
>   MAGIC = 0x8085f00
>     MG_VIRTUAL = 0
>     MG_TYPE = PERL_MAGIC_v-string(V)
>     MG_LEN = 5
>     MG_PTR = 0x805de50 "1.2.3"
> 
> That hanging bit of magic means I can posthoc pull the original string 
> representation out and use it, instead of the original PV (which isn't 
> useful anymore).  It took me nearly two years to figure out the best way 
> to defang v-strings and make them useful.  The version.pm stuff just 
> grew out of that effort.

Understood.

>> I guess this could have worked for us. So modules could check:
>>
>> - require 2.x
>>
>>   if ($mod_perl::VERSION >= 2)
>>
>> - require 2.2.x
>>
>>   if ($mod_perl::VERSION >= 2.002)
>>
>> - require 2.2.5
>>
>>   if ($mod_perl::VERSION >= 2.002_005)
>>
>> and this should continue working in 5.10, right?
> 
> 
> Exactly.  This will work for any version of Perl.  It is by far the 
> simplest thing you can do.  But it will mean that your distro name won't 
> be the nice version triplet.  Personally, I'd rather try and convince 
> you that having the official version.pm external dependency isn't such a 
> bad thing, but I can certainly understand why you would be loath to do 
> that.

right, mod_perl-2.0000001.tar.gz certainly doesn't look good. But that's 
easily fixable, by making Makefile.PL pass version as "2.0.0" as 
WriteMakefile(VERSION => "2.0.0"). Then have:

$mod_perl::VERSION = 2.000_000;

and having users use the conditions from above to do the checking.

in fact I think we can switch to that style right now and move to 
1.099_018, so moving from RCX to 2.0.0 will be even easier and already 
tested well.

> Perhaps what I can do is pull the latest mod_perl2 files and see if I 
> can demonstrate how things would be different with version.pm or a 
> custom mod_perl::version module.  I don't know when I can do that, 
> though, so if you are looking for a timely answer, your best bet is to 
> proceed with floating points all the way.

I've explained above why special bundling (mod_perl::version) won't work, 
if you require those who need to check mod_perl version to call 
mod_perl::version() - again simply because if someone requires mod_perl.pm 
from mp1 it won't have it.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> Stas Bekman wrote:
> 
>> [CC'ing John <the version guru> Peacock]
>>
>> John, I think we need your help here, see the story below. But in 
>> short we
>> want to start using triplet versioning for modperl 2.0.x and we don't 
>> want to
>> require version.pm, since so far we don't have any external 
>> dependencies. Can
>> we do that? mp2 requires 5.6.1+.
> 
> 
> The short answer is that if you want to use triplet versioning in Perl 
> the only consistent way to do it is using the version.pm module.  Trying 
> to manage it with the inconsistent way that Perl handles v-strings isn't 
> going to be pretty.
> 
> I could give you a pure-Perl version.pm (which I have been meaning to 
> write anyway) that you can include in the mp2 distro or you add 
> version.xs to the collection of core mp2 files.  The version.pm file 
> itself is only documentation (and bootstrap loader).  Since mp2 already 
> requires a compiler, it doesn't do you any harm to add another xs file.  
> You can think of it like the ppperl.h file add compatibility #define's 
> for prior Perl releases.

Suppose we bundle version.pm in some way with mp2. How is this going to 
help other modules. Let's say I have a module Foo that requires mp2. How 
will it check the required version w/o version.pm?

> More comments inline below...
> 
>>> What do you mean? That:
>>>
>>> if ($mod_perl::VERSION > 1.99)
>>>
>>> won't work for $mod_perl::VERSION = v2.0.0?
> 
> 
> You want to be very careful what you use for $mod_perl::VERSION itself, 
> because the use of v-strings (like v2.0.0) is highly dependent on which 
> version of Perl you are running.  From 5.6.0 to 5.8.0, the behavior is 
> one way, from 5.8.1 on it is another.  No matter what you use for 
> version comparisons, it would be best to set the $VERSION scalar in 
> Mod::Perl itself to 2.00_00 or require the use of overloaded version 
> objects (like version.pm provides).

2.00_00? That will make PAUSE skip indexing of the package, due to _.

Also didn't you mean 2.000_000 (notice the extra zero):

perl-5.6.1 -Mversion -le '$x = version->new(2.00_1); print $x'
2.001
perl-5.6.1 -Mversion -le '$x = version->new(2.000_1); print $x'
2.0.100

John, do you have any good examples on CPAN that use triplets version 
numbers (but not vX.Y)

>>> you are right that we need to play with the version numbers. I'm a 
>>> bit confused at how we do the right triplet VERSION. According to: 
>>> http://search.cpan.org/dist/version/lib/version.pm#What_about_v-strings?
>>>
>>> it should be:
>>>
>>> $x::VERSION = 2.2.1
>>>
>>> but I can't even dump this value, with print.
> 
> 
> That will work only with Perl 5.8.1 or better, because that is the first 
> Perl release which supported magic v-strings.  And even in those cases, 
> without the version.pm compatibility layer loaded, you have to use
> 
>     print "%vd", $x::VERSION;
> 
> in order to get the "2.2.1" representation.

Hmm, I'd have thought that it should work with any perl with version, but 
this doesn't work:

perl-5.6.1 -Mversion -le '$x = version->new(2.0.1); print $x'
0.000

>>> version.pm is a part of the core only from 5.9.x, and we can't 
>>> require it
>>> just to get the version number set.
>>>
>>> I've also tried 2.002001 but it doesn't seem to make a very good work 
>>> when
>>> used in conditionals.
> 
> 
> This is the other way to handle it.  If you always refer to $VERSION's 
> by their floating-point equivalent,

You mean 2.000_000? like:

perl-5.6.1 -Mversion -le '$x = 2.002_003; print $x > 2.002_002 ? 1 : 0'
1
perl-5.6.1 -Mversion -le '$x = 2.002_003; print $x > 2.002     ? 1 : 0'
1

I guess this could have worked for us. So modules could check:

- require 2.x

   if ($mod_perl::VERSION >= 2)

- require 2.2.x

   if ($mod_perl::VERSION >= 2.002)

- require 2.2.5

   if ($mod_perl::VERSION >= 2.002_005)

and this should continue working in 5.10, right?

> it will work in all versions of Perl 
> without using any compatibility module like version.pm.  The following 
> version notations are in all ways equivalent (with the caveat for the 
> last):
> 
>     $VERSION = 2.002_001; # the underscore is ignored by the parser
>     $VERSION = version->new("2.2.1"); # with use version;
>     $VERSION = version->new(2.2.1); # only with Perl >= 5.8.1
> 
> However, only the use of something very much like version.pm will allow 
> you to easily present a version triplet to the external world (like 
> Apache's own versioning scheme does).
> 
> I know you don't want to add an external requirement if you don't have 
> to, but by far the easiest way to handle version comparisons in a 
> compatible way for a wide range of Perl releases is through the 
> version.pm compatibility layer.
> 
> Let me know if there is anything else I can do to help.

Thanks for the detailed explanations, John. I guess one you answer on a 
few more questions I've posed above, it'll be easier to decide whether 
have to bundle version.pm or can get away w/o it.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2

Posted by Stas Bekman <st...@stason.org>.
[CC'ing John <the version guru> Peacock]

John, I think we need your help here, see the story below. But in short we 
want to start using triplet versioning for modperl 2.0.x and we don't want 
to require version.pm, since so far we don't have any external 
dependencies. Can we do that? mp2 requires 5.6.1+.

Thanks.


> Philippe M. Chiasson wrote:
> [...]
> 
>>> Now versioning. First of all mp2 is going to be 2.0.x, since it looks 
>>> like Apache 2.2 might be different enough that modperl-2.2.x will 
>>> appear.
[...]
>> Yes, I think it's a good way to go about it. There remains the slight 
>> probability of trouble for 3rd party authors that have
>> bugs in their MP 2.0 detection code, but that's not a very big problem.
> 
> 
> What do you mean? That:
> 
>   if ($mod_perl::VERSION > 1.99)
> 
> won't work for $mod_perl::VERSION = v2.0.0?
> 
> you are right that we need to play with the version numbers. I'm a bit 
> confused at how we do the right triplet VERSION. According to:
> http://search.cpan.org/dist/version/lib/version.pm#What_about_v-strings?
> 
> it should be:
> 
>   $x::VERSION = 2.2.1
> 
> but I can't even dump this value, with print.
> 
> version.pm is a part of the core only from 5.9.x, and we can't require 
> it just to get the version number set.
> 
> I've also tried 2.002001 but it doesn't seem to make a very good work 
> when used in conditionals.
> 


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: version syntax for mp2

Posted by Stas Bekman <st...@stason.org>.
[subject change]

Philippe M. Chiasson wrote:
[...]
>> Now versioning. First of all mp2 is going to be 2.0.x, since it looks 
>> like Apache 2.2 might be different enough that modperl-2.2.x will appear.
> 
> 
>> We can't give interim RCs $VERSION = 2.0.0 since once we release 2.0 
>> we can't change any API, with RCs we hope we won't but if something is 
>> really bad we will. Moreover we must keep raising the version numbers 
>> so we can continue tracing the bugs. If RC1 is called 2.0.0 and the 
>> final release is called 2.0.0 this is going to be a big mess. So the 
>> solution is:
>>
>> continue RCs versions as 1.99_18, 19, 20, etc. But change Makefile.PL 
>> to have:
>>
>>   VERSION modperl-2.0.0-RC1
>>
>> so it's clear from the package that's an RC for 2.0.0.
> 
> 
> Yes, I think it's a good way to go about it. There remains the slight 
> probability of trouble for 3rd party authors that have
> bugs in their MP 2.0 detection code, but that's not a very big problem.

What do you mean? That:

   if ($mod_perl::VERSION > 1.99)

won't work for $mod_perl::VERSION = v2.0.0?

you are right that we need to play with the version numbers. I'm a bit 
confused at how we do the right triplet VERSION. According to:
http://search.cpan.org/dist/version/lib/version.pm#What_about_v-strings?

it should be:

   $x::VERSION = 2.2.1

but I can't even dump this value, with print.

version.pm is a part of the core only from 5.9.x, and we can't require it 
just to get the version number set.

I've also tried 2.002001 but it doesn't seem to make a very good work when 
used in conditionals.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2: RC1..N..2.0 plan

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Stas Bekman wrote:

> So if the nightly smoke goes well, tomorrow gozer releases RC1. We 
> aren't going do the usual drill of release candidates, we are just 
> going to release RCs. So the plan is:
>
> we release RC1
> - people report problems - we fix them
> - we still work on knowns issues to be resolved before 2.0
> we release RC2
> - people report problems
> - we still work on knowns issues to be resolved before 2.0
> we release RC3
> ...
> we release RCN
> - people report no problems

 - people report no problems we consider 2.0 blockers

> - we have no more planned fixes for 2.0
> we release 2.0

Sounds good to me.

>
> Now versioning. First of all mp2 is going to be 2.0.x, since it looks 
> like Apache 2.2 might be different enough that modperl-2.2.x will appear.

> We can't give interim RCs $VERSION = 2.0.0 since once we release 2.0 
> we can't change any API, with RCs we hope we won't but if something is 
> really bad we will. Moreover we must keep raising the version numbers 
> so we can continue tracing the bugs. If RC1 is called 2.0.0 and the 
> final release is called 2.0.0 this is going to be a big mess. So the 
> solution is:
>
> continue RCs versions as 1.99_18, 19, 20, etc. But change Makefile.PL 
> to have:
>
>   VERSION modperl-2.0.0-RC1
>
> so it's clear from the package that's an RC for 2.0.0.

Yes, I think it's a good way to go about it. There remains the slight 
probability of trouble for 3rd party authors that have
bugs in their MP 2.0 detection code, but that's not a very big problem.

> Now wish us good luck and hopefully RC1 will be out tomorrow.

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5