meson: fix dependencies for generated headers

We generate a couple of headers from our documentation. These headers are added to the libgit sources, but two of them aren't used by the library, but instead by our builtins. This can cause parallel builds to fail because the builtin object may be compiled before the header was generated. Fix the issue by adding both "config-list.h" and "hook-list.h" to the list of builtin sources. While "command-list.h" is generated similarly, it is used by "help.c" and thus part of the libgit sources indeed. Reported-by: Evan Martin <evan.martin@gmail.com> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jan 22, 2025 at 13:05 UTC 53d75bd3e4f1e1d6c721fd90f9754a80caa61fd5
1 file changed +9 -9
meson.build
+9 -9
@@ -487,6 +487,13 @@ libgit_sources = [
487 'xdiff/xutils.c',
488 ]
489
490 +libgit_sources += custom_target(
491 + input: 'command-list.txt',
492 + output: 'command-list.h',
493 + command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
494 + env: script_environment,
495 +)
496 +
497 builtin_sources = [
498 'builtin/add.c',
499 'builtin/am.c',
@@ -614,14 +621,7 @@ builtin_sources = [
621 'builtin/write-tree.c',
622 ]
623
617 -libgit_sources += custom_target(
618 - input: 'command-list.txt',
619 - output: 'command-list.h',
620 - command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
621 - env: script_environment,
622 -)
623 -
624 -libgit_sources += custom_target(
624 +builtin_sources += custom_target(
625 output: 'config-list.h',
626 command: [
627 shell,
@@ -632,7 +632,7 @@ libgit_sources += custom_target(
632 env: script_environment,
633 )
634
635 -libgit_sources += custom_target(
635 +builtin_sources += custom_target(
636 input: 'Documentation/githooks.txt',
637 output: 'hook-list.h',
638 command: [