Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: develop [...] traveljury.com
Cc:
AdminCc:

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



Moo doesn't specify a minimum version for Sub::Name. Sub::Name 0.07 has a memory leak (see https://metacpan.org/changes/distribution/Sub-Name#L27) which is fixed in 0.08. Upgrading Moo doesn't fix this as it thinks 0.07 is an acceptable version. Found via https://github.com/elastic/elasticsearch-perl/issues/45
Moo doesn't specify a dependency on Sub::Name at all. We could add it conditionally on the availability of a compiler, but I'd rather avoid that if possible. It seems odd that this would cause significant issues. Sub::Name is only used in a limited number of places when generating classes. Is your codebase generating new classes often?
On 2015-11-19 09:29:47, haarg wrote: Show quoted text
> Moo doesn't specify a dependency on Sub::Name at all. We could add it > conditionally on the availability of a compiler, but I'd rather avoid > that if possible.
We could do something similar to what JSON::MaybeXS does with JSON::XS: if it is already installed, make sure that it is a recent version. I've proposed a patch in https://github.com/moose/Moo/pull/22.
On Thu Nov 19 12:29:47 2015, haarg wrote: Show quoted text
> Moo doesn't specify a dependency on Sub::Name at all. We could add it > conditionally on the availability of a compiler, but I'd rather avoid > that if possible. > > It seems odd that this would cause significant issues. Sub::Name is > only used in a limited number of places when generating classes. Is > your codebase generating new classes often?
That's a very good question. I pulled out NYTProf and it turns out that subname() is actually being called frequently by Try::Tiny: https://metacpan.org/source/DOY/Try-Tiny-0.22/lib/Try/Tiny.pm#L60 Would you prefer me to move this ticket there?
On 2015-11-19 11:02:45, DRTECH wrote: Show quoted text
> On Thu Nov 19 12:29:47 2015, haarg wrote:
> > Moo doesn't specify a dependency on Sub::Name at all. We could add > > it > > conditionally on the availability of a compiler, but I'd rather avoid > > that if possible. > > > > It seems odd that this would cause significant issues. Sub::Name is > > only used in a limited number of places when generating classes. Is > > your codebase generating new classes often?
> > That's a very good question. I pulled out NYTProf and it turns out > that subname() is actually being called frequently by Try::Tiny: > https://metacpan.org/source/DOY/Try-Tiny-0.22/lib/Try/Tiny.pm#L60 > > Would you prefer me to move this ticket there?
I think at a minimum if we do something in Moo's Makefile.PL to upgrade Sub::Name, we should do the same thing in Try::Tiny -- since it also only uses Sub::Name optionally.
Perhaps instead of doing backflips in Makefile.PL, lib/Moo/_Utils.pm should only use Sub::Name if it's a new enough version (but keep the version bump in the runtime-recommends section). We could just add a ->VERSION('0.08') call to the existing eval.
Naming some of the subs is important for interoperability with Moose, and the number of subs we name is rather small. I'm inclined to not change anything in Moo. For Try::Tiny, just having it not use Sub::Name < 0.08 seems viable.
I've updated Moo's recommendation of Sub::Name to be 0.08. Moo doesn't use Sub::Name enough for the memory leak to be a big concern - it's only done at class setup time. Fixed in repo. https://github.com/moose/Moo/commit/6f59d3e904e91cb4ba9a8a7e4b0cfe9cfdf55c7c
Resolved in Moo 2.001000