This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id:
92435
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
zefram [...] fysh.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
2.14



Subject: non-deterministic dependency handling
Date: Fri, 24 Jan 2014 13:09:14 +0000
To: bug-CPAN@rt.cpan.org
From: Zefram <zefram@fysh.org>
On 5.18.2, when CPAN is automatically following the dependencies of a distro that is being installed, the order in which it tackles the dependencies varies between multiple runs that have the same conditions. This is probably based on varying hash order. No particular order is promised, of course, but being non-deterministic makes it more difficult to compare runs to track down bugs. It makes any bug that depends on installation order manifest intermittently. For these reasons it would be nice for CPAN to follow dependencies deterministically. Where hash order is responsible, some strategic sprinkling of "sort" will fix it. -zefram
On 2014-01-24 05:09:33, zefram@fysh.org wrote:
Show quoted text
> On 5.18.2, when CPAN is automatically following the dependencies of > a distro that is being installed, the order in which it tackles the > dependencies varies between multiple runs that have the same conditions. > This is probably based on varying hash order. No particular order is > promised, of course, but being non-deterministic makes it more difficult > to compare runs to track down bugs. It makes any bug that depends on > installation order manifest intermittently. For these reasons it would > be nice for CPAN to follow dependencies deterministically. Where hash > order is responsible, some strategic sprinkling of "sort" will fix it. > > -zefram
I wonder if it would make sense to have a config option to switch between randomized and deterministic order. Having the order randomized means that it's more likely to find errors where other distributions haven't properly declared their prerequisites (but other prereqs might also cause that module to become isntalled).
Subject: Re: [rt.cpan.org #92435] AutoReply: non-deterministic dependency handling
Date: Thu, 26 Feb 2015 16:13:51 +0000
To: Bugs in CPAN via RT <bug-CPAN@rt.cpan.org>
From: Zefram <zefram@fysh.org>
Attached patch makes CPAN process things in deterministic order in several places. There may be more sorting than strictly necessary; this won't hurt. -zefram

Message body is not shown because sender requested not to inline it.

On 2014-06-13 17:17:03, ETHER wrote:
Show quoted text
> On 2014-01-24 05:09:33, zefram@fysh.org wrote:
> > On 5.18.2, when CPAN is automatically following the dependencies of > > a distro that is being installed, the order in which it tackles the > > dependencies varies between multiple runs that have the same > > conditions. > > This is probably based on varying hash order. No particular order is > > promised, of course, but being non-deterministic makes it more > > difficult > > to compare runs to track down bugs. It makes any bug that depends on > > installation order manifest intermittently. For these reasons it > > would > > be nice for CPAN to follow dependencies deterministically. Where > > hash > > order is responsible, some strategic sprinkling of "sort" will fix > > it. > > > > -zefram
> > I wonder if it would make sense to have a config option to switch > between randomized and deterministic order. Having the order > randomized means that it's more likely to find errors where other > distributions haven't properly declared their prerequisites (but other > prereqs might also cause that module to become isntalled).
Good point. But unfortunately not part of zefram's patch.
Subject: Re: [rt.cpan.org #92435] non-deterministic dependency handling
Date: Fri, 27 Feb 2015 12:32:47 +0000
To: Slaven_Rezic via RT <bug-CPAN@rt.cpan.org>
From: Zefram <zefram@fysh.org>
Slaven_Rezic via RT wrote:
Show quoted text
>On 2014-06-13 17:17:03, ETHER wrote:
>> I wonder if it would make sense to have a config option to switch >> between randomized and deterministic order.
If it's to be randomised, that should be by explicit shuffling, not just using hash order. The choice can be readily factored out as a sort_or_shuffle() sub, to be used in most places that (with my patch) sort.
Show quoted text
>Good point. But unfortunately not part of zefram's patch.
Yeah, randomisation is not really of interest to me. The lack of it shouldn't stand in the way of adopting sorting. -zefram
Subject: Re: [rt.cpan.org #92435] non-deterministic dependency handling
Date: Tue, 17 Mar 2015 12:52:38 +0000
To: bug-CPAN@rt.cpan.org
From: Zefram <zefram@fysh.org>
Attached patch is updated for CPAN-2.10. -zefram

Message body is not shown because sender requested not to inline it.

Thanks, applied!
2.14 was the first non-trial release with Zefram's patch applied, resolving. Ether, Slaven, you expressed interest in support for randomized dependency resolution. If you're sure you want this, please open a new ticket. I'm currently not interested in randomization myself, I prefer randomization by shuffling my bundles.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.