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

Re: [PATCH] meson: restore hook-list.h to builtin_sources

From
MGMike Gilbert <floppym@gentoo.org>
Date
Jul 2, 2026, 17:03 UTC
Message-ID
<CAJ0EP43gyQf_XhCLCNEzCq9wMYXZBQX=PWjR-wYqoESSvByJiA@mail.gmail.com>
In-Reply-To
<akZGJP1kVtjBFN_e@pks.im>
On Thu, Jul 2, 2026 at 7:06 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 79 quoted lines
>
> On Wed, Jul 01, 2026 at 03:39:28PM -0400, Mike Gilbert wrote:
> > This fixes a racy build failure.
> >
> > ```
> > builtin/bugreport.c:12:10: fatal error: hook-list.h: No such file or directory
> >    12 | #include "hook-list.h"
> >       |          ^~~~~~~~~~~~~
> >
> > ```
> >
> > hook-list.h must be generated before builtin/bugreport.c is compiled.
>
> "hook-list.h" is required by both "hook.c" and by "builtin/bugreport.c".
> So you would expect that we indeed need the header generated for both of
> these, but right now we only explicitly list the dependency for our
> libgit sources, not to our builtin sources. And consequently the header
> may not be generated:
>
>     $ meson setup build
>     ...
>     $ ninja -C build git.p/builtin_bugreport.c.o
>     ...
>     ../builtin/bugreport.c:12:10: fatal error: 'hook-list.h' file not found
>    12 | #include "hook-list.h"
>       |          ^~~~~~~~~~~~~
>    1 error generated.
>
> The fix is of course to explicitly list the header for both targets.
> And...
>
> > diff --git a/meson.build b/meson.build
> > index 3247697f74aa..bdc83843e8e0 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -278,7 +278,20 @@ compat_sources = [
> >    'compat/terminal.c',
> >  ]
> >
> > +hook_list = custom_target(
> > +  input: 'Documentation/githooks.adoc',
> > +  output: 'hook-list.h',
> > +  command: [
> > +    shell,
> > +    meson.current_source_dir() + '/tools/generate-hooklist.sh',
> > +    meson.current_source_dir(),
> > +    '@OUTPUT@',
> > +  ],
> > +  env: script_environment,
> > +)
> > +
> >  libgit_sources = [
> > +  hook_list,
> >    'abspath.c',
> >    'add-interactive.c',
> >    'add-patch.c',
> > @@ -566,19 +579,8 @@ libgit_sources += custom_target(
> >    env: script_environment,
> >  )
> >
> > -libgit_sources += custom_target(
> > -  input: 'Documentation/githooks.adoc',
> > -  output: 'hook-list.h',
> > -  command: [
> > -    shell,
> > -    meson.current_source_dir() + '/tools/generate-hooklist.sh',
> > -    meson.current_source_dir(),
> > -    '@OUTPUT@',
> > -  ],
> > -  env: script_environment,
> > -)
> > -
> >  builtin_sources = [
> > +  hook_list,
> >    'builtin/add.c',
> >    'builtin/am.c',
> >    'builtin/annotate.c',
>
> ... that's exactly what you do. So this fix looks good to me, thanks!

Thank you for the review. This is my first contribution to the Git project and I'm trying to follow the lengthy SubmittingPatches guide.

I believe we have "reached a consensus" and my next steps are as follows:
- Add Reviewed-by (or Acked-by?) for Patrick and Adrian.
- Send the patch to Junio with the list CCed.
Do I have that right?
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 4 of 6 in “meson: restore hook-list.h to builtin_sources”
  1. meson: restore hook-list.h to builtin_sourcesMike Gilbert, Jul 1, 2026
  2. Adrian RatiuJul 2, 2026
  3. Patrick SteinhardtJul 2, 2026
  4. Mike GilbertJul 2, 2026
  5. Patrick SteinhardtJul 3, 2026
  6. Matt HunterJul 3, 2026

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.