From: Junio C Hamano Date: Mon, 5 May 2025 21:56:24 +0000 (-0700) Subject: Merge branch 'ps/meson-build-perf-bench' X-Git-Tag: v2.50.0-rc0~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc14ba68d744b7d5db03419e15c7047cc19bf559;p=thirdparty%2Fgit.git Merge branch 'ps/meson-build-perf-bench' The build procedure based on Meson learned to drive the benchmarking tests. * ps/meson-build-perf-bench: meson: wire up benchmarking options meson: wire up benchmarks t/perf: fix benchmarks with out-of-tree builds t/perf: use configured PERL_PATH t/perf: fix benchmarks with alternate repo formats --- cc14ba68d744b7d5db03419e15c7047cc19bf559 diff --cc meson.build index 14b8109852,d06f82ff9f..74b10d1a0c --- a/meson.build +++ b/meson.build @@@ -836,7 -843,7 +843,7 @@@ endi # features. It is optional if you want to neither execute tests nor use any of # these optional features. perl_required = get_option('perl') - if get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') -if get_option('benchmarks').enabled() or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != [] ++if get_option('benchmarks').enabled() or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') perl_required = true endif diff --cc t/perf/perf-lib.sh index 39c3728445,5406557b7c..b15c74d6f1 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@@ -25,20 -25,30 +25,44 @@@ TEST_OUTPUT_DIRECTORY=$(pwd TEST_NO_CREATE_REPO=t TEST_NO_MALLOC_CHECK=t +# GIT-BUILD-OPTIONS, sourced by test-lib.sh, overwrites the `GIT_PERF_*` +# values that are set by the user (if any). Let's stash them away as +# `eval`-able assignments. +git_perf_settings="$(env | + sed -n "/^GIT_PERF_/{ + # escape all single-quotes in the value + s/'/'\\\\''/g + # turn this into an eval-able assignment + s/^\\([^=]*=\\)\\(.*\\)/\\1'\\2'/p + }")" + - . ../test-lib.sh + # While test-lib.sh computes the build directory for us, we also have to do the + # same thing in order to locate the script via GIT-BUILD-OPTIONS in the first + # place. + GIT_BUILD_DIR="${GIT_BUILD_DIR:-$TEST_DIRECTORY/..}" + if test -f "$GIT_BUILD_DIR/GIT-BUILD-DIR" + then + GIT_BUILD_DIR="$(cat "$GIT_BUILD_DIR/GIT-BUILD-DIR")" || exit 1 + # On Windows, we must convert Windows paths lest they contain a colon + case "$(uname -s)" in + *MINGW*) + GIT_BUILD_DIR="$(cygpath -au "$GIT_BUILD_DIR")" + ;; + esac + fi + + if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS + then + echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).' + exit 1 + fi + + . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS + . "$GIT_SOURCE_DIR"/t/test-lib.sh + ++# Then restore GIT_PERF_* settings. +eval "$git_perf_settings" + unset GIT_CONFIG_NOSYSTEM GIT_CONFIG_SYSTEM="$TEST_DIRECTORY/perf/config" export GIT_CONFIG_SYSTEM