[phobos] improved module cycle detection algorithm finds existing cycle in phobos, what to do?

Andrei Alexandrescu andrei at erdani.com
Tue Nov 9 19:38:23 PST 2010


That looks much better. Thanks, Steve, and sorry for the slow response.

andrei

On 11/8/10 6:42 AM, Steve Schveighoffer wrote:
> Here is the new format, see if you like it:
>
> Cyclic dependency in module std.encoding
>     imported from (std.string)
>     imported from (std.dateparse)
>     imported from (std.date)
>     imported from (std.file)
>     imported from (std.stdio)
>     imported from (std.functional)
>     imported from (std.range)
>     imported from (std.exception)
>     imported from (std.conv)
>     imported from (std.array)
>     imported from (std.algorithm)
> imported from std.random containing module ctor/dtor
>     imported from (std.range)
>     imported from (std.exception)
>     imported from (std.conv)
>     imported from (std.array)
>     imported from (std.algorithm)
>     imported from (std.string)
> imported from std.encoding containing module ctor/dtor
> Cycle detected between modules with ctors/dtors:
> std.encoding ->  std.random ->  std.encoding
> object.Exception: Aborting!
>
> -Steve
>
>
> ----- Original Message ----
>> From: Steve Schveighoffer<schveiguy at yahoo.com>
>>
>> ----- Original Message ----
>>
>>> From: Andrei Alexandrescu<andrei at erdani.com>
>>>
>>> On  11/5/10 11:21 AM, Steve Schveighoffer wrote:
>>>> I think the   cycle as I print it is pretty clear.  What do you find
>> unclear
>>
>>> about
>>>> it?
>>>
>>> Well I didn't look into this  closely but essentially  there was this list:
>>>
>>> Cyclic  dependency in module std.encoding
>>> imported  from std.string
>>>   imported from std.dateparse
>>> imported from  std.date
>>>   imported from std.file
>>> imported from std.stdio
>>> imported  from  std.functional
>>> imported from std.range
>>> imported  from  std.exception
>>> imported from std.conv
>>> imported from  std.array
>>> imported  from std.algorithm
>>> imported from  std.random *
>>> imported from  std.range
>>> imported from  std.exception
>>> imported from std.conv
>>> imported  from  std.array
>>> imported from std.algorithm
>>> imported from   std.string
>>> imported from std.encoding *
>>> object.Exception:  Aborting due to  cycle between (*) elements with module
>>> ctors/dtors
>>>
>>> It didn't immediately  give away where  the problem is and what steps need to
>> be
>>
>>> taken to fix it.  Probably  that's why you were compelled to add a natural
>>> language   translation:
>>>
>>>> So what this is saying, is std.encoding  indirectly  imports std.random,
>> which
>>>> indirectly imports  std.encoding, and both of  these modules contain shared
>>
>>> module
>>>> ctors.  I manually verified the  cycle  path, and that shared ctors exist,
>> so
>>
>>> it
>>>> is a real  cycle.
>
>
>
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list