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

Re: [PATCH] Makefile: fix parallel build race

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 17, 2021, 10:21 UTC
Message-ID
<211117.86o86j6q0s.gmgdl@evledraar.gmail.com>
In-Reply-To
<20211117033938.r3wsv3znxva7smgy@glandium.org>
On Wed, Nov 17 2021, Mike Hommey wrote:
Show 36 quoted lines
> On Tue, Nov 16, 2021 at 10:18:14PM -0500, Jeff King wrote:
>> 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.
>> 
>> > 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.
>
> Neither does builtin/help.c. This was discussed in the subthread
> starting at https://lore.kernel.org/all/20211115220455.xse7mhbwabrheej4@glandium.org/
> and is covered by https://lore.kernel.org/all/patch-v3-19.23-234b4eb613c-20211116T114334Z-avarab@gmail.com/
> (to which I responded that the line for hook.o can be removed too)

I've got an updated patch in my just-re-rolled Makefile dependency fixes series for this isuse, which also addresses the needless "hook.{sp,s,o} -> hook-list.h" dependency issue: https://lore.kernel.org/git/patch-v4-19.23-2710f8af6cd-20211117T101807Z-avarab@gmail.com/

Thanks again for looking all of this over & helping to make the Makefile better.

Previous: Mike HommeyNext: Johannes Schindelin
Message 4 of 12 in “Makefile: fix parallel build race”
  1. Makefile: fix parallel build raceĐoàn Trần Công Danh, Nov 17, 2021
  2. Jeff KingNov 17, 2021
  3. Mike HommeyNov 17, 2021
  4. Ævar Arnfjörð BjarmasonNov 17, 2021
  5. Johannes SchindelinNov 17, 2021
  6. Ævar Arnfjörð BjarmasonNov 17, 2021
  7. Đoàn Trần Công DanhNov 18, 2021
  8. Johannes SchindelinNov 18, 2021
  9. Ævar Arnfjörð BjarmasonNov 19, 2021
  10. Ævar Arnfjörð BjarmasonNov 19, 2021
  11. Johannes SchindelinNov 19, 2021
  12. Ævar Arnfjörð BjarmasonNov 19, 2021

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.