Incremental builds might break on removed header files as for example: make[1]: *** No rule to make target `/home/cono/src/git/libo_core/oox/inc/oox/drawingml/diagram/diagramlayoutatoms.hxx', needed by `/home/cono/src/git/libo_core/workdir/unxlngi6.pro/CxxObject/oox/source/drawingml/chart/chartdrawingfragment.o'. Stop. The problem is that: 1) a object was compiled 2) a dependency file for the object was created naming the used headers c) the used header gets removed by an "git pull" d) the file should get recompiled, but this breaks make because it depends on an nonexisting file This EasyHack is about creating a "make depclean" goal, which would in the simplest case delete all dependency files that are older then the cxx-file of the object they where created for. This would work for all direct includes as the cxx-file would need to be changed if it includes the file directly. However, that would still fail for indirect includes (a header included via another header). To fix that reliably, the "make depclean" target has to check each file in the depfile to be existing and remove any dependency file (and the corresponding object file) naming a nonexisting file.
Created attachment 50388 [details] why not do this ? -MP This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing. These dummy rules work around errors make gives if you remove header files without updating the Makefile to match.
i.e. http://www.makelinux.net/make3/make3-CHP-8-SECT-3
I'll assume that the result of "don't break incremental builds on removed headers" is the goal rather than how we get there. I'll try -MP, it seems to do what we want. Can revert and return this to the pool if that fails for whatever reason.
http://cgit.freedesktop.org/libreoffice/core/commit/?id=afb089282040b35d86da0a87d33b1ea7c40737fd
@Caolon: Hmmm, that of course works to prevent the incremental build issues, but I wonder if it is kinda dangerous because we _have_ rules for headers that need to fire. E.g. headers in the solver, which are copied over from the sourcetree: a missing or outdated header file would then be silently left untouched, while before it (rightfully) errored out. However, I cant come up with a cornercase where this would hit us, as long as we make sure that we source the dep files _after_ our rules (which we currently do). Reopening, Assigning back to default, adjusting title and platform as this still is an issue on Windows. Hacking makedepend.exe or fixing windows dep generation to do the same as gcc should do the trick.
Created attachment 50559 [details] this seems to do the trick for windows
original > cd sot > echo \#include \<demo.hxx\> >> source/base/exchange.cxx > touch source/base/demo.hxx > make -sr 0 exchange.d has demo.hxx as a depend now > sed -i "/demo.hxx/d" source/base/exchange.cxx > rm source/base/demo.hxx > make -sr > echo $? 2, unable to rebuild because depends list removed demo.hxx > make -sr clean apply patch > echo \#include \<demo.hxx\> >> source/base/exchange.cxx > touch source/base/demo.hxx > make -sr 0 > sed -i "/demo.hxx/d" source/base/exchange.cxx > rm source/base/demo.hxx > make -sr > echo $? 0 kendy: filter-showIncludes.pl is your, how about the attached patch for windows ?
http://cgit.freedesktop.org/libreoffice/core/commit/?id=797caeb095848b6b6936c22d5b0409da7810fbba I think will do the right thing
closed, been quite a few days and I've removed quite a few files in between without the usual moaning, might have worked.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillScript SkillWindows) [NinjaEdit]
removing skillWindows keyword. There is no such thing at https://wiki.documentfoundation.org/Development/Easy_Hacks/lists/by_Required_Skill and having a "skill*" keyword makes the easyHack not even appear on that page even in "uncategorized".