Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 84356
Status: resolved
Worked: 1 min
Priority: 0/
Queue: ExtUtils-MakeMaker

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

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



Subject: `make dist` truncates version in META.yml
A three number version like 2.19.1 is truncated to 2.19 in the auto-generated META.yml
Subject: Re: [rt.cpan.org #84356] `make dist` truncates version in META.yml
Date: Sun, 07 Apr 2013 10:33:48 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: "Michael G. Schwern" <schwern [...] pobox.com>
On 4/1/13 6:55 PM, Jerrad Pierce via RT wrote: Show quoted text
> A three number version like 2.19.1 is truncated to 2.19 in the auto-generated META.yml
Could you show us how you set that version please?
Subject: Re: [rt.cpan.org #84356] `make dist` truncates version in META.yml
Date: Sun, 07 Apr 2013 14:33:50 -0400
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Jerrad Pierce <belg4mit [...] pthbb.org>
I used $VERSION = 2.19.1; in my module, MakeMaker extracted it and used it from there. $VERSION = '2.19.1'; escapes this, but considering that the rest of the toolchain e.g; PAUSE, CPAN Testers, search.cpan.org; supports the former, it does not seem unreasonable that MakeMaker should DWIM when creating a dist filename. The documentation regarding this "Version strings" are incompatible should not be used. is quite brief and easy to overlook. Some explanation as to why, and what happens would be useful i.e; MakeMaker uses stringified version numbers when generating filenames, consequently v-strings such as C<$VERSION = 1.2.3> will result in filenames containing control characters due to perl's internal representation of v-strings. L<version> objects were added in Perl 5.10, and are recommended instead. Also, if MakeMaker won't DWIM with a v-string, what about throwing a warning to explain the mangled filename that results?
Subject: Re: [rt.cpan.org #84356] `make dist` truncates version in META.yml
Date: Sun, 07 Apr 2013 16:02:05 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: "Michael G. Schwern" <schwern [...] pobox.com>
On 4/7/13 11:34 AM, belg4mit@pthbb.org via RT wrote: Show quoted text
> I used > > $VERSION = 2.19.1; > > in my module, MakeMaker extracted it and used it from there. > > $VERSION = '2.19.1'; > > escapes this, but considering that the rest of the toolchain > e.g; PAUSE, CPAN Testers, search.cpan.org; supports the former
Do you have examples of that? I didn't think they did. Show quoted text
> it does not seem unreasonable that MakeMaker should DWIM when > creating a dist filename.
The issue is that the latter is the string '2.19.1'. MakeMaker and CPAN::Meta (which MakeMaker uses to generate the meta files) can deal with that. The former is interpreted as a version string by Perl. $VERSION winds up containing not the string "2.19.1" but three bytes which are 2, 19 and 1. There's no code in MakeMaker to contend with this. To work around this, MakeMaker would have to determine if $VERSION is using a version string or not. The basic heuristic is pretty easy, check if the first byte is less than 48 (ASCII 0) and hope nobody decides to release 49.49.49 (which is the string "111"). Patching this is fairly straight forward. The code to interpret $VERSION is in lib/ExtUtils/MM_Unix.pm and the tests in t/parse_version.t. Translating the version string into a regular string should fix everything else down the line. Have a crack at it. Show quoted text
> The documentation regarding this > > "Version strings" are incompatible should not be used. > > is quite brief and easy to overlook. Some explanation as to why, > and what happens would be useful i.e; > > MakeMaker uses stringified version numbers when generating > filenames, consequently v-strings such as C<$VERSION = 1.2.3> > will result in filenames containing control characters due to > perl's internal representation of v-strings. > > L<version> objects were added in Perl 5.10, and are > recommended instead.
Agreed. The whole way versions are documented in ExtUtils::MakeMaker needs to be overhauled. I would recommend taking the docs out of VERSION_FROM and creating a new "=head2 Declaring Versions" section. Show quoted text
> Also, if MakeMaker won't DWIM with a v-string, what about > throwing a warning to explain the mangled filename that results?
That would be good if parse_version isn't fixed. Would you like to have a crack at this?
The current development series of EUMM (6.69_*) supports v-strings for VERSION and VERSION_FROM.
This issue is now resolved with the release of 6.70 Many thanks.