[Issue 16242] New: Sometimes dependencies are not properly stored/detected

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 6 09:02:39 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16242

          Issue ID: 16242
           Summary: Sometimes dependencies are not properly
                    stored/detected
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: schveiguy at yahoo.com

Created attachment 1602
  --> https://issues.dlang.org/attachment.cgi?id=1602&action=edit
cycle detector program

When looking at cycles (see issue 16211), a case appeared to only cause cycles
on Windows, but in actuality was a cycle on all platforms. The root cause of
the cycle not being detected is that the dependencies stored by dmd and/or
detected by druntime did not include all the true dependencies.

In druntime, I have added a special debug version that prints out all
dependencies as they are encountered (see druntime src/rt/minfo.d,
printModuleDependencies). I wrote a simple cycle detector that accepts the
output from this to determine with brute force whether any cycles are present,
without dealing with determining constructor order (attached). It did not see
any cycles in the output from OSX.

The cause of this is that std.internal.math.biguintcore only had one
dependency, core.cpuid. However, it actually has several dependencies (one that
caused the cycle on Windows). For some reason, either dmd is not putting the
dependency into the module info, or druntime is not reading it.

I'm not sure how to reduce this, but I'll see if I can find some time to figure
this out.

Note sure of the guilty party, so I picked dmd. Could also be druntime.

--


More information about the Digitalmars-d-bugs mailing list