* [PATCH] meson: restore hook-list.h to builtin_sources
@ 2026-07-01 19:39 Mike Gilbert
2026-07-02 10:34 ` Adrian Ratiu
2026-07-02 11:06 ` Patrick Steinhardt
0 siblings, 2 replies; 6+ messages in thread
From: Mike Gilbert @ 2026-07-01 19:39 UTC (permalink / raw)
To: git; +Cc: adrian.ratiu, Mike Gilbert
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.
Bug: https://bugs.gentoo.org/978326
Fixes: 2eb541e8f2a9 (hook: move is_known_hook() to hook.c for wider use, 2026-04-10)
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
meson.build | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
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',
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] meson: restore hook-list.h to builtin_sources
2026-07-01 19:39 [PATCH] meson: restore hook-list.h to builtin_sources Mike Gilbert
@ 2026-07-02 10:34 ` Adrian Ratiu
2026-07-02 11:06 ` Patrick Steinhardt
1 sibling, 0 replies; 6+ messages in thread
From: Adrian Ratiu @ 2026-07-02 10:34 UTC (permalink / raw)
To: Mike Gilbert, git; +Cc: Mike Gilbert
On Wed, 01 Jul 2026, Mike Gilbert <floppym@gentoo.org> 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.
>
> Bug: https://bugs.gentoo.org/978326
> Fixes: 2eb541e8f2a9 (hook: move is_known_hook() to hook.c for wider use, 2026-04-10)
> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> ---
> meson.build | 26 ++++++++++++++------------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>
> 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',
> --
> 2.54.0
LGTM, thanks and nice find!
Sorry for the build regression, at the time I did the builtin->libgit
move IIRC only libgit was using the generated file, but it's clearly
safer to have it for both precisely to avoid these kinds of build races.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] meson: restore hook-list.h to builtin_sources
2026-07-01 19:39 [PATCH] meson: restore hook-list.h to builtin_sources Mike Gilbert
2026-07-02 10:34 ` Adrian Ratiu
@ 2026-07-02 11:06 ` Patrick Steinhardt
2026-07-02 17:03 ` Mike Gilbert
1 sibling, 1 reply; 6+ messages in thread
From: Patrick Steinhardt @ 2026-07-02 11:06 UTC (permalink / raw)
To: Mike Gilbert; +Cc: git, adrian.ratiu
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!
Patrick
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] meson: restore hook-list.h to builtin_sources
2026-07-02 11:06 ` Patrick Steinhardt
@ 2026-07-02 17:03 ` Mike Gilbert
2026-07-03 5:21 ` Patrick Steinhardt
2026-07-03 6:03 ` Matt Hunter
0 siblings, 2 replies; 6+ messages in thread
From: Mike Gilbert @ 2026-07-02 17:03 UTC (permalink / raw)
To: Patrick Steinhardt; +Cc: Mike Gilbert, git, adrian.ratiu
On Thu, Jul 2, 2026 at 7:06 AM Patrick Steinhardt <ps@pks.im> wrote:
>
> 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?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] meson: restore hook-list.h to builtin_sources
2026-07-02 17:03 ` Mike Gilbert
@ 2026-07-03 5:21 ` Patrick Steinhardt
2026-07-03 6:03 ` Matt Hunter
1 sibling, 0 replies; 6+ messages in thread
From: Patrick Steinhardt @ 2026-07-03 5:21 UTC (permalink / raw)
To: Mike Gilbert; +Cc: git, adrian.ratiu
On Thu, Jul 02, 2026 at 01:03:05PM -0400, Mike Gilbert wrote:
> On Thu, Jul 2, 2026 at 7:06 AM Patrick Steinhardt <ps@pks.im> wrote:
> > On Wed, Jul 01, 2026 at 03:39:28PM -0400, Mike Gilbert wrote:
> > > diff --git a/meson.build b/meson.build
> > > index 3247697f74aa..bdc83843e8e0 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -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.
It's gotten quite long by now indeed.
> 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?
In the current state you don't have to do anything. Reviews were
favorable and you weren't asked to do any changes, so there is no need
for you to send a second version. Unless somebody else chimes in and
asks for changes, Junio will eventually pick up this patch and may then
add the Reviewed-by trailers himself.
Thanks for your contribution, and welcome to Git :)
Patrick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] meson: restore hook-list.h to builtin_sources
2026-07-02 17:03 ` Mike Gilbert
2026-07-03 5:21 ` Patrick Steinhardt
@ 2026-07-03 6:03 ` Matt Hunter
1 sibling, 0 replies; 6+ messages in thread
From: Matt Hunter @ 2026-07-03 6:03 UTC (permalink / raw)
To: Mike Gilbert, Patrick Steinhardt; +Cc: git, adrian.ratiu
On Thu Jul 2, 2026 at 1:03 PM EDT, Mike Gilbert wrote:
>
> 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.
I believe the typical etiquette is to only apply someone else's
Reviewed-by trailer if it is offered to you.
> - Send the patch to Junio with the list CCed.
Generally speaking, I'd wait at least a couple days to see if _this_
copy of the patch gets picked up into the 'seen' branch, before
resending for this purpose.
>
I _would_ give my thoughts on the change while I'm here, but I'm not
nearly hip enough to the meson build system to leave anything useful
Welcome to the Git community
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-03 6:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 19:39 [PATCH] meson: restore hook-list.h to builtin_sources Mike Gilbert
2026-07-02 10:34 ` Adrian Ratiu
2026-07-02 11:06 ` Patrick Steinhardt
2026-07-02 17:03 ` Mike Gilbert
2026-07-03 5:21 ` Patrick Steinhardt
2026-07-03 6:03 ` Matt Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox