From: Graham Knop Date: Tue, 24 Nov 2020 20:27:43 +0000 (+0100) Subject: restore compatibility with old versions of ExtUtils::ParseXS X-Git-Tag: v5.33.5~132 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/b33c3c199a4d1a7f93b3afad435f77c0ff4988ba restore compatibility with old versions of ExtUtils::ParseXS ExtUtils::ParseXS used to include a function called "errors", which was documented. In was renamed to report_error_count in version 3.01 (perl 5.15.1) although the documentation wasn't fixed until 3.21 (perl 5.19.2). As a documented function, this is a backwards compatibility issue. It is possible for this to lead to errors when installing modules from CPAN. If you are using the version of ExtUtils::ParseXS that comes with core, between running the Makefile.PL and make, fulfilling prereqs can result in upgrading ExtUtils::ParseXS. When Makefile.PL is run, the generated Makefile gets the full path to xsubpp saved in it. Then when upgraded from CPAN, ExtUtils::ParseXS and xsubpp will be in a new location (site_perl or a local::lib). Running make will run the old xsubpp, but it will then try to use the new ExtUtils::ParseXS which has broken compatibility. Restore the errors function as a compatibility shim to fix this. --- diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm index 18ed08f..106883a 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm @@ -42,6 +42,7 @@ use ExtUtils::ParseXS::Utilities qw( our @EXPORT_OK = qw( process_file report_error_count + errors ); ############################## @@ -1012,6 +1013,7 @@ sub report_error_count { return $Singleton->{errors}||0; } } +*errors = \&report_error_count; # Input: ($self, $_, @{ $self->{line} }) == unparsed input. # Output: ($_, @{ $self->{line} }) == (rest of line, following lines).