{"thread":{"id":"65906","subject":"[PATCH] meson: restore hook-list.h to builtin_sources","startedAt":"2026-07-01T19:39:39Z","lastAt":"2026-07-03T06:03:20Z","messageCount":6,"participants":["Mike Gilbert","Adrian Ratiu","Patrick Steinhardt","Matt Hunter"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"546936","messageId":"20260701193928.358825-1-floppym@gentoo.org","threadId":"65906","inReplyTo":null,"subject":"[PATCH] meson: restore hook-list.h to builtin_sources","fromName":"Mike Gilbert","fromEmail":"floppym@gentoo.org","sentAt":"2026-07-01T19:39:28Z","receivedAt":"2026-07-01T19:39:39Z","isPatch":true,"body":"This fixes a racy build failure.\n\n```\nbuiltin/bugreport.c:12:10: fatal error: hook-list.h: No such file or directory\n   12 | #include \"hook-list.h\"\n      |          ^~~~~~~~~~~~~\n\n```\n\nhook-list.h must be generated before builtin/bugreport.c is compiled.\n\nBug: https://bugs.gentoo.org/978326\nFixes: 2eb541e8f2a9 (hook: move is_known_hook() to hook.c for wider use, 2026-04-10)\nSigned-off-by: Mike Gilbert <floppym@gentoo.org>\n---\n meson.build | 26 ++++++++++++++------------\n 1 file changed, 14 insertions(+), 12 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 3247697f74aa..bdc83843e8e0 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -278,7 +278,20 @@ compat_sources = [\n   'compat/terminal.c',\n ]\n \n+hook_list = custom_target(\n+  input: 'Documentation/githooks.adoc',\n+  output: 'hook-list.h',\n+  command: [\n+    shell,\n+    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n+    meson.current_source_dir(),\n+    '@OUTPUT@',\n+  ],\n+  env: script_environment,\n+)\n+\n libgit_sources = [\n+  hook_list,\n   'abspath.c',\n   'add-interactive.c',\n   'add-patch.c',\n@@ -566,19 +579,8 @@ libgit_sources += custom_target(\n   env: script_environment,\n )\n \n-libgit_sources += custom_target(\n-  input: 'Documentation/githooks.adoc',\n-  output: 'hook-list.h',\n-  command: [\n-    shell,\n-    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n-    meson.current_source_dir(),\n-    '@OUTPUT@',\n-  ],\n-  env: script_environment,\n-)\n-\n builtin_sources = [\n+  hook_list,\n   'builtin/add.c',\n   'builtin/am.c',\n   'builtin/annotate.c',\n-- \n2.54.0\n\n"},{"id":"546974","messageId":"87mrw97k8w.fsf@gentoo.mail-host-address-is-not-set","threadId":"65906","inReplyTo":"20260701193928.358825-1-floppym@gentoo.org","subject":"Re: [PATCH] meson: restore hook-list.h to builtin_sources","fromName":"Adrian Ratiu","fromEmail":"adrian.ratiu@collabora.com","sentAt":"2026-07-02T10:34:39Z","receivedAt":"2026-07-02T10:34:59Z","isPatch":true,"body":"On Wed, 01 Jul 2026, Mike Gilbert <floppym@gentoo.org> wrote:\n> This fixes a racy build failure.\n>\n> ```\n> builtin/bugreport.c:12:10: fatal error: hook-list.h: No such file or directory\n>    12 | #include \"hook-list.h\"\n>       |          ^~~~~~~~~~~~~\n>\n> ```\n>\n> hook-list.h must be generated before builtin/bugreport.c is compiled.\n>\n> Bug: https://bugs.gentoo.org/978326\n> Fixes: 2eb541e8f2a9 (hook: move is_known_hook() to hook.c for wider use, 2026-04-10)\n> Signed-off-by: Mike Gilbert <floppym@gentoo.org>\n> ---\n>  meson.build | 26 ++++++++++++++------------\n>  1 file changed, 14 insertions(+), 12 deletions(-)\n>\n> diff --git a/meson.build b/meson.build\n> index 3247697f74aa..bdc83843e8e0 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -278,7 +278,20 @@ compat_sources = [\n>    'compat/terminal.c',\n>  ]\n>  \n> +hook_list = custom_target(\n> +  input: 'Documentation/githooks.adoc',\n> +  output: 'hook-list.h',\n> +  command: [\n> +    shell,\n> +    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n> +    meson.current_source_dir(),\n> +    '@OUTPUT@',\n> +  ],\n> +  env: script_environment,\n> +)\n> +\n>  libgit_sources = [\n> +  hook_list,\n>    'abspath.c',\n>    'add-interactive.c',\n>    'add-patch.c',\n> @@ -566,19 +579,8 @@ libgit_sources += custom_target(\n>    env: script_environment,\n>  )\n>  \n> -libgit_sources += custom_target(\n> -  input: 'Documentation/githooks.adoc',\n> -  output: 'hook-list.h',\n> -  command: [\n> -    shell,\n> -    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n> -    meson.current_source_dir(),\n> -    '@OUTPUT@',\n> -  ],\n> -  env: script_environment,\n> -)\n> -\n>  builtin_sources = [\n> +  hook_list,\n>    'builtin/add.c',\n>    'builtin/am.c',\n>    'builtin/annotate.c',\n> -- \n> 2.54.0\n\nLGTM, thanks and nice find!\n\nSorry for the build regression, at the time I did the builtin->libgit\nmove IIRC only libgit was using the generated file, but it's clearly\nsafer to have it for both precisely to avoid these kinds of build races.\n"},{"id":"546976","messageId":"akZGJP1kVtjBFN_e@pks.im","threadId":"65906","inReplyTo":"20260701193928.358825-1-floppym@gentoo.org","subject":"Re: [PATCH] meson: restore hook-list.h to builtin_sources","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-07-02T11:06:12Z","receivedAt":"2026-07-02T11:06:18Z","isPatch":true,"body":"On Wed, Jul 01, 2026 at 03:39:28PM -0400, Mike Gilbert wrote:\n> This fixes a racy build failure.\n> \n> ```\n> builtin/bugreport.c:12:10: fatal error: hook-list.h: No such file or directory\n>    12 | #include \"hook-list.h\"\n>       |          ^~~~~~~~~~~~~\n> \n> ```\n> \n> hook-list.h must be generated before builtin/bugreport.c is compiled.\n\n\"hook-list.h\" is required by both \"hook.c\" and by \"builtin/bugreport.c\".\nSo you would expect that we indeed need the header generated for both of\nthese, but right now we only explicitly list the dependency for our\nlibgit sources, not to our builtin sources. And consequently the header\nmay not be generated:\n\n    $ meson setup build\n    ...\n    $ ninja -C build git.p/builtin_bugreport.c.o\n    ...\n    ../builtin/bugreport.c:12:10: fatal error: 'hook-list.h' file not found\n   12 | #include \"hook-list.h\"\n      |          ^~~~~~~~~~~~~\n   1 error generated.\n\nThe fix is of course to explicitly list the header for both targets.\nAnd...\n\n> diff --git a/meson.build b/meson.build\n> index 3247697f74aa..bdc83843e8e0 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -278,7 +278,20 @@ compat_sources = [\n>    'compat/terminal.c',\n>  ]\n>  \n> +hook_list = custom_target(\n> +  input: 'Documentation/githooks.adoc',\n> +  output: 'hook-list.h',\n> +  command: [\n> +    shell,\n> +    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n> +    meson.current_source_dir(),\n> +    '@OUTPUT@',\n> +  ],\n> +  env: script_environment,\n> +)\n> +\n>  libgit_sources = [\n> +  hook_list,\n>    'abspath.c',\n>    'add-interactive.c',\n>    'add-patch.c',\n> @@ -566,19 +579,8 @@ libgit_sources += custom_target(\n>    env: script_environment,\n>  )\n>  \n> -libgit_sources += custom_target(\n> -  input: 'Documentation/githooks.adoc',\n> -  output: 'hook-list.h',\n> -  command: [\n> -    shell,\n> -    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n> -    meson.current_source_dir(),\n> -    '@OUTPUT@',\n> -  ],\n> -  env: script_environment,\n> -)\n> -\n>  builtin_sources = [\n> +  hook_list,\n>    'builtin/add.c',\n>    'builtin/am.c',\n>    'builtin/annotate.c',\n\n... that's exactly what you do. So this fix looks good to me, thanks!\n\nPatrick\n"},{"id":"547001","messageId":"CAJ0EP43gyQf_XhCLCNEzCq9wMYXZBQX=PWjR-wYqoESSvByJiA@mail.gmail.com","threadId":"65906","inReplyTo":"akZGJP1kVtjBFN_e@pks.im","subject":"Re: [PATCH] meson: restore hook-list.h to builtin_sources","fromName":"Mike Gilbert","fromEmail":"floppym@gentoo.org","sentAt":"2026-07-02T17:03:05Z","receivedAt":"2026-07-02T17:03:20Z","isPatch":true,"body":"On Thu, Jul 2, 2026 at 7:06 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Wed, Jul 01, 2026 at 03:39:28PM -0400, Mike Gilbert wrote:\n> > This fixes a racy build failure.\n> >\n> > ```\n> > builtin/bugreport.c:12:10: fatal error: hook-list.h: No such file or directory\n> >    12 | #include \"hook-list.h\"\n> >       |          ^~~~~~~~~~~~~\n> >\n> > ```\n> >\n> > hook-list.h must be generated before builtin/bugreport.c is compiled.\n>\n> \"hook-list.h\" is required by both \"hook.c\" and by \"builtin/bugreport.c\".\n> So you would expect that we indeed need the header generated for both of\n> these, but right now we only explicitly list the dependency for our\n> libgit sources, not to our builtin sources. And consequently the header\n> may not be generated:\n>\n>     $ meson setup build\n>     ...\n>     $ ninja -C build git.p/builtin_bugreport.c.o\n>     ...\n>     ../builtin/bugreport.c:12:10: fatal error: 'hook-list.h' file not found\n>    12 | #include \"hook-list.h\"\n>       |          ^~~~~~~~~~~~~\n>    1 error generated.\n>\n> The fix is of course to explicitly list the header for both targets.\n> And...\n>\n> > diff --git a/meson.build b/meson.build\n> > index 3247697f74aa..bdc83843e8e0 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -278,7 +278,20 @@ compat_sources = [\n> >    'compat/terminal.c',\n> >  ]\n> >\n> > +hook_list = custom_target(\n> > +  input: 'Documentation/githooks.adoc',\n> > +  output: 'hook-list.h',\n> > +  command: [\n> > +    shell,\n> > +    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n> > +    meson.current_source_dir(),\n> > +    '@OUTPUT@',\n> > +  ],\n> > +  env: script_environment,\n> > +)\n> > +\n> >  libgit_sources = [\n> > +  hook_list,\n> >    'abspath.c',\n> >    'add-interactive.c',\n> >    'add-patch.c',\n> > @@ -566,19 +579,8 @@ libgit_sources += custom_target(\n> >    env: script_environment,\n> >  )\n> >\n> > -libgit_sources += custom_target(\n> > -  input: 'Documentation/githooks.adoc',\n> > -  output: 'hook-list.h',\n> > -  command: [\n> > -    shell,\n> > -    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n> > -    meson.current_source_dir(),\n> > -    '@OUTPUT@',\n> > -  ],\n> > -  env: script_environment,\n> > -)\n> > -\n> >  builtin_sources = [\n> > +  hook_list,\n> >    'builtin/add.c',\n> >    'builtin/am.c',\n> >    'builtin/annotate.c',\n>\n> ... that's exactly what you do. So this fix looks good to me, thanks!\n\nThank you for the review. This is my first contribution to the Git\nproject and I'm trying to follow the lengthy SubmittingPatches guide.\n\nI believe we have \"reached a consensus\" and my next steps are as follows:\n\n- Add Reviewed-by (or Acked-by?) for Patrick and Adrian.\n- Send the patch to Junio with the list CCed.\n\nDo I have that right?\n"},{"id":"547034","messageId":"akdGzbF7dex9XQwp@pks.im","threadId":"65906","inReplyTo":"CAJ0EP43gyQf_XhCLCNEzCq9wMYXZBQX=PWjR-wYqoESSvByJiA@mail.gmail.com","subject":"Re: [PATCH] meson: restore hook-list.h to builtin_sources","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-07-03T05:21:17Z","receivedAt":"2026-07-03T05:21:25Z","isPatch":true,"body":"On Thu, Jul 02, 2026 at 01:03:05PM -0400, Mike Gilbert wrote:\n> On Thu, Jul 2, 2026 at 7:06 AM Patrick Steinhardt <ps@pks.im> wrote:\n> > On Wed, Jul 01, 2026 at 03:39:28PM -0400, Mike Gilbert wrote:\n> > > diff --git a/meson.build b/meson.build\n> > > index 3247697f74aa..bdc83843e8e0 100644\n> > > --- a/meson.build\n> > > +++ b/meson.build\n> > > @@ -566,19 +579,8 @@ libgit_sources += custom_target(\n> > >    env: script_environment,\n> > >  )\n> > >\n> > > -libgit_sources += custom_target(\n> > > -  input: 'Documentation/githooks.adoc',\n> > > -  output: 'hook-list.h',\n> > > -  command: [\n> > > -    shell,\n> > > -    meson.current_source_dir() + '/tools/generate-hooklist.sh',\n> > > -    meson.current_source_dir(),\n> > > -    '@OUTPUT@',\n> > > -  ],\n> > > -  env: script_environment,\n> > > -)\n> > > -\n> > >  builtin_sources = [\n> > > +  hook_list,\n> > >    'builtin/add.c',\n> > >    'builtin/am.c',\n> > >    'builtin/annotate.c',\n> >\n> > ... that's exactly what you do. So this fix looks good to me, thanks!\n> \n> Thank you for the review. This is my first contribution to the Git\n> project and I'm trying to follow the lengthy SubmittingPatches guide.\n\nIt's gotten quite long by now indeed.\n\n> I believe we have \"reached a consensus\" and my next steps are as follows:\n> \n> - Add Reviewed-by (or Acked-by?) for Patrick and Adrian.\n> - Send the patch to Junio with the list CCed.\n> \n> Do I have that right?\n\nIn the current state you don't have to do anything. Reviews were\nfavorable and you weren't asked to do any changes, so there is no need\nfor you to send a second version. Unless somebody else chimes in and\nasks for changes, Junio will eventually pick up this patch and may then\nadd the Reviewed-by trailers himself.\n\nThanks for your contribution, and welcome to Git :)\n\nPatrick\n"},{"id":"547039","messageId":"DJOPIP6EQWWJ.H6X9L009RO1W@lfurio.us","threadId":"65906","inReplyTo":"CAJ0EP43gyQf_XhCLCNEzCq9wMYXZBQX=PWjR-wYqoESSvByJiA@mail.gmail.com","subject":"Re: [PATCH] meson: restore hook-list.h to builtin_sources","fromName":"Matt Hunter","fromEmail":"m@lfurio.us","sentAt":"2026-07-03T06:03:12Z","receivedAt":"2026-07-03T06:03:20Z","isPatch":true,"body":"On Thu Jul 2, 2026 at 1:03 PM EDT, Mike Gilbert wrote:\n>\n> Thank you for the review. This is my first contribution to the Git\n> project and I'm trying to follow the lengthy SubmittingPatches guide.\n>\n> I believe we have \"reached a consensus\" and my next steps are as follows:\n>\n> - Add Reviewed-by (or Acked-by?) for Patrick and Adrian.\n\nI believe the typical etiquette is to only apply someone else's\nReviewed-by trailer if it is offered to you.\n\n> - Send the patch to Junio with the list CCed.\n\nGenerally speaking, I'd wait at least a couple days to see if _this_\ncopy of the patch gets picked up into the 'seen' branch, before\nresending for this purpose.\n\n>\n\nI _would_ give my thoughts on the change while I'm here, but I'm not\nnearly hip enough to the meson build system to leave anything useful\n\nWelcome to the Git community\n"}]}