meson: wire up benchmarking options

Wire up a couple of benchmarking options that we end up writing into our "GIT-BUILD-OPTIONS" file. These options allow users to control how exactly benchmarks are executed. Note that neither `GIT_PERF_MAKE_COMMAND` nor `GIT_PERF_MAKE_OPTS` are exposed as a build option. Those options are used by "t/perf/run", which is not used by Meson. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Apr 28, 2025 at 09:30 UTC c3fc5c68f65fdd50d94672267cf2be77d96cfcf7
2 files changed +9 -3
meson.build
+3 -3
@@ -706,11 +706,11 @@ builtin_sources += custom_target(
706 # build options to our tests.
707 build_options_config = configuration_data()
708 build_options_config.set('GIT_INTEROP_MAKE_OPTS', '')
709 -build_options_config.set('GIT_PERF_LARGE_REPO', '')
709 +build_options_config.set_quoted('GIT_PERF_LARGE_REPO', get_option('benchmark_large_repo'))
710 build_options_config.set('GIT_PERF_MAKE_COMMAND', '')
711 build_options_config.set('GIT_PERF_MAKE_OPTS', '')
712 -build_options_config.set('GIT_PERF_REPEAT_COUNT', '')
713 -build_options_config.set('GIT_PERF_REPO', '')
712 +build_options_config.set_quoted('GIT_PERF_REPEAT_COUNT', get_option('benchmark_repeat_count').to_string())
713 +build_options_config.set_quoted('GIT_PERF_REPO', get_option('benchmark_repo'))
714 build_options_config.set('GIT_TEST_CMP_USE_COPIED_CONTEXT', '')
715 build_options_config.set('GIT_TEST_INDEX_VERSION', '')
716 build_options_config.set('GIT_TEST_OPTS', '')
meson_options.txt
+6
@@ -103,6 +103,12 @@ option('docs_backend', type: 'combo', choices: ['asciidoc', 'asciidoctor', 'auto
103 # Testing.
104 option('benchmarks', type: 'feature', value: 'auto',
105 description: 'Enable benchmarks. This requires Perl and GNU time.')
106 +option('benchmark_repo', type: 'string', value: '',
107 + description: 'Repository to copy for the performance tests. Should be at least the size of the Git repository.')
108 +option('benchmark_large_repo', type: 'string', value: '',
109 + description: 'Large repository to copy for the performance tests. Should be at least the size of the Linux repository.')
110 +option('benchmark_repeat_count', type: 'integer', value: 3,
111 + description: 'Number of times a test should be repeated for best-of-N measurements.')
112 option('coccinelle', type: 'feature', value: 'auto',
113 description: 'Provide a coccicheck target that generates a Coccinelle patch.')
114 option('tests', type: 'boolean', value: true,