Re: [PATCH] Makefile: fix parallel build race
- From
Jeff King <peff@peff.net>
- Date
- Nov 17, 2021, 03:18 UTC
- Message-ID
- <YZR0djZbRUicXcQm@coredump.intra.peff.net>
- In-Reply-To
- <7d82342089a80b19e54ac8997d5765a33951499f.1637112066.git.congdanhqx@gmail.com>
On Wed, Nov 17, 2021 at 08:25:55AM +0700, Đoàn Trần Công Danh wrote:
> * builtin/bugreport.c includes hook-list.h, hence generated files from > it must depend on hook-list.h
Good catch. This is trivially reproducible with:
make clean make builtin/bugreport.o
The problem comes from cfe853e66b (hook-list.h: add a generated list of hooks, like config-list.h, 2021-09-26), as you might expect.
Show 9 quoted lines
> diff --git a/Makefile b/Makefile > index 241dc322c0..413503b488 100644 > --- a/Makefile > +++ b/Makefile > @@ -2222,6 +2222,7 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS) > > help.sp help.s help.o: command-list.h > hook.sp hook.s hook.o: hook-list.h > +builtin/bugreport.sp builtin/bugreport.s builtin/bugreport.o: hook-list.h
This fix looks correct. I grepped for other similar cases, but this is the only file that needs it.
Curiously, the existing hook.c does not seem to include hook-list.h, even though you can see a dependency in the context above. Nor does help.c, which gained a similar dependency in cfe853e66b. Those seem superfluous, but maybe I'm missing something.
I wondered if contrib/buildsystems/CMakeLists would need a similar fixup, but it doesn't have any generated header dependencies at all (not for hook-list.h, but not for the existing command-list.h). So I'll assume it's fine (as did cfe853e66b).
-Peff