theory/semver

Recommended Use breaks Module Build

gh opened this issue · 2 comments

gh commented

I installed v0.6.0 from CPAN but the problem appears to be in Module::Build

Upgrading Module::Build to the latest version did not help. I have got "use SemVer" in my Build.PL
file which appears to fix everything except "Build dist". No combination of Module::Build parameters in the Build.PL file seems to work.

Running ./Build dist results in:

BEGIN { q# Hide from _packages_inside()
#; package Module::Metadata::_version::p2;
use version;
no strict;

local $VERSION;
$VERSION=undef;
$vsub = sub {
our $VERSION = SemVer->new('0.1.0');;
$VERSION
};
}

The fatal error was: Can't locate object method "new" via package "SemVer" (perhaps you forgot > to load "SemVer"?) at (eval 32) line 9, line 20.

gh commented

My apologies. I figured this out from reading the version.pm documentation. Perhaps you could put a note in your pod explaining that putting the statement all on one line is essential. The version.pm documentation states this when describing declare() but I don't see it anywhere in the SemVer.pm documentation.

That's kind of inherent in how the entire toolchain deals with versions.