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

[PATCH 3/9] meson: fix dependencies for generated headers

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 13, 2025, 08:33 UTC
Message-ID
<20250113-b4-pks-meson-additions-v1-3-97f6a93f691d@pks.im>
In-Reply-To
<20250113-b4-pks-meson-additions-v1-0-97f6a93f691d@pks.im>

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>
---
 meson.build | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index 87755537d2aff84a9d8e86f0f5b025ef8dd23292..e278ff207a7714fbb6b6cf8e1ec1fcca37360bd0 100644
--- a/meson.build
+++ b/meson.build
@@ -480,6 +480,13 @@ libgit_sources = [
   'xdiff/xutils.c',
 ]
 
+libgit_sources += custom_target(
+  input: 'command-list.txt',
+  output: 'command-list.h',
+  command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
+  env: script_environment,
+)
+
 builtin_sources = [
   'builtin/add.c',
   'builtin/am.c',
@@ -607,14 +614,7 @@ builtin_sources = [
   'builtin/write-tree.c',
 ]
 
-libgit_sources += custom_target(
-  input: 'command-list.txt',
-  output: 'command-list.h',
-  command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
-  env: script_environment,
-)
-
-libgit_sources += custom_target(
+builtin_sources += custom_target(
   output: 'config-list.h',
   command: [
     shell,
@@ -625,7 +625,7 @@ libgit_sources += custom_target(
   env: script_environment,
 )
 
-libgit_sources += custom_target(
+builtin_sources += custom_target(
   input: 'Documentation/githooks.txt',
   output: 'hook-list.h',
   command: [
-- 
2.48.0.257.gd3603152ad.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 7 of 35 in “meson: a couple of additions”
  1. 0/9 meson: a couple of additionsPatrick Steinhardt, Jan 13, 2025
  2. 1/9 GIT-VERSION-GEN: simplify computing the dirty markerPatrick Steinhardt, Jan 13, 2025
  3. 2/9 GIT-VERSION-GEN: move default version into a separate filePatrick Steinhardt, Jan 13, 2025
  4. Junio C HamanoJan 13, 2025
  5. Eli SchwartzJan 13, 2025
  6. Patrick SteinhardtJan 14, 2025
  7. 3/9 meson: fix dependencies for generated headersPatrick Steinhardt, Jan 13, 2025
  8. 4/9 meson: wire up development environmentsPatrick Steinhardt, Jan 13, 2025
  9. 6/9 meson: wire up fuzzersPatrick Steinhardt, Jan 13, 2025
  10. Junio C HamanoJan 13, 2025
  11. Patrick SteinhardtJan 14, 2025
  12. 5/9 meson: wire up generation of distribution archivePatrick Steinhardt, Jan 13, 2025
  13. Junio C HamanoJan 13, 2025
  14. Patrick SteinhardtJan 14, 2025
  15. 7/9 meson: make the CSPRNG backend configurablePatrick Steinhardt, Jan 13, 2025
  16. Patrick SteinhardtJan 13, 2025
  17. Junio C HamanoJan 13, 2025
  18. Patrick SteinhardtJan 14, 2025
  19. Junio C HamanoJan 14, 2025
  20. 8/9 meson: fix compilation with Visual StudioPatrick Steinhardt, Jan 13, 2025
  21. M HickfordJan 13, 2025
  22. 9/9 ci: wire up Visual Studio build with MesonPatrick Steinhardt, Jan 13, 2025
  23. 00/11 meson: a couple of additionsPatrick Steinhardt, Jan 22, 2025
  24. 01/11 GIT-VERSION-GEN: simplify computing the dirty markerPatrick Steinhardt, Jan 22, 2025
  25. 02/11 GIT-VERSION-GEN: allow running without input and output filesPatrick Steinhardt, Jan 22, 2025
  26. 03/11 meson: populate project version via GIT-VERSION-GENPatrick Steinhardt, Jan 22, 2025
  27. 04/11 meson: fix dependencies for generated headersPatrick Steinhardt, Jan 22, 2025
  28. 05/11 meson: wire up development environmentsPatrick Steinhardt, Jan 22, 2025
  29. 06/11 meson: wire up generation of distribution archivePatrick Steinhardt, Jan 22, 2025
  30. 07/11 meson: wire up fuzzersPatrick Steinhardt, Jan 22, 2025
  31. 08/11 meson: make the CSPRNG backend configurablePatrick Steinhardt, Jan 22, 2025
  32. 09/11 meson: fix compilation with Visual StudioPatrick Steinhardt, Jan 22, 2025
  33. 10/11 ci: raise error when Meson generates warningsPatrick Steinhardt, Jan 22, 2025
  34. 11/11 ci: wire up Visual Studio build with MesonPatrick Steinhardt, Jan 22, 2025
  35. Junio C HamanoJan 22, 2025

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.