[cfe-dev] Why copy_if_different?

Óscar Fuentes ofv at wanadoo.es
Fri Apr 29 08:03:09 PDT 2011


Yuri Gribov <tetra2005 at googlemail.com> writes:

> BTW I think I have a real-world example of broken dependencies in Clang:
>
> 1) Firstly I build debug Clang.
> include/clang/Basic/DiagnosticASTKinds.inc.tmp is generated using
> debug tablegen and then copied to DiagnosticASTKinds.inc.
>
> 2) Now I switch to release and build it the DiagnosticASTKinds.inc.tmp
> is regenerated (because it depends on release tablegen and it's newer
> than debug tablegen that was used to generate it).

This is an unforntunate side effect of using the same root build
directory for more than one build configuration.

> Note that now VS thinks that DiagnosticASTKinds.inc has to be rebuilt
> (it's older than DiagnosticASTKinds.inc.tmp). But due to
> copy_if_different DiagnosticASTKinds.inc.tmp is never copied to
> DiagnosticASTKinds.inc. So VS will try to rebuild Clang forever.

The above wording sounds like VS entering an infinite loop, but I don't
think it is the case. More likely VS executes some commands whenever you
run the build, but it ends, doesn't it? Is seeing those commands
executed (and the associated wait time) instead of VS saying "everything
was up to date" what bothers you, right?




More information about the cfe-dev mailing list