Perl-Toolchain-Gang / ExtUtils-MakeMaker

Perl module to make Makefiles and build modules (what backs Makefile.PL)
https://metacpan.org/release/ExtUtils-MakeMaker
64 stars 77 forks source link

Change in VERSION_FROM behavior (v7.58) #388

Closed pryrt closed 3 years ago

pryrt commented 3 years ago

I have a module which builds just fine when I use ExtUtils::MakeMaker v7.36 (with strawberry perl 5.30.0). But if I upgrade to ExtUtils::MakeMaker v7.58, I get the warning

WARNING: Setting VERSION via file 'lib/Win32/Mechanize/NotepadPlusPlus.pm' failed
 at C:/usr/local/apps/berrybrew/perls/xsys/perl/site/lib/ExtUtils/MakeMaker.pm line 741.

I actually first saw it when running CI on my project, where I happened to re-run the CI on the same commit:

so it was working the old way as recently as v7.46. I did not bisect any farther to find out exactly which version between v7.46 and v7.58 caused the change in behavior

Making an SSCCE:

Makefile.PL:

use ExtUtils::MakeMaker;
use 5.010;

WriteMakefile(
    'NAME'          => 'blah',
    'VERSION_FROM'  => 'blah.pm',
);

blah.pm:

package blah;
use warnings;
use strict;
use 5.010;

our $VERSION = '0.006dbg';  # rrr.mmmsss : rrr is major revision; mmm is minor revision; sss is sub-revision (new feature path or bugfix); optionally use _sss instead, for alpha sub-releases

1;

If you run perl Makefile.PL on the above with EU::MM v7.36, it works just fine. If you run it with EU::MM v7.58, it gives the warning

WARNING: Setting VERSION via file 'blah.pm' failed
 at C:/usr/local/apps/berrybrew/perls/xsys/perl/site/lib/ExtUtils/MakeMaker.pm line 741.

If I change the line to

our $VERSION = '0.006';  # rrr.mmmsss : rrr is major revision; mmm is minor revision; sss is sub-revision (new feature path or bugfix); optionally use _sss instead, for alpha sub-releases

it will work without warning on either.

So there is a change in behavior. If this behavior was intended; fine. But in case it was unintentional, I thought I would point it out.

pryrt commented 3 years ago

I am willing to admit that having "dbg" in the VERSION string is non-standard (and when I release, it won't be in there), but it's something I've done to indicate debugging version before I'm ready for release. if that's unsupported, fine.

Grinnz commented 3 years ago

It is unsupported. $VERSION must only contain digits, dots, underscores, and an optional leading v.

Grinnz commented 3 years ago

See http://blogs.perl.org/users/grinnz/2018/04/a-guide-to-versions-in-perl.html for further reading on how Perl module versions work.

pryrt commented 3 years ago

Like I said, when I release, I don't include the text; it had just always worked without warning every time I'd used that as a temporary indicator, but started warning in v7.58. But since it's not supported, I'll close the issue.

Grinnz commented 3 years ago

FWIW, this is likely the commit that started reporting this to the user as an issue. https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/65a78780d42e4e11c57fb39d2a1078792a68ed8a

Grinnz commented 3 years ago

And the referenced ticket. https://rt.cpan.org/Public/Bug/Display.html?id=132875

pryrt commented 3 years ago

BTW: thank you for replying so quickly. Such quick support is appreciated