Argh!! Cyclic dependencies!!!

Steven Schveighoffer schveiguy at yahoo.com
Tue Mar 22 10:43:12 PDT 2011


On Mon, 21 Mar 2011 18:45:23 -0400, Nick Sabalausky <a at a.a> wrote:

> "Steven Schveighoffer" <schveiguy at yahoo.com> wrote in message
> news:op.vso2wwsweav7ka at steve-laptop...
>>
>> If you are interested, the code that runs the static ctors is in  
>> druntime,
>> not the compiler.
>
> Yea, I had a feeling druntime would be involved since the cycles get
> reported at runtime. Thanks for confirming, though.
>
>> In any case, I think you could do something repulsive like naming your
>> module nodeps_x instead of x, and have the cycle detection skip over  
>> that
>> module when detecting cycles.  Bottom line is, there is no valid static
>> data before static ctors run, so you must figure out how to get the info
>> to the cycle detection routine without static data.
>
> I'm not very familiar with how druntime works. Are you implying that  
> sending
> information from a pragma to druntime would inherently require using  
> valid
> static data from a static ctor?

No, I was saying if you want a stop-gap solution that does not involve  
modifying the compiler, you have to use what the compiler gives you.   
Namely, what is in the ModuleInfo.  You can't rely on something like a  
static initializer.

If you have a pragma, no changes to druntime are necessary, it already has  
the capability of skipping modules marked with the standalone flag.

> I take it that the answer from the-powers-that-be to the question "Is  
> there
> a chance that a stop-gap solution might be accepted?" is "no comment"? If
> there's any worry about a "there's a chance of it" being misinterpreted  
> as a
> promise for inclusion, I can assure that I'm an adult and do know the
> difference between "yes" and "maybe".

I think a pragma or an annotation would be considered by the  
powers-that-be.  No response from Walter is usually a good sign that he's  
not adamantly against it ;)

-Steve


More information about the Digitalmars-d mailing list