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

Re: [PATCH] Makefile: drop GEN_HDRS

From
Jeff King <peff@peff.net>
Date
Dec 14, 2019, 00:38 UTC
Message-ID
<20191214003820.GA927924@coredump.intra.peff.net>
In-Reply-To
<xmqq1rt7hkp6.fsf@gitster-ct.c.googlers.com>
On Fri, Dec 13, 2019 at 03:25:41PM -0800, Junio C Hamano wrote:
> Get rid of GEN_HDRS, which is used only once to list the headers we
> do not run hdr-check test on, and instead explicitly list that the
> ones, either tracked or generated, that we exempt from the test.
Yeah, I think this is an improvement by itself.
After reading this, though:
>  - If we value the header cleanliness check, we eventually want to
>    teach our header generating scripts to produce clean headers.
>    Keeping the blanket "generated headers can be left as dirty as we
>    want" exception does not nudge us in the right direction.

I did expect to see the actual hdr-check behavior move towards checking these generated versions. However, both are kind of interesting.

unicode-width.h isn't a "real" header file; it's meant to be included in the middle of a function. I think it _could_ be changed to define "struct interval" itself, and then be a static file-scope variable. But there's not really a compelling reason to do so.

But "command-list.h" is more of a traditional header file, being included at the top of help.c. In theory the hdr-check target could add a dependency on it, and then we could check it along with everything else. But even without that first step, if I remove it from EXCEPT_HDRS, nothing happens!

That's because LIB_H is created by running find in the local filesystem. So until it's generated, we don't realize it's there to check. I kind of wonder if it should be part of LIB_H. I suspect that on some systems, we'd fail to notice a rebuild when command-list.txt is updated (but nobody noticed, because it is only systems that do not have compiler-supported dependency tracking, and most developers are no modern platforms that do).

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 2 of 12 in “Makefile: drop GEN_HDRS”
  1. Makefile: drop GEN_HDRSJunio C Hamano, Dec 13, 2019
  2. Jeff KingDec 14, 2019
  3. Jeff KingDec 14, 2019
  4. Junio C HamanoDec 16, 2019
  5. Jeff KingDec 16, 2019
  6. Emily ShafferDec 17, 2019
  7. Jonathan NiederDec 17, 2019
  8. Jeff KingDec 17, 2019
  9. Jonathan NiederDec 17, 2019
  10. Jeff KingDec 17, 2019
  11. vcxproj target, was Re: [PATCH] Makefile: drop GEN_HDRSJohannes Schindelin, Dec 17, 2019
  12. Jeff KingDec 19, 2019

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.