Bug 1380152 - perl-HTTP-Tiny 0.068 pulls in lots of new dependencies including Xorg
Summary: perl-HTTP-Tiny 0.068 pulls in lots of new dependencies including Xorg
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-URI
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul Howarth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-28 19:09 UTC by Peter Robinson
Modified: 2016-10-10 17:42 UTC (History)
5 users (show)

Fixed In Version: perl-URI-1.71-5.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-10 17:42:14 UTC
Type: Bug


Attachments (Terms of Use)

Description Peter Robinson 2016-09-28 19:09:42 UTC
https://bodhi.fedoraproject.org/updates/FEDORA-2016-e52c2b0ca5

$ dnf upgrade perl-HTTP-Tiny
Last metadata expiration check: 0:13:36 ago on Wed Sep 28 16:28:02 2016.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                                   Arch                                      Version                                               Repository                                         Size
===================================================================================================================================================================================================================
Installing:
 fontconfig                                                armv7hl                                   2.12.1-1.fc25                                         fedora                                            230 k
 gd                                                        armv7hl                                   2.2.3-2.fc25                                          fedora                                            119 k
 jbigkit-libs                                              armv7hl                                   2.1-5.fc24                                            fedora                                             49 k
 libX11                                                    armv7hl                                   1.6.3-3.fc24                                          fedora                                            550 k
 libX11-common                                             noarch                                    1.6.3-3.fc24                                          fedora                                            164 k
 libXau                                                    armv7hl                                   1.0.8-6.fc24                                          fedora                                             33 k
 libXpm                                                    armv7hl                                   3.5.11-5.fc24                                         fedora                                             50 k
 libtiff                                                   armv7hl                                   4.0.6-2.fc24                                          fedora                                            158 k
 libwebp                                                   armv7hl                                   0.5.1-1.fc25                                          fedora                                            190 k
 libxcb                                                    armv7hl                                   1.12-1.fc25                                           fedora                                            192 k
 perl-Business-ISBN                                        noarch                                    3.002-1.fc25                                          fedora                                             35 k
 perl-Business-ISBN-Data                                   noarch                                    20140910.003-3.fc25                                   fedora                                             33 k
 perl-Digest                                               noarch                                    1.17-366.fc25                                         fedora                                             26 k
 perl-Digest-MD5                                           armv7hl                                   2.55-2.fc25                                           fedora                                             35 k
 perl-Digest-SHA                                           armv7hl                                   1:5.96-1.fc25                                         fedora                                             62 k
 perl-GD                                                   armv7hl                                   2.56-9.fc25                                           fedora                                            165 k
 perl-GD-Barcode                                           noarch                                    1.15-23.fc25                                          fedora                                            682 k
 perl-IO-Socket-IP                                         noarch                                    0.38-1.fc25                                           fedora                                             46 k
 perl-IO-Socket-SSL                                        noarch                                    2.038-1.fc25                                          updates-testing                                   261 k
 perl-JSON-PP                                              noarch                                    2.27400-4.fc25                                        fedora                                             60 k
 perl-Mojolicious                                          noarch                                    7.0-1.fc25                                            fedora                                            824 k
 perl-Mozilla-CA                                           noarch                                    20160104-3.fc25                                       fedora                                             14 k
 perl-Net-SSLeay                                           armv7hl                                   1.78-1.fc25                                           fedora                                            312 k
 perl-Time-HiRes                                           armv7hl                                   1.9740-1.fc25                                         updates-testing                                    53 k
 perl-URI                                                  noarch                                    1.71-4.fc25                                           fedora                                            116 k
 perl-libnet                                               noarch                                    3.10-1.fc25                                           fedora                                            126 k
Upgrading:
 perl-HTTP-Tiny                                            noarch                                    0.068-1.fc25                                          updates-testing                                    55 k

Transaction Summary
===================================================================================================================================================================================================================
Install  26 Packages
Upgrade   1 Package

Total download size: 4.5 M
Is this ok [y/N]: n
Operation aborted.

Comment 1 Petr Pisar 2016-09-29 10:25:30 UTC
There is no change between old 0.064-1.fc25 and new 0.068-1.fc25 in set of dependencies.

The fat dependencies are optional. The libX11 is dragged in by gd (I don't know why gd library requrires X11) and gd is required by perl-GD-Barcode that's required by perl-Business-ISBN (that's upstream decision to hard-require barcode visualization).

Comment 2 Peter Robinson 2016-09-29 17:06:02 UTC
(In reply to Petr Pisar from comment #1)
> There is no change between old 0.064-1.fc25 and new 0.068-1.fc25 in set of
> dependencies.

There's something that's changed that is now pulling it in then.

> The fat dependencies are optional. The libX11 is dragged in by gd (I don't
> know why gd library requrires X11) and gd is required by perl-GD-Barcode
> that's required by perl-Business-ISBN (that's upstream decision to
> hard-require barcode visualization).

Most of that stuff I'm not sure why we need for a "tiny" HTTP server? How can we fix this?

Comment 3 Petr Pisar 2016-09-30 06:31:39 UTC
(In reply to Peter Robinson from comment #2)
> > The fat dependencies are optional. The libX11 is dragged in by gd (I don't
> > know why gd library requrires X11) and gd is required by perl-GD-Barcode
> > that's required by perl-Business-ISBN (that's upstream decision to
> > hard-require barcode visualization).
> 
> Most of that stuff I'm not sure why we need for a "tiny" HTTP server?

What? HTTP server? perl-HTTP-Tiny is an HTTP client. And it actually isn't tiny anymore since it supports HTTPS and chunked encoding.

> How can we fix this? 

Set install_weak_deps=false in /etc/dnf/dnf.conf.

Many people say HTTPS should be supported by HTTP client, therefore IO::Socket:SSL is on Recommends and not on Suggests level.

These are perl-HTTP-Tiny-0.068-1.fc26 dependencies:

$ rpm -q --requires -p noarch/perl-HTTP-Tiny-0.068-1.fc26.noarch.rpm | sort -f | grep perl
perl(:MODULE_COMPAT_5.24.0)
perl(bytes)
perl(Carp)
perl(Errno)
perl(Fcntl)
perl(IO::Socket)
perl(MIME::Base64)
perl(Socket)
perl(strict)
perl(Time::Local)
perl(warnings)

$ rpm -q --recommends -p noarch/perl-HTTP-Tiny-0.068-1.fc26.noarch.rpm | sort -f | grep perl
perl(IO::Socket::IP) >= 0.32
perl(IO::Socket::SSL) >= 1.56
perl(Mozilla::CA)

There is nothing we can do in perl-HTTP-Tiny.

The gd packages is pulled in by IO::Socket::SSL:

# LANG=en_US.UTF-8 dnf --allowerasing install 'perl(IO::Socket::SSL) >= 1.56'
Last metadata expiration check: 0:20:33 ago on Fri Sep 30 08:09:00 2016.
Dependencies resolved.
================================================================================
 Package                    Arch      Version                  Repository  Size
================================================================================
Installing:
 gd                         x86_64    2.2.3-2.fc25             rawhide    135 k
 libX11                     x86_64    1.6.3-3.fc24             rawhide    607 k
 libX11-common              noarch    1.6.3-3.fc24             rawhide    163 k
 libXau                     x86_64    1.0.8-6.fc24             rawhide     32 k
 libXpm                     x86_64    3.5.11-5.fc24            rawhide     54 k
 libwebp                    x86_64    0.5.1-1.fc26             rawhide    244 k
 libxcb                     x86_64    1.12-1.fc25              rawhide    208 k
 perl-Business-ISBN         noarch    3.003-1.fc26             rawhide     34 k
 perl-Business-ISBN-Data    noarch    20140910.003-3.fc25      rawhide     32 k
 perl-GD                    x86_64    2.56-9.fc25              rawhide    169 k
 perl-GD-Barcode            noarch    1.15-23.fc25             rawhide    682 k
 perl-IO-Socket-SSL         noarch    2.038-1.fc26             rawhide    260 k
 perl-Mojolicious           noarch    7.08-1.fc26              rawhide    831 k
 perl-Net-SSLeay            x86_64    1.78-1.fc26              rawhide    329 k
 perl-URI                   noarch    1.71-4.fc25              rawhide    116 k

Reassigning to perl-IO-Socket-SSL.

Comment 4 Paul Howarth 2016-09-30 07:33:27 UTC
perl-IO-Socket-SSL has a dependency on perl(URI) for public suffix list support. Whilst URI is the preferred back-end for this, it could also use Net::IDN::Encode or Net::LibIDN + Encode, which might be lighter weight options.

perl-URI requires Business::ISBN for ISBN (RFC 3187) support. Again, it's an optional dependency. That's what's pulling in the graphics deps, as mentioned by Petr.

We could make any or all of these weak deps but it wouldn't help the default case where weak deps are enabled.

I suspect the best option would be to downgrade the perl(URI) dependency in perl-IO-Socket-SSL to Suggests: and add a Recommends: perl(Net::IDN::Encode), which wouldn't pull in the graphical deps and Mojolicious.

Comment 5 Petr Pisar 2016-09-30 07:57:49 UTC
What about sub-packaging URI::_idna and URI::_punycode? IO::Socket::SSL uses URI::_idna that needs only URI::_punycode and URI::_punycode does not need anything else.

Comment 6 Paul Howarth 2016-09-30 08:02:00 UTC
Hmm, that would be nicer. I'll take a look at it.

Comment 7 Petr Pisar 2016-09-30 08:03:41 UTC
However, in my opinion, the biggest problem is Business::ISBN requiring GD or URI requiring Business::ISBN. URI module is a quite often dependency and thus cutting the GD from URI would save any URI user and thus provide big relieve to Fedora. I only worry that it will not be easy (or will be impossible). I looked at this problem in the past and I could not found any solution.

Comment 8 Paul Howarth 2016-09-30 08:11:03 UTC
Perhaps sub-package perl(URI::urn::isbn) from perl-URI?

Comment 9 Peter Robinson 2016-09-30 16:34:31 UTC
(In reply to Petr Pisar from comment #7)
> However, in my opinion, the biggest problem is Business::ISBN requiring GD

what functionality does GD as a graphics library provide to a ISBN library?

Comment 10 Paul Howarth 2016-10-01 12:25:45 UTC
(In reply to Peter Robinson from comment #9)
> (In reply to Petr Pisar from comment #7)
> > However, in my opinion, the biggest problem is Business::ISBN requiring GD
> 
> what functionality does GD as a graphics library provide to a ISBN library?

Per Comment #1:

  perl-GD-Barcode is required by perl-Business-ISBN (that's upstream
  decision to hard-require barcode visualization)

Comment 11 Petr Pisar 2016-10-03 07:59:20 UTC
(In reply to Paul Howarth from comment #10)
> (In reply to Peter Robinson from comment #9)
> > (In reply to Petr Pisar from comment #7)
> > > However, in my opinion, the biggest problem is Business::ISBN requiring GD
> > 
> > what functionality does GD as a graphics library provide to a ISBN library?
> 
> Per Comment #1:
> 
>   perl-GD-Barcode is required by perl-Business-ISBN (that's upstream
>   decision to hard-require barcode visualization)

The issue with perl-Business-ISBN is, both ISBN string parser and string-to-PNG convertor are defined in the same file. It's impossible to split the two features into two RPM packages.

But the current code looks like:

sub png_barcode {
    my $self = shift;

    my $ean = $self->as_isbn13->as_string([]);

    eval "use GD::Barcode::EAN13";
    if( $@ )
        {
        carp "Need GD::Barcode::EAN13 to use png_barcode!";
        return;
        }

    my $image = GD::Barcode::EAN13->new($ean)->plot->png;

    return $image;
    }

So it looks like upstream tries loading the GD library only when needed. The question is whether he did for performance or for making the dependency optional. Raising exception instead of returning undef does not evoke the optionality is an intended first class citizen. Or maybe the upstream just does not know a "use" can be replaced by "require; ->import()".

But purely technically, it allows us to make the dependency optional on RPM level because it will not crash in all uses cases. But honestly, I still don't feel comfortable with this definition of optionality.

Comment 12 Peter Robinson 2016-10-03 08:20:26 UTC
> So it looks like upstream tries loading the GD library only when needed. The
> question is whether he did for performance or for making the dependency
> optional. Raising exception instead of returning undef does not evoke the
> optionality is an intended first class citizen. Or maybe the upstream just
> does not know a "use" can be replaced by "require; ->import()".
> 
> But purely technically, it allows us to make the dependency optional on RPM
> level because it will not crash in all uses cases. But honestly, I still
> don't feel comfortable with this definition of optionality.

Any way we can make perl-Business-ISBN / barcode optional for URI. I kind of get why you'd want ISBN as an option in Barcode, even if it is quite a corner case for barcodes, but barcodes for URIs again is quite a corner case (IMO at least) for the average use case for URIs in Fedora. I presume the usecase is for reading of URLs embedded in 2D barcodes?

Comment 13 Paul Howarth 2016-10-06 15:30:58 UTC
How about just making perl(Business::ISBN) a Suggests: instead of a Requires: from perl-URI? I think that's how URI's upstream considers it, certainly not as a hard dependency.

Comment 14 Petr Pisar 2016-10-06 15:59:27 UTC
That's also an option. And the more I think about all the involved packages, the more it looks like the best solution.

Comment 15 Paul Howarth 2016-10-07 07:39:30 UTC
OK, I've done that.

Comment 16 Fedora Update System 2016-10-07 14:50:30 UTC
perl-URI-1.71-5.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-5c74e5732c

Comment 17 Fedora Update System 2016-10-10 17:42:14 UTC
perl-URI-1.71-5.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.