]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/meson-build-perf-bench'
authorJunio C Hamano <gitster@pobox.com>
Mon, 5 May 2025 21:56:24 +0000 (14:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 May 2025 21:56:25 +0000 (14:56 -0700)
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

1  2 
meson.build
t/meson.build
t/perf/perf-lib.sh

diff --cc meson.build
index 14b8109852e3b6a62ea391f7408540d39d9e6e1f,d06f82ff9f030faca651c7b177cdfca73ea05bb0..74b10d1a0ce69abe0009d947f438a38801f146ad
@@@ -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/meson.build
Simple merge
index 39c372844525c32d074d50b8c37a95e822041147,5406557b7ca3e381387f4e9ab10870b74077273e..b15c74d6f15cd434ac1098f6b5398413766f1816
@@@ -25,20 -25,30 +25,44 @@@ TEST_OUTPUT_DIRECTORY=$(pwd
  TEST_NO_CREATE_REPO=t
  TEST_NO_MALLOC_CHECK=t
  
- . ../test-lib.sh
 +# 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
 +      }")"
 +
+ # 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