wangyu5 / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

Incremental Gyp build does not detect deleted header files #206

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If I delete a header file but forget to change the .c files that #include it, 
an incremental Gyp build does not detect that.

Here is a test case:

cat >foo.gyp <<END
{
  'targets': [
    {
      'target_name': 'foo_executable',
      'type': 'executable',
      'sources': ['foo.c'],
    },
  ],
}
END

cat >foo.c <<END
#include "foo.h"
int main() { return 0; }
END

cat >foo.h <<END
// Blah
END

~/devel/nacl/tools/gyp/gyp foo.gyp --depth=.

make
rm foo.h
# Should fail, but doesn't
make

This is probably hard to fix with GNU Make.

With makefiles, the cause is that 
"out/Default/.deps/out/Default/obj.target/foo_executable/foo.o.d" contains the 
line "foo.h:".  This is to stop the deletion of "foo.h" from halting the build 
in the case when "foo.c" was correctly updated.

Original issue reported on code.google.com by mseaborn@chromium.org on 3 Aug 2011 at 3:41

GoogleCodeExporter commented 9 years ago
This caused a Chromium build break, because the trybots did not catch a 
mistake: http://code.google.com/p/chromium/issues/detail?id=91482

The build must have failed to catch this on Linux, Mac and Windows.

Original comment by mseaborn@chromium.org on 3 Aug 2011 at 3:47