[Issue 13517] Only touch .di generated file if changed

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Sep 22 21:05:56 PDT 2014


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

--- Comment #27 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to hsteoh from comment #26)
> I agree with Walter. Why should the compiler care if the previous version of
> the .di file different or not? That's not the compiler's job. If the build
> tool can't properly handle files that don't change (and I know make doesn't
> 'cos make sux), then it should be replaced with a saner build tool.

I understand. One way to look at this (which is what motivated the approach) is
from the perspective of automating maintenance of C++ xyz.h/xyz.cpp files -
which is a noble goal and the stated purpose of .di generation.

When a C++ programmer needs to change the inline/template/interface of a
module, they'll change xyz.h. Then the build system will notice the updated
timestamp and proceed with building dependent files. For changes to non-inline
non-template functions etc, the programmer only touches xyz.cpp and no other
dependents are rebuilt.

Switch over to D-land, where the story with xyz.di/xyz.d is similar EXCEPT now
the former is automatically taken care of; all the programmer needs to do is
update xyz.d and then the .di file will be changed (or not) accordingly.

Touching the .di file only when necessary is the natural automation of a
process in which changing the interface vs. the implementation of a module
affect different parts of the deliverables.

--


More information about the Digitalmars-d-bugs mailing list