Re: [PATCH v2 4/4] Makefile: precompile "git-compat-util.h"
- From
Jeff King <peff@peff.net>
- Date
- Sep 24, 2026, 23:52 UTC
- Message-ID
- <20260924235216.GA837070@coredump.intra.peff.net>
- In-Reply-To
- <20260915060952.569535-5-szeder.dev@gmail.com>
On Tue, Sep 15, 2026 at 08:09:52AM +0200, SZEDER Gábor wrote:
Show 5 quoted lines
> This patch follows the idea of 671df48df8 (meson: precompile > "git-compat-util.h", 2026-03-19) to make it faster to build Git using > "make". The notable differences are the boilerplate needed to wire up > the precompiled header with "make", and the selection of object files > that are built using the precompiled header:
I got an interesting error message from this today:
$ make imap-send.o
* new build flags
CC tools/precompiled.h.gch
CC imap-send.o
cc1: warning: ./tools/precompiled.h.gch: not used because ‘NO_OPENSSL’ is defined [-Winvalid-pch]You won't see it with:
make NO_OPENSSL=1 imap-send.o
The culprit is that I have this in my config.mak:
imap-send.o: EXTRA_CPPFLAGS += -DNO_OPENSSL
so the build options for the precompiled header and imap-send.c are not the same. So now of course you are asking why I would have such a weird line in my config.mak.
The answer is that I want to disable openssl for old builds, because I am often building historical versions which use openssl constructs that are deprecated or removed. So naturally you are now asking why it does not just say:
NO_OPENSSL = BrokenOnOldVersions
or similar. But that breaks _some_ old versions which really do need openssl for various things.
The good-ish news is that it's mostly cosmetic for me. I also loosen -Werror for old builds, for obvious reasons. So it's not breaking any build.
I don't know if my use case is too crazy to care about, but I thought I'd mention it in case there are other less-crazy related cases we might run into.
And yes, obviously old versions will not have the precompiled header, either, but my logic for "loosen compilation" is mostly "we are not on a branch nor rebasing", so a sight-seeing trip to "git checkout origin/seen" puts me in the same mode. And eventually it _will_ be old, too. ;)
-Peff