git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

From
Jeff King <peff@peff.net>
Date
Aug 26, 2014, 12:34 UTC
Message-ID
<20140826123427.GD29180@peff.net>
In-Reply-To
<xmqq4mx0kyrx.fsf@gitster.dls.corp.google.com>
On Mon, Aug 25, 2014 at 03:08:50PM -0700, Junio C Hamano wrote:
Show 21 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
> 
> >> Wouldn't it be sufficient to start digging not from "*" but from
> >> "??*"?
> >
> > Gah, the * was supposed to be . in my examples (though it doesn't
> > hurt).
> >
> >> 	find ??* \( -name Documentation -o -name .\?\* \) -prune -o -name \*.h
> >
> > Heh.  Yeah, that would work. ;-)
> 
> Continuing useless discussion...
> 
> Actually as you are not excluding CVS, RCS, etc., and using ??* as
> the starting point will exclude .git, .hg, etc. at the top, I think
> we can shorten it even further and say
> 
> 	find ??* -name Documentation -prune -o -name \*.h
> 
> or something.

I had originally considered starting with "find *", but I was worried about shell globbing overflowing command-line limits here. "echo *" on a built tree is about 12K. That's laughably small for Linux, but would other systems (which, after all, are the main targets) be more picky?

POSIX lists 4K as the minimum, and that has to fit the environment, too.

I'd also be fine to try it and see if anybody on an antique system complains.

> Don't we want to exclude contrib/ by the way?

Probably. For calculating dependencies, it is OK to be overly conservative (the worst case is that we trigger a recompile if somebody touched contrib/.../foo.h, which is rather unlikely).

For the .pot file, being conservative is a little annoying. In theory we might want to translate stuff in contrib/, but it probably is just extra work for translators for not much benefit (though I have not really used gettext; I assume it only pulls in strings marked with _() and friends, so being conservative is maybe not that big a deal...).

In that sense, maybe we should just hit the whole tree to be on the conservative side. The two reasons I did not in my initial attempt were:

  1. Performance. But with the final form, we only the run the `find` at
     all very rarely, so shaving off a few readdirs() is not that big a
     deal.
  2. There are a few problematic areas. t/perf may contain build trees
     which are copies of git, which I expect would confuse gettext.
So I dunno.
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 19 of 27 in “Update hard-coded header dependencies”
  1. Update hard-coded header dependenciesJonathan Nieder, Aug 8, 2014
  2. Jeff KingAug 10, 2014
  3. Jeff KingAug 21, 2014
  4. 1/2 Makefile: use "find" to determine static header dependenciesJeff King, Aug 21, 2014
  5. Jonathan NiederAug 21, 2014
  6. Jeff KingAug 22, 2014
  7. 0/3 dropping manually-maintained LIB_HJeff King, Aug 22, 2014
  8. 1/3 i18n: treat "make pot" as an explicitly-invoked targetJeff King, Aug 22, 2014
  9. 2/3 Makefile: use `find` to determine static header dependenciesJeff King, Aug 22, 2014
  10. Junio C HamanoAug 25, 2014
  11. Jeff KingAug 25, 2014
  12. Jonathan NiederAug 25, 2014
  13. Jeff KingAug 25, 2014
  14. Jeff KingAug 25, 2014
  15. Jonathan NiederAug 25, 2014
  16. Junio C HamanoAug 25, 2014
  17. Jonathan NiederAug 25, 2014
  18. Junio C HamanoAug 25, 2014
  19. Jeff KingAug 26, 2014
  20. Junio C HamanoAug 26, 2014
  21. Jeff KingAug 26, 2014
  22. Junio C HamanoAug 26, 2014
  23. 3/3 Makefile: drop CHECK_HEADER_DEPENDENCIES codeJeff King, Aug 22, 2014
  24. Jiang XinAug 23, 2014
  25. 2/2 Makefile: drop CHECK_HEADER_DEPENDENCIES codeJeff King, Aug 21, 2014
  26. Junio C HamanoAug 10, 2014
  27. Junio C HamanoAug 10, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.