Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 545998 - dev-perl/Log-Dispatch-2.440.0 unnecessarily depends on virtual/perl-threads
Summary: dev-perl/Log-Dispatch-2.440.0 unnecessarily depends on virtual/perl-threads
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL: https://rt.cpan.org/Ticket/Display.ht...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-08 20:33 UTC by Matthias Bethke
Modified: 2015-04-08 23:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Bethke 2015-04-08 20:33:45 UTC
While running my updates today, I ran into a USE change request:

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by virtual/perl-threads-1.930.0
# required by dev-perl/Log-Dispatch-2.440.0
# required by dev-perl/Log-Dispatch-Array-1.3.0::perl-experimental
# required by dev-perl/Test-Log-Dispatch-0.30.0::perl-experimental
# required by @selected
# required by @world (argument)
>=dev-lang/perl-5.20.2 ithreads

The reason for this is obviously a new dependency introduced in Log-Dispatch-2.440.0. From the Makefile.PL it looks indeed like threads were a hard requirement so newer Log::Dispatch could only be used on threaded perls. However if you look at the code, the requirement is always optional and only there to support locking where it is necessary in case the module should be used with threads. Actually, in the POD for Log::Dispatch::Syslog, the author states that he doesn't use threads himself.
The whole thing builds and tests just fine if the requirement is simply removed as even non-threaded perls bring the threads module that just throws an error if actually used but satisfies MakeMaker.
Comment 1 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2015-04-08 20:43:25 UTC
Its kinda a sticky place, because whether or not you need threads depends on whether or not you use a specific feature.


https://metacpan.org/source/DROLSKY/Log-Dispatch-2.44/lib/Log/Dispatch/Syslog.pm#L61

And this poses a bit of a problem, because there's no way to tell which things depend on Log::Dispatch and implicitly require this behaviour.

I'll agree that its probably an over-zealous dependency and it should be expelled upstream, and that anyone who uses said behaviour must explicitly `use threads` in their module.
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2015-04-08 22:37:47 UTC
I think the best option would be to add 

IUSE="ithreads"

and add 

RDEPEND="
  ithreads? ( virtual/perl-threads )
"

Or something. Nothing yet on CPAN uses this new feature that requires threads, so having it as a dependency for general consumption is bad.

But if a user installs it and attempts to use it, it should be clear the reason why threads is not magically available is because you need to specify a flag to enable that.

USE_DESCRIPTION should be "Ensure perl is built with threads for Syslog 'lock' feature" 

Because ....


> perl -MLog::Dispatch::Syslog -E"Log::Dispatch::Syslog->new( min_level => 1,   lock => 1 )"
This Perl not built to support threads
Comment 3 Karen Etheridge (ETHER) 2015-04-08 23:03:31 UTC
As I commented in https://rt.cpan.org/Ticket/Display.html?id=103392, I think it is a packaging error (on the gentoo side) to transform a prerequisite on the 'threads' module to 'requires a threaded perl'. threads.pm is an installed module in core perl even in non-threaded perls, so this is a resolvable dependency.
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2015-04-08 23:26:17 UTC
(In reply to Karen Etheridge (ETHER) from comment #3)
> As I commented in https://rt.cpan.org/Ticket/Display.html?id=103392, I think
> it is a packaging error (on the gentoo side) to transform a prerequisite on
> the 'threads' module to 'requires a threaded perl'. threads.pm is an
> installed module in core perl even in non-threaded perls, so this is a
> resolvable dependency.

Thanks- I'll make this requirement optional in Log-Dispatch. & Welcome to Gentoo, I've been packaging a lot of your modules lately... :)

+  08 Apr 2015; Andreas K. Huettel <dilfridge@gentoo.org>
+  Log-Dispatch-2.440.0.ebuild, metadata.xml:
+  Make threads support optional via ithreads use flag, bug 545998
+