[Bug 2264004] New: Useless dependency on perl(PerlIO::utf8_strict)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2264004

            Bug ID: 2264004
           Summary: Useless dependency on perl(PerlIO::utf8_strict)
           Product: Fedora
           Version: rawhide
            Status: NEW
         Component: perl-Path-Tiny
          Assignee: paul@xxxxxxxxxxxx
          Reporter: ppisar@xxxxxxxxxx
        QA Contact: extras-qa@xxxxxxxxxxxxxxxxx
                CC: paul@xxxxxxxxxxxx, perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
  Target Milestone: ---
    Classification: Fedora



I noticed these dependencies in perl-Path-Tiny-0.144-5.fc40:

# For performance and consistency
%if !(0%{?rhel})
BuildRequires:  perl(PerlIO::utf8_strict) >= 0.003
Requires:   perl(PerlIO::utf8_strict) >= 0.003
%endif
BuildRequires:  perl(Unicode::UTF8) >= 0.58
Requires:   perl(Unicode::UTF8) >= 0.58

In other words, this package build- and run-requires both
perl(PerlIO::utf8_strict) and perl(Unicode::UTF8) on Fedora.

However a code in lib/Path/Tiny.pm never uses both of the modules:

my $HAS_UU; # has Unicode::UTF8; lazily populated

sub _check_UU {
    local $SIG{__DIE__}; # prevent outer handler from being called
    !!eval {
        require Unicode::UTF8; 
        Unicode::UTF8->VERSION(0.58);
        1;
    };
}   

my $HAS_PU;              # has PerlIO::utf8_strict; lazily populated

sub _check_PU {
    local $SIG{__DIE__}; # prevent outer handler from being called
    !!eval {
        # MUST preload Encode or $SIG{__DIE__} localization fails
        # on some Perl 5.8.8 (maybe other 5.8.*) compiled with -O2.
        require Encode;
        require PerlIO::utf8_strict;
        PerlIO::utf8_strict->VERSION(0.003);
        1;
    };
}
[...]
    if (   ( defined($HAS_UU) ? $HAS_UU : ( $HAS_UU = _check_UU() ) )
        && $args->{chomp}
        && !$args->{count} )
    {
        my $slurp = slurp_utf8($self);
        $slurp =~ s/$CRLF\z//; # like chomp, but full CR?LF|CR
        return split $CRLF, $slurp, -1; ## no critic
    }
    elsif ( defined($HAS_PU) ? $HAS_PU : ( $HAS_PU = _check_PU() ) ) {
        $args->{binmode} = ":raw:utf8_strict";
        return lines( $self, $args );
    }
    else {
        $args->{binmode} = ":raw:encoding(UTF-8)";
        return lines( $self, $args );
    }

I recommend removing the never used dependency on perl(PerlIO::utf8_strict).

Please note that the tests attempts to exhibit both code paths by masking the
other module. However, performing the tests in Fedora is dubious if we never
use PerlIO::utf8_strict if Unicode::UTF8 is available at run-time.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2264004

Report this comment as SPAM: https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202264004%23c0
--
_______________________________________________
perl-devel mailing list -- perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to perl-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite Information]

  Powered by Linux