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

Re: [PATCH v2 3/5] t/perf: fix benchmarks with out-of-tree builds

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 22, 2025, 06:51 UTC
Message-ID
<aAc8f52rJ8ATncVc@pks.im>
In-Reply-To
<CAP8UFD3HcAVs351sabU2qd70PmMzTtGbS7P7eKYyDyUQZ4nQ2Q@mail.gmail.com>
On Sun, Apr 20, 2025 at 12:00:08PM +0200, Christian Couder wrote:
Show 29 quoted lines
> On Mon, Apr 14, 2025 at 8:51 AM Patrick Steinhardt <ps@pks.im> wrote:
> 
> > --- a/t/perf/perf-lib.sh
> > +++ b/t/perf/perf-lib.sh
> > @@ -25,7 +25,29 @@ TEST_OUTPUT_DIRECTORY=$(pwd)
> >  TEST_NO_CREATE_REPO=t
> >  TEST_NO_MALLOC_CHECK=t
> >
> > -. ../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/..}"
> 
> Right now on 'master' there is:
> 
> GIT_BUILD_DIR="${GIT_BUILD_DIR:-${TEST_DIRECTORY%/t}}"
> if test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR"
> then
>        echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2
>        exit 1
> fi
> 
> so it's not exactly the same thing, even if it still probably works well.
> 
> Future readers might wonder if this discrepancy results from changes
> that were made to only one of the files or if we really wanted to get
> rid of the "/t" check here. In case we do want to get rid of the "/t"
> check, I think it might be worth saying it clearly in the comment.

The "/.." is intentional here due to the way that `TEST_DIRECTORY` is constructed. If you extend the context of this patch a bit, you can see that `TEST_DIRECTORY=$(pwd)/..`. So stripping "/t" from the suffix wouldn't do anything because it never has that suffix in the first place. And neither do we want to strip "/..", because then we'd end up in "t/perf". So the easiest fix is to just append another "/.." to end up where we want to.

I'll try to paraphrase this in the commit message.
Show 19 quoted lines
> > +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?).'
> 
> Maybe something like the following could help debug this:
> 
>        echo >&2 "error: GIT-BUILD-OPTIONS file missing from '$GIT_BUILD_DIR'"
>        echo >&2 'error: (has Git been built?).'

I'd rather want to keep this as-is for now as we have the same error message in "test-lib.sh". If we want to change it we should change both errors, but that feels outside of the scope of this patch series.

Patrick
Previous: Christian CouderNext: Patrick Steinhardt
Message 22 of 62 in “meson: wire up support for benchmarks”
  1. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Mar 31, 2025
  2. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Mar 31, 2025
  3. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Mar 31, 2025
  4. Toon ClaesApr 10, 2025
  5. Patrick SteinhardtApr 14, 2025
  6. Junio C HamanoApr 14, 2025
  7. Patrick SteinhardtApr 15, 2025
  8. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Mar 31, 2025
  9. Toon ClaesApr 10, 2025
  10. Toon ClaesApr 14, 2025
  11. Patrick SteinhardtApr 14, 2025
  12. 4/5 meson: wire up benchmarksPatrick Steinhardt, Mar 31, 2025
  13. Toon ClaesApr 10, 2025
  14. Patrick SteinhardtApr 14, 2025
  15. Toon ClaesApr 14, 2025
  16. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Mar 31, 2025
  17. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 14, 2025
  18. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 14, 2025
  19. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 14, 2025
  20. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 14, 2025
  21. Christian CouderApr 20, 2025
  22. Patrick SteinhardtApr 22, 2025
  23. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 14, 2025
  24. Christian CouderApr 20, 2025
  25. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 14, 2025
  26. Junio C HamanoApr 15, 2025
  27. Junio C HamanoApr 15, 2025
  28. Patrick SteinhardtApr 16, 2025
  29. Junio C HamanoApr 18, 2025
  30. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 22, 2025
  31. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 22, 2025
  32. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 22, 2025
  33. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 22, 2025
  34. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 22, 2025
  35. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 22, 2025
  36. Christian CouderApr 22, 2025
  37. Patrick SteinhardtApr 22, 2025
  38. Christian CouderApr 23, 2025
  39. Patrick SteinhardtApr 24, 2025
  40. Christian CouderApr 24, 2025
  41. Junio C HamanoApr 24, 2025
  42. Patrick SteinhardtApr 24, 2025
  43. Toon ClaesApr 23, 2025
  44. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 25, 2025
  45. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 25, 2025
  46. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 25, 2025
  47. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 25, 2025
  48. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 25, 2025
  49. Christian CouderApr 25, 2025
  50. Patrick SteinhardtApr 25, 2025
  51. Christian CouderApr 25, 2025
  52. Patrick SteinhardtApr 25, 2025
  53. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 25, 2025
  54. Christian CouderApr 25, 2025
  55. Patrick SteinhardtApr 25, 2025
  56. Christian CouderApr 25, 2025
  57. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 28, 2025
  58. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 28, 2025
  59. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 28, 2025
  60. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 28, 2025
  61. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 28, 2025
  62. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 28, 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.