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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Sep 22 22:06:08 PDT 2014


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

--- Comment #29 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to hsteoh from comment #28)
> Relying solely on timestamp to detect change is an antiquated concept that
> basically only make (and misguided attempts to build on it) suffers from.
> Modern build systems do not have this problem.

I agree many of the newer build systems rely on hashing the contents of files.
But not all.

> But given that it's not an ideal world (otherwise we wouldn't need to
> interface with C++ to begin with :-P) one possible workaround is to write
> your compile rules something along these lines:
> 
> sucky.o sucky.di: sucky.d
>     $(DMD) $(DFLAGS) sucky.d -ofsucky.o -H -Hfsucky_new.di
>     cmp sucky.di sucky_new.di ; if [ $? -ne 0 ] ; then cp sucky_new.di
> sucky.di ; fi

This is the best illustration on why we shouldn't inflict that on the user. You
have two bugs and one extra issue in there.

--


More information about the Digitalmars-d-bugs mailing list