www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13517] New: Only touch .di generated file if changed

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

          Issue ID: 13517
           Summary: Only touch .di generated file if changed
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: andrei erdani.com

Running dmd -H always generates a fresh .di file, even if an existing .di file
exists and has identical content. This confuses build tools - such as make and
derivatives - that rely on file timestamp to assess what needs to be rebuilt.

The compiler should generate the header in e.g. xyz.di.tmp file. Then, if
xyz.di exists, compare the content of xyz.di with xyz.tmp. If they compare
equal, remove xyz.di.tmp and otherwise rename it to xyz.tmp.

--
Sep 21 2014