Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id: 84270
Status: resolved
Priority: 0/
Queue: Moo

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

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



Subject: Put $VERSION in all your packages
On #toolchain, someone was tripped up requiring Moo::Role 1.001 as a prereq -- which fails because Moo::Role doesn't define $VERSION. Could you please add $VERSION to all your packages so they can be indexed properly?
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Fri, 29 Mar 2013 06:29:52 +1100
To: David Golden via RT <bug-Moo [...] rt.cpan.org>
From: Peter Rabbitson <ribasushi [...] cpan.org>
On Thu, Mar 28, 2013 at 03:25:10PM -0400, David Golden via RT wrote: Show quoted text
> Thu Mar 28 15:25:08 2013: Request 84270 was acted upon. > Transaction: Ticket created by DAGOLDEN > Queue: Moo > Subject: Put $VERSION in all your packages > Broken in: (no value) > Severity: Normal > Owner: Nobody > Requestors: dagolden@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84270 > > > > On #toolchain, someone was tripped up requiring Moo::Role 1.001 as a prereq -- which fails because Moo::Role doesn't define $VERSION. > > Could you please add $VERSION to all your packages so they can be indexed properly?
As far as I know this is deliberately done. There is no version in Moo::Role, because users should not be adding Moo::Role to their deps. Matt should be able to clarify further.
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Thu, 28 Mar 2013 13:58:16 -0700
To: Peter Rabbitson via RT <bug-Moo [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Thu, Mar 28, 2013 at 03:30:14PM -0400, Peter Rabbitson via RT wrote: Show quoted text
> As far as I know this is deliberately done. There is no version in > Moo::Role, because users should not be adding Moo::Role to their deps.
There's no reason why they shouldn't be able to do this though, if they are depending on a certain feature/bugfix that was changed in that version of Moo::Role. Similar discussions/debates have been had regarding Plack modules being versioned, and iirc they stonewalled. (fwiw I'm in favour of versioning everything, even though it would require changes to the release process.)
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Thu, 28 Mar 2013 17:04:03 -0400
To: bug-Moo [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Thu, Mar 28, 2013 at 4:58 PM, Karen Etheridge via RT <bug-Moo@rt.cpan.org> wrote: Show quoted text
> (fwiw I'm in favour of versioning everything, even though it would require > changes to the release process.)
I know a really good general purpose text manipulation tool that could probably automate that problem away. (Even *without* dzil, I mean.) -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Fri, 29 Mar 2013 08:04:55 +1100
To: Karen Etheridge via RT <bug-Moo [...] rt.cpan.org>
From: Peter Rabbitson <ribasushi [...] cpan.org>
On Thu, Mar 28, 2013 at 04:58:39PM -0400, Karen Etheridge via RT wrote: Show quoted text
> > (fwiw I'm in favour of versioning everything, even though it would require > changes to the release process.)
And I am absolutely against it, hence explicitly throwing the ball into mst's court. This question is polarizing enough to require a "linus" decree to resolve.
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Thu, 28 Mar 2013 17:19:58 -0400
To: bug-Moo [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Thu, Mar 28, 2013 at 5:05 PM, Peter Rabbitson via RT <bug-Moo@rt.cpan.org> wrote: Show quoted text
> And I am absolutely against it, hence explicitly throwing the ball into > mst's court. This question is polarizing enough to require a "linus" > decree to resolve.
Without meaning to make it a debate -- we can let mst settle it -- I really would like to know why you feel that way because I can't think of good reasons why it should be done that way other than workload. Practially, how would you suggest someone do a compile-time or run-time check to ensure they have a new-enough Moo::Role? use Moo 1.001 (); use Moo::Role; That means loading all of Moo and its dependencies (like B) just to do a version check. Sure, those will eventually get loaded (or will be loaded already) in order to use the role with something, but it seems superfluous to load Moo in a role just to be able to check a version. David -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Fri, 29 Mar 2013 19:25:48 +1100
To: David Golden via RT <bug-Moo [...] rt.cpan.org>
From: Peter Rabbitson <ribasushi [...] cpan.org>
On Thu, Mar 28, 2013 at 05:20:43PM -0400, David Golden via RT wrote: Show quoted text
> > Practially, how would you suggest someone do a compile-time or > run-time check to ensure they have a new-enough Moo::Role? > > use Moo 1.001 ();
This is easy to answer - I consider this kind of code a rather serious design mistake. You will not find it in anything I work with. Requirements are to be declared in one and one place only - the dist/META builder of choice. Cheers
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Fri, 29 Mar 2013 09:31:01 -0400
To: bug-Moo [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Fri, Mar 29, 2013 at 4:26 AM, Peter Rabbitson via RT <bug-Moo@rt.cpan.org> wrote: Show quoted text
>> use Moo 1.001 ();
> > This is easy to answer - I consider this kind of code a rather serious > design mistake. You will not find it in anything I work with. > Requirements are to be declared in one and one place only - the > dist/META builder of choice.
What about conditional behavior? If the version is older than X, do this, otherwise do that? (I.e. working around bugs or lack of features in particular versions) I understand the purity of your position, but I don't think it's very practical. Specifically to this ticket, though, providing a $VERSION doesn't compel *you* to code any differently. It would allow *others* to code in ways that are preferable to them. Why are you absolutely against *providing* $VERSION? The two reasons I've heard seem to be: * Updating it requires work -- though I've pointed out it's easily automated * "I don't code like this, so I'll make sure no one else can either" -- which strikes me as a rather unfriendly, un-Perlish attitude Neither one is what I would consider a "good" reason -- by which I mean one based in facts or technical considerations rather than mere style preference. David -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
I always use perl-reversion (which comes bundled with Perl::Version) to do bulk version bumps for all the modules in a distribution. I even do it for single module distributions out of habit.
On Thu Mar 28 15:25:08 2013, DAGOLDEN wrote: Show quoted text
> Could you please add $VERSION to all your packages so they can be > indexed properly?
s/ properly//; # de-passive-aggressive-d it for you Given we can get the reversion down to one command, if somebody adds a make preflight check to Distar to ensure all the versions are in sync then I'd be happy to consider this.
Would Test::ConsistentVersion in xt suffice?
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Mon, 15 Jul 2013 20:34:39 -0400
To: bug-Moo [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Mon, Jul 15, 2013 at 2:21 PM, MSTROUT via RT <bug-Moo@rt.cpan.org> wrote: Show quoted text
> On Thu Mar 28 15:25:08 2013, DAGOLDEN wrote:
>> Could you please add $VERSION to all your packages so they can be >> indexed properly?
> > s/ properly//; # de-passive-aggressive-d it for you
They *are* all indexed. Eight of them are undef. That version has not changed despite changes in the underlying files. Ribasushi made a great point to me in Lancaster about why private modules shouldn't have a $VERSION at all so as to avoid being depended on. I concurred, but said that in that case, private modules shouldn't be indexed at all, which solves the problem even more completely. However, I believe that public modules (such as Moo::Role) should have a defined, non-zero $VERSION that changes at least as often as the corresponding code does. "Proper" was merely my polite shorthand saving me from (yet another) rant about version numbers and the utterly fucked up ways people misuse them. Show quoted text
> Given we can get the reversion down to one command, if somebody adds a make preflight check to Distar to ensure all the versions are in sync then I'd be happy to consider this.
I'm fine if only "public" modules gain a $VERSION, but that might be more work than just slapping $VERSION into all of them. YMMV. David -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Mon, 15 Jul 2013 19:01:03 -0700
To: MSTROUT via RT <bug-Moo [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Mon, Jul 15, 2013 at 02:21:35PM -0400, MSTROUT via RT wrote: Show quoted text
> Given we can get the reversion down to one command, if somebody adds a make preflight check to Distar to ensure all the versions are in sync then I'd be happy to consider this.
I generate such a test in Dist::Zilla::Plugin::Test::NewVersion; its code could be adapted to Distar.
I've pushed a branch for Distar that adds a preflight check that add declared versions match. Moo actually includes a script to bump the version number, but it has been broken for over 2 years.
I've added version numbers to the public modules (Moo, Moo::Role, Sub::Defer, and Sub::Quote), updated the bump-version script to work, and made it require an up to date Distar that checks the version numbers in preflight.
Subject: Re: [rt.cpan.org #84270] Put $VERSION in all your packages
Date: Thu, 18 Jul 2013 10:54:17 -0400
To: bug-Moo [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Thu, Jul 18, 2013 at 10:46 AM, Graham Knop via RT <bug-Moo@rt.cpan.org> wrote: Show quoted text
> I've added version numbers to the public modules (Moo, Moo::Role, Sub::Defer, and Sub::Quote), updated the bump-version script to work, and made it require an up to date Distar that checks the version numbers in preflight.
Awesome. Thank you very much. -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
Fixed in Moo 1.003001.