Re: [PATCH 0/4] Makefile: micro-optimize light non-test builds
- From
Jeff King <peff@peff.net>
- Date
- Jan 26, 2021, 21:16 UTC
- Message-ID
- <YBCGtd9if0qtuQxx@coredump.intra.peff.net>
- In-Reply-To
- <20210126160708.20903-1-avarab@gmail.com>
On Tue, Jan 26, 2021 at 05:07:04PM +0100, Ævar Arnfjörð Bjarmason wrote:
> This small series speeds up builds where you just want to get to a > working "git" binary, but don't care about running git's own tests, or > about making/installing fallbacks for "git svn" et al (which we do > even with NO_PERL).
I have to wonder if you really care about non-builtins here. If not, then doesn't "make git" do what you want?
I recently did something similar, but a bit more extreme. I have a 100-patch series introducing annotations/fixes for -Wunused-parameter. I rebased it on master, and the end result had a compile error (a previously unused and annotated parameter became used). So I wanted not just to fix it, but to put the fix in the right commit.
Doing:
git rebase -x 'make -j16'
builds each commit and stops when we hit the breakage, which is nice. But it takes a while to build, and a non-trivial bit of time is spent generating libgit.a, running the linker, making builtin hardlinks, etc.
I ended up putting:
objects: $(LIB_OBJS) $(BUILTIN_OBJS) git.o
into my config.mak, and then "make objects" is quite fast. Probably too gross a hack to carry in our Makefile, but I was tempted to send it.
-Peff