dankogai / p5-encode

Encode - character encodings (for Perl 5.8 or better)
https://metacpan.org/release/Encode
37 stars 51 forks source link

Encode 2.90 breaks Data::Section 0.200006 #112

Closed greeneg closed 7 years ago

greeneg commented 7 years ago

Current release of Encode seems to break Data::Section's tests. The error I get the following from their test suite:

t/000-report-versions-tiny.t .. ok Can't locate object method "Define" via package "Encode::utf8" at /opt/Perl/lib/perl5/site_perl/5.26.0/darwin-thread-multi-2level/Encode.pm line 347. Compilation failed in require at /Users/greeneg/.cpan/build/Data-Section-0.200006-0/blib/lib/Data/Section.pm line 6. BEGIN failed--compilation aborted at /Users/greeneg/.cpan/build/Data-Section-0.200006-0/blib/lib/Data/Section.pm line 6. Compilation failed in require at t/lib/Parent.pm line 4. BEGIN failed--compilation aborted at t/lib/Parent.pm line 4. Compilation failed in require at t/basic.t line 6. BEGIN failed--compilation aborted at t/basic.t line 6.

If this is incorrect behaviour on Data::Section's part, please let me know so I can open the appropriate defect on this.

Thanks.

dankogai commented 7 years ago

@greeneg @pali @rjbs It is because 2.90 now use parent instead of directly manipulating @ISA. On case insensitive file systems like HFS+ of macOS, t/lib/Parent.pm loads before parent.pm. Since parent.pm has been in core since Perl 5.10.1, You should rename your Parent.pm to something else like Mom.pm. The following is the log of make test after I've done so on macOS v10.12.5.

Dan the Encode Maintainer

% make test
cp lib/Data/Section.pm blib/lib/Data/Section.pm
PERL_DL_NONLAZY=1 "/usr/local/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/000-report-versions-tiny.t .. # 
# 
# Generated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10
# perl: 5.024001 (wanted any version) on darwin from /usr/local/bin/perl
# 
# Encode                                        => 2.90       (want any version)
# ExtUtils::MakeMaker                           => 7.24       (want 6.30)   
# MRO::Compat                                   => 0.13       (want 0.09)   
# Sub::Exporter                                 => 0.987      (want 0.979)  
# Test::FailWarnings                            => 0.008      (want any version)
# Test::More                                    => 1.302075   (want 0.96)   
# base                                          => 2.23       (want any version)
# lib                                           => 0.63       (want any version)
# strict                                        => 1.11       (want any version)
# utf8                                          => 1.19       (want any version)
# warnings                                      => 1.36       (want any version)
# 
# Thanks for using my code.  I hope it works for you.
# If not, please try and include this output in the bug report.
# That will help me reproduce the issue and solve your problem.
# 
t/000-report-versions-tiny.t .. ok   
t/basic.t ..................... ok    
t/encodings.t ................. ok   
All tests successful.
Files=3, Tests=40,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.22 cusr  0.03 csys =  0.28 CPU)
Result: PASS