[phobos] Proposed feature: print cycle when a module cyclic dependency is detected

Lars Tandle Kyllingstad lars at kyllingen.net
Tue Jun 22 10:44:22 PDT 2010


Yeah, bug 3979 is really getting on my nerves.  Again, I suggest you
work around it by doing the std.process development outside of Phobos,
and then we can work on incorporating it in Phobos again when it's done
(and when 3979 is fixed).

When I work on it, I do so in my own lib (as ltk.process).  Then it
works fine.

-Lars



On Tue, 2010-06-22 at 10:35 -0700, Steve Schveighoffer wrote:
> For those who are interested, it was nothing that I did.  I updated the branch from trunk and somehow the new import paths caused a problem.  Although I can't say that the original branch worked, because I never got it to compile on Windows.
> 
> Lars had put a new static this() function inside process.d that really belongs in std.stdio, except that bug 3979 prevents it from working.
> 
> So I'm sorta stuck now...
> 
> *sigh*
> 
> -Steve
> 
> 
> 
> ----- Original Message ----
> > From: Steve Schveighoffer <schveiguy at yahoo.com>
> > To: Phobos <phobos at puremagic.com>
> > Sent: Tue, June 22, 2010 8:59:23 AM
> > Subject: [phobos] Proposed feature: print cycle when a module cyclic dependency is detected
> > 
> > Hi all,
> 
> Recently, I had an issue when developing std.process.  I 
> > inadvertently caused a cyclic dependency in modules.  However, the error 
> > was not enough to find the problem:
> 
> object.Exception: Cyclic dependency 
> > in module std.stdio
> 
> The problem is, this is the *end* of the cycle, not 
> > the source.  I actually hadn't changed the imports of std.stdio.
> 
> So 
> > I improved the module constructor function to automatically print all modules 
> > involved in the cycle, in the order they were imported.  Attached is the 
> > patch.  The function should not adversely affect the runtime in normal 
> > operation, since the changes I made only occur when a terminating exception is 
> > about to be thrown anyways.  Do people agree this is a worthy improvement 
> > to the runtime?  Anyone see any issues with the patch? If everyone likes, 
> > I'll commit.
> 
> -Steve
> 
> 
>       
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos




More information about the phobos mailing list