Re: [PATCH] Update hard-coded header dependencies
On Sun, Aug 10, 2014 at 03:48:24PM -0400, Jeff King wrote: > On Fri, Aug 08, 2014 at 02:58:26PM -0700, Jonathan Nieder wrote: > > > Maybe it's worth switching to plain > > > > LIB_H += $(wildcard *.h) > > > > ? People using ancient compilers that never change headers wouldn't > > be hurt, people using modern compilers that do change headers also > > wouldn't be hurt, and we could stop pretending to maintain an > > up-to-date list. > [...] > Maybe > > LIB_H += $(shell find . -name '*.h' -print) > > would work? I took a stab at this and it seems to work. Here's a series. [1/2]: Makefile: use `find` to determine static header dependencies [2/2]: Makefile: drop CHECK_HEADER_DEPENDENCIES code -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Update hard-coded header dependencies
Junio C Hamano writes: > Jonathan Nieder writes: > >> ? People using ancient compilers that never change headers wouldn't >> be hurt, people using modern compilers that do change headers also >> wouldn't be hurt, and we could stop pretending to maintain an >> up-to-date list. > > I agree that it is very tempting to declare that we do not manually > "maintain" the dependency list and force people without -MMD to > recompile whenever any unrelated header changes. Especially that > this patch only works on the 'master' branch and upwards, and does > not even work on 'maint', let alone 1.9 or 1.8.5 maintenance tracks. > > Let's consider the merit of that approach after 2.1 is out. Thanks. Actually "upwards" is not even true; the 'next' branch already wants e.g. trace.h to build credential-store.o, which is not needed for the 'master' branch. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Update hard-coded header dependencies
Jonathan Nieder writes: > The fall-back rules used when compilers don't support the -MMD switch > to generate makefile rules based on #includes have been out of date > since v1.7.12.1~22^2~8 (move git_version_string into version.c, > 2012-06-02). > > Checked with 'make CHECK_HEADER_DEPENDENCIES=yes'. > > Signed-off-by: Jonathan Nieder > --- > Maybe it's worth switching to plain > > LIB_H += $(wildcard *.h) > > ? People using ancient compilers that never change headers wouldn't > be hurt, people using modern compilers that do change headers also > wouldn't be hurt, and we could stop pretending to maintain an > up-to-date list. I agree that it is very tempting to declare that we do not manually "maintain" the dependency list and force people without -MMD to recompile whenever any unrelated header changes. Especially that this patch only works on the 'master' branch and upwards, and does not even work on 'maint', let alone 1.9 or 1.8.5 maintenance tracks. Let's consider the merit of that approach after 2.1 is out. Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Update hard-coded header dependencies
On Fri, Aug 08, 2014 at 02:58:26PM -0700, Jonathan Nieder wrote: > Maybe it's worth switching to plain > > LIB_H += $(wildcard *.h) > > ? People using ancient compilers that never change headers wouldn't > be hurt, people using modern compilers that do change headers also > wouldn't be hurt, and we could stop pretending to maintain an > up-to-date list. Yeah, I think that makes sense. I'd imagine most of the developers are on a modern platform and don't use the static list at all, so we don't notice when it breaks (and even when you do use it, it's quite hard to notice anyway). We'd have to do a multi-directory wildcard, though, to catch the header files stuck in compat/* and elsewhere. We could list the containing directories manually, but that's yet another thing to go wrong. For people using the git repo, it would probably be fine to do: LIB_H += $(shell git ls-files -- '*.h') That wouldn't count new files a developer adds until they "git add" some version of the file, but that is not so bad (right now they have to add it to the Makefile, and anyway, I think most devs are using the computed dependencies). But that doesn't work for distributed tarballs, which would have to convert that to a static list somehow. Maybe LIB_H += $(shell find . -name '*.h' -print) would work? -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Update hard-coded header dependencies
The fall-back rules used when compilers don't support the -MMD switch to generate makefile rules based on #includes have been out of date since v1.7.12.1~22^2~8 (move git_version_string into version.c, 2012-06-02). Checked with 'make CHECK_HEADER_DEPENDENCIES=yes'. Signed-off-by: Jonathan Nieder --- Maybe it's worth switching to plain LIB_H += $(wildcard *.h) ? People using ancient compilers that never change headers wouldn't be hurt, people using modern compilers that do change headers also wouldn't be hurt, and we could stop pretending to maintain an up-to-date list. Makefile | 8 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 2320de5..18f0fad 100644 --- a/Makefile +++ b/Makefile @@ -646,15 +646,19 @@ LIB_H += cache.h LIB_H += color.h LIB_H += column.h LIB_H += commit.h +LIB_H += commit-slab.h +LIB_H += compat/apple-common-crypto.h LIB_H += compat/bswap.h LIB_H += compat/mingw.h LIB_H += compat/obstack.h LIB_H += compat/poll/poll.h LIB_H += compat/precompose_utf8.h LIB_H += compat/terminal.h +LIB_H += compat/win32/alloca.h LIB_H += compat/win32/dirent.h LIB_H += compat/win32/pthread.h LIB_H += compat/win32/syslog.h +LIB_H += connect.h LIB_H += connected.h LIB_H += convert.h LIB_H += credential.h @@ -678,6 +682,7 @@ LIB_H += grep.h LIB_H += hashmap.h LIB_H += help.h LIB_H += http.h +LIB_H += khash.h LIB_H += kwset.h LIB_H += levenshtein.h LIB_H += line-log.h @@ -721,6 +726,7 @@ LIB_H += sha1-lookup.h LIB_H += shortlog.h LIB_H += sideband.h LIB_H += sigchain.h +LIB_H += split-index.h LIB_H += strbuf.h LIB_H += streaming.h LIB_H += string-list.h @@ -728,6 +734,7 @@ LIB_H += submodule.h LIB_H += tag.h LIB_H += tar.h LIB_H += thread-utils.h +LIB_H += trace.h LIB_H += transport.h LIB_H += tree-walk.h LIB_H += tree.h @@ -744,6 +751,7 @@ LIB_H += vcs-svn/repo_tree.h LIB_H += vcs-svn/sliding_window.h LIB_H += vcs-svn/svndiff.h LIB_H += vcs-svn/svndump.h +LIB_H += version.h LIB_H += walker.h LIB_H += wildmatch.h LIB_H += wt-status.h -- -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html