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

[PATCH v3 07/11] meson: wire up fuzzers

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 22, 2025, 12:05 UTC
Message-ID
<20250122-b4-pks-meson-additions-v3-7-5a51eb5d3dcd@pks.im>
In-Reply-To
<20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im>

Meson does not yet know to build our fuzzers. Introduce a new build option "fuzzers" and wire up the fuzzers in case it is enabled. Adapt our CI jobs so that they build the fuzzers by default.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 ci/run-build-and-tests.sh |  3 ++-
 meson.build               |  4 ++++
 meson_options.txt         |  2 ++
 oss-fuzz/meson.build      | 20 ++++++++++++++++++++
 4 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 76667a1277..6c828c3b75 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -53,7 +53,8 @@ case "$jobname" in
 *-meson)
 	group "Configure" meson setup build . \
 		--warnlevel 2 --werror \
-		--wrap-mode nofallback
+		--wrap-mode nofallback \
+		-Dfuzzers=true
 	group "Build" meson compile -C build --
 	if test -n "$run_tests"
 	then
diff --git a/meson.build b/meson.build
index a59072edf5..052bd80ac4 100644
--- a/meson.build
+++ b/meson.build
@@ -1906,6 +1906,10 @@ if get_option('tests')
   subdir('t')
 endif
 
+if get_option('fuzzers')
+  subdir('oss-fuzz')
+endif
+
 subdir('bin-wrappers')
 if get_option('docs') != []
   subdir('Documentation')
diff --git a/meson_options.txt b/meson_options.txt
index 89b01bad04..34ba679cf9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -95,3 +95,5 @@ option('tests', type: 'boolean', value: true,
   description: 'Enable building tests. This requires Perl, but is separate from the "perl" option such that you can build tests without Perl features enabled.')
 option('test_output_directory', type: 'string',
   description: 'Path to the directory used to store test outputs')
+option('fuzzers', type: 'boolean', value: false,
+  description: 'Enable building fuzzers.')
diff --git a/oss-fuzz/meson.build b/oss-fuzz/meson.build
new file mode 100644
index 0000000000..ed79665501
--- /dev/null
+++ b/oss-fuzz/meson.build
@@ -0,0 +1,20 @@
+fuzz_programs = [
+  'fuzz-commit-graph.c',
+  'fuzz-config.c',
+  'fuzz-credential-from-url-gently.c',
+  'fuzz-date.c',
+  'fuzz-pack-headers.c',
+  'fuzz-pack-idx.c',
+  'fuzz-parse-attr-line.c',
+  'fuzz-url-decode-mem.c',
+]
+
+foreach fuzz_program : fuzz_programs
+  executable(fs.stem(fuzz_program),
+    sources: [
+      'dummy-cmd-main.c',
+      fuzz_program,
+    ],
+    dependencies: [libgit, common_main],
+  )
+endforeach
-- 
2.48.1.321.gbf1f004a4a.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 30 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.