Subject: | Regain 5.8.5 compatibility |
Analysis diagnoses significant correlation of fails with an installed
Scalar::Util of 1.13 or 1.14.
http://analysis.cpantesters.org/reports_by_field?distv=CPAN-Meta-YAML-0.005;field=mod%3AScalar%3A%3AUtil;order=2na
There are no tests on cpantesters with older Scalar::Util and I have
no access to older perls at the moment. My two patches below extend
backwards compatibility to at least 5.8.5. Maybe not far enough, 5.8.5
is all I have at the moment. We have cpantesters to find out more.
The Makefile.PL has an unneeded requirement of MakeMaker 6.3 whereas I
see no problem with the MakeMaker 6.17 that comes with 5.8.5. Just a
warning that License is not a known MAkeMAker parameter but this does
not trigger problems. I also see the configure_requires option as
superfluous that does not gain anything for anybody.
So my first patch suggest
--- Makefile.PL~ 2012-02-06 11:19:09.000000000 +0100
+++ Makefile.PL 2012-02-06 11:50:27.000000000 +0100
@@ -4,7 +4,7 @@
use 5.004;
-use ExtUtils::MakeMaker 6.30;
+use ExtUtils::MakeMaker 6.17;
@@ -17,9 +17,6 @@
"Test::More" => 0,
"vars" => 0
},
- "CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.30"
- },
"DISTNAME" => "CPAN-Meta-YAML",
"EXE_FILES" => [],
"LICENSE" => "perl",
The other change is trivial. I have two alternative patches to
suggest.
The first one is minimal but I had to do some digging for it. The
Changes file of Scalar::Util dates the addition of refaddr() short
before 1.09 was released. So unless there is a reason to consider some
versions of refaddr broken, the version number that triggers the
refaddr emulation must be lowered.
--- lib/CPAN/Meta/YAML.pm~ 2012-02-06 10:58:39.000000000 +0100
+++ lib/CPAN/Meta/YAML.pm 2012-02-06 11:02:17.000000000 +0100
@@ -614,7 +614,7 @@
eval {
require Scalar::Util;
};
- if ( $@ or $Scalar::Util::VERSION < 1.18 ) {
+ if ( $@ or $Scalar::Util::VERSION < 1.09 ) {
eval <<'END_PERL' if $@;
# Scalar::Util failed to load or too old
sub refaddr {
The alternative patch leaves the choice to perl's own introspection
such that the digging in history files can be skipped. I consider it
the superior patch:
--- lib/CPAN/Meta/YAML.pm~ 2012-02-06 10:58:39.000000000 +0100
+++ lib/CPAN/Meta/YAML.pm 2012-02-06 11:42:04.000000000 +0100
@@ -614,7 +614,7 @@
eval {
require Scalar::Util;
};
- if ( $@ or $Scalar::Util::VERSION < 1.18 ) {
+ if ( $@ or !defined &Scalar::Util::refaddr ) {
eval <<'END_PERL' if $@;
# Scalar::Util failed to load or too old
sub refaddr {
I would be glad to see this applied, what do you think?
Thanks!