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

Re: [PATCH] t/perf/run: fix bin-wrappers computation

From
Taylor Blau <me@ttaylorr.com>
Date
Sep 21, 2021, 17:50 UTC
Message-ID
<YUobWlgSjZDGYSvK@nand.local>
In-Reply-To
<pull.1044.git.1632239172735.gitgitgadget@gmail.com>
On Tue, Sep 21, 2021 at 03:46:12PM +0000, Derrick Stolee via GitGitGadget wrote:
> This is critical to successfully computing performance of commands that
> execute subcommands. The bin-wrappers ensure that the --exec-path is set
> correctly.

Just sanity-checking everything you said: with this bug, we'll set mydir_abs_wrappers to "/bin-wrappers", then realize that directory doesn't exist, and fall back to GIT_TEST_INSTALLED=$mydir_abs. Putting 'set -x' at the top of t/perf/run, we can see the relevant section:

  + mydir=build/73cd7d9420bb7d75207e8149521db375c789a81c
  + cd build/73cd7d9420bb7d75207e8149521db375c789a81c
  + pwd
  + mydir_abs=/home/ttaylorr/src/git/t/perf/build/73cd7d9420bb7d75207e8149521db375c789a81c
  + mydir_abs_wrappers=/bin-wrappers
  + test -d /bin-wrappers
  + GIT_TEST_INSTALLED=/home/ttaylorr/src/git/t/perf/build/73cd7d9420bb7d75207e8149521db375c789a81c
  + export GIT_TEST_INSTALLED

OK. But the real problem is in t/test-lib.sh where we read "$GIT_TEST_INSTALLED". There we ask for the `--exec-path`, which appears to be wrong, at least in my setup. Printing out the $GIT_EXEC_PATH and $GIT_TEST_INSTALLED, I get:

  /home/ttaylorr/local/git/ds.sparse-checkout/libexec/git-core,
  /home/ttaylorr/src/git/t/perf/build/73cd7d9420bb7d75207e8149521db375c789a81c

where the former is the branch I happen to have checked out, and the latter is the revision that I asked to run performance tests on via t/perf/run.

So I think we'll run the right top-level Git command since the latter path ends up first in our $PATH, but the exec path is definitely wrong.

Show 10 quoted lines
> diff --git a/t/perf/run b/t/perf/run
> index d19dec258a2..55219aa4056 100755
> --- a/t/perf/run
> +++ b/t/perf/run
> @@ -74,7 +74,7 @@ set_git_test_installed () {
>  	mydir=$1
>
>  	mydir_abs=$(cd $mydir && pwd)
> -	mydir_abs_wrappers="$mydir_abs_wrappers/bin-wrappers"
> +	mydir_abs_wrappers="$mydir_abs/bin-wrappers"

This fix looks obviously right to me (and gives me the expected output from above when I apply it locally).

Thanks, Taylor

Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee
Message 2 of 3 in “t/perf/run: fix bin-wrappers computation”
  1. t/perf/run: fix bin-wrappers computationDerrick Stolee via GitGitGadget, Sep 21, 2021
  2. Taylor BlauSep 21, 2021
  3. Derrick StoleeSep 21, 2021

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.