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

Re: [PATCH] Makefile: add missing dependencies of 'config-list.h'

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 13, 2021, 19:07 UTC
Message-ID
<87czuy2ec2.fsf@evledraar.gmail.com>
In-Reply-To
<YG+UeQRwdBsVeRNV@coredump.intra.peff.net>
On Fri, Apr 09 2021, Jeff King wrote:
Show 39 quoted lines
> On Fri, Apr 09, 2021 at 12:08:23AM +0200, Ævar Arnfjörð Bjarmason wrote:
>
>> > -config-list.h:
>> > +config-list.h: Documentation/*config.txt Documentation/config/*.txt
>> >  	$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh \
>> >  		>$@+ && mv $@+ $@
>> >  
>> >  command-list.h: generate-cmdlist.sh command-list.txt
>> >  
>> > -command-list.h: $(wildcard Documentation/git*.txt) Documentation/*config.txt Documentation/config/*.txt
>> > +command-list.h: $(wildcard Documentation/git*.txt)
>> >  	$(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \
>> >  		$(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
>> >  		command-list.txt >$@+ && mv $@+ $@
>> 
>> This change makes sense.
>
> I agree it looks like it's moving in the right direction, but I am
> slightly puzzled by the existing code. Why do we need to use $(wildcard)
> for git*.txt, but not for the others?
>
>> I have a not-yet-submitted patch series where I added some more
>> config/*/*.txt that wouldn't be caught by this rule, I'd updated the
>> Documentation/Makefile, but missed this part in the top-level Makefile.
>> 
>> So a relation question: Does anyone actually prefer this state of
>> affairs of having a Makefile, Documentation/Makefile, t/Makefile
>> t/perf/Makefile and template/Makefile?
>> 
>> It seems to me with ever-closer coupling between them that it's getting
>> to be more of a hassle to manage state between them than it would be to
>> just move them all into one big Makefile.
>
> Yes, I'm generally a fan of avoiding recursive make when we can. I think
> the caveats are:
>
>   - it would be nice to continue to have stub Makefiles in
>     sub-directories that trigger the main one (so "cd t && make"
>     continues to work, for example).

Yeah, we should definitely keep those in place. I also wonder if various rules for local wildcards will be more complex when they need to reach into subdirectories.

Show 9 quoted lines
>   - we may need some cleanup of parts of the top-level Makefile which
>     are triggered without dependencies (e.g., I think we unconditionally
>     run some scripts to compute GIT_VERSION in the top-level; this is
>     already a bit wasteful, but may get even more so as we add more
>     rules from sub-directories).
>
> Mostly my argument against it (and why I haven't purused it) would be:
> it sounds like a lot of work and risk of regression, and the current
> system seems pretty fine in practice.

One edge case I discovered the other day but didn't bother debugging much was make at the top-level failing because "doc.dep" in Documentation/Makefile uses this pattern:

    rm x &&
    script >x

Which would normally work in one Makefile, but in this case two rules in the top-level called unrelated "make -C Documentation [...]", so both of those sub-processes end up needing to generate the doc.dep, and they race each other.

Another thing fixed (or, worked around) with a wider application of [1].
1. https://lore.kernel.org/git/patch-3.6-96e2338ed8e-20210329T161723Z-avarab@gmail.com/
Previous: Junio C HamanoNext: Emily Shaffer
Message 15 of 40 in “git-bugreport with fixed VS build”
  1. 0/5 git-bugreport with fixed VS buildEmily Shaffer, Apr 16, 2020
  2. 1/5 help: move list_config_help to builtin/helpEmily Shaffer, Apr 16, 2020
  3. Junio C HamanoApr 16, 2020
  4. Junio C HamanoApr 16, 2020
  5. Emily ShafferApr 17, 2020
  6. Danh DoanApr 17, 2020
  7. Danh DoanApr 17, 2020
  8. Makefile: add missing dependencies of 'config-list.h'SZEDER Gábor, Apr 8, 2021
  9. Ævar Arnfjörð BjarmasonApr 8, 2021
  10. Jeff KingApr 8, 2021
  11. SZEDER GáborApr 9, 2021
  12. Junio C HamanoApr 16, 2021
  13. SZEDER GáborApr 16, 2021
  14. Junio C HamanoApr 16, 2021
  15. Ævar Arnfjörð BjarmasonApr 13, 2021
  16. 2/5 bugreport: add tool to generate debugging infoEmily Shaffer, Apr 16, 2020
  17. SZEDER GáborAug 12, 2020
  18. SZEDER GáborApr 8, 2021
  19. 4/5 bugreport: add uname infoEmily Shaffer, Apr 16, 2020
  20. Ævar Arnfjörð BjarmasonApr 8, 2021
  21. Junio C HamanoApr 8, 2021
  22. Ævar Arnfjörð BjarmasonApr 8, 2021
  23. Emily ShafferApr 8, 2021
  24. Junio C HamanoApr 8, 2021
  25. SZEDER GáborApr 9, 2021
  26. t0091-bugreport.sh: actually verify some content of reportMartin Ågren, Apr 11, 2021
  27. Junio C HamanoApr 12, 2021
  28. Martin ÅgrenApr 13, 2021
  29. Ævar Arnfjörð BjarmasonApr 13, 2021
  30. Emily ShafferApr 13, 2021
  31. t0091-bugreport.sh: actually verify some content of reportMartin Ågren, Jul 1, 2023
  32. Phillip WoodJul 3, 2023
  33. Martin ÅgrenJul 5, 2023
  34. t0091-bugreport.sh: actually verify some content of reportMartin Ågren, Jul 5, 2023
  35. Phillip WoodJul 5, 2023
  36. SZEDER GáborApr 13, 2021
  37. 3/5 bugreport: gather git version and build infoEmily Shaffer, Apr 16, 2020
  38. 5/5 bugreport: add compiler infoEmily Shaffer, Apr 16, 2020
  39. Ævar Arnfjörð BjarmasonApr 8, 2021
  40. Đoàn Trần Công DanhApr 8, 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.