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

Re: [PATCH v3 06/20] t: introduce PERL_TEST_HELPERS prerequisite

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 1, 2025, 18:26 UTC
Message-ID
<ee5e082f-6ab5-b996-9a0d-f7e5192c01be@gmx.de>
In-Reply-To
<20250327-b4-pks-t-perlless-v3-6-b436de9da1b8@pks.im>
Hi Patrick,
On Thu, 27 Mar 2025, Patrick Steinhardt wrote:
Show 11 quoted lines
> In the early days of Git, Perl was used quite prominently throughout the
> project. This has changed significantly as almost all of the executables
> we ship nowadays have eventually been rewritten in C. Only a handful of
> subsystems remain that require Perl:
>
>   - gitweb, a read-only web interface.
>
>   - A couple of scripts that allow importing repositories from GNU Arch,
>     CVS and Subversion.
>
>   - git-send-email(1), which can be used to send mails.

There is also `git request-pull` which is a _shell_ script that runs `perl` to parse the output of `ls-remote`, and there is `git filter-branch` (which was apparently not yet dropped?) that uses Perl if the `--state-branch` option is in use.

Show 33 quoted lines
>   - Our Perl bindings for Git.
>
>   - The netrc Git credential helper.
>
> None of these subsystems can really be considered to be part of the
> "core" of Git, and an installation without them is fully functional.
> It is more likely than not that an end user wouldn't even notice that
> any features are missing if those tools weren't installed. But while
> Perl nowadays very much is an optional dependency of Git, there is a
> significant limitation when Perl isn't available: developers cannot run
> our test suite.
>
> Preceding commits have started to lift this restriction by removing the
> strict dependency on Perl in many central parts of the test library. But
> there are still many tests that rely on small Perl helpers to do various
> different things.
>
> Introduce a new PERL_TEST_HELPERS prerequisite that guards all tests
> that require Perl. This prerequisite is explicitly different than the
> preexisting PERL prerequisite:
>
>   - PERL records whether or not features depending on the Perl
>     interpreter are built.
>
>   - PERL_TEST_HELPERS records whether or not a Perl interpreter is
>     available for our tests.
>
> By having these two separate prerequisites we can thus distinguish
> between tests that inherently depend on Perl because the underlying
> feature does, and those tests that depend on Perl because the test
> itself is using Perl.
>
> Adapt all tests to set the PERL_TEST_HELPERS prerequisite as needed.

The patch looks good, in particular when fetching the `b4/pks-t-perlless` branch from https://gitlab.com/gitlab-org/git and inspecting 8fc639f99d9f manually, as it is a rather large patch that is pretty much unreviewable on a mailing list.

Using several write-only `sed` invocations, I identified that there are only three hunks that are neither adding a stand-alone `PERL_TEST_HELPERS` prereq nor adding a test preamble of this form:

	if ! test_have_prereq PERL_TEST_HELPERS
	then
		skip_all='skipping <something>; Perl not available'
		test_done
	fi
Skipping to only the affected files, these three instances are:
Show 13 quoted lines
> diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
> index c91a62b77af..342d0423c92 100755
> --- a/t/t5534-push-signed.sh
> +++ b/t/t5534-push-signed.sh
> @@ -177,7 +177,7 @@ test_expect_success GPGSSH 'ssh signed push sends push certificate' '
>  	test_cmp expect dst/push-cert-status
>  '
>
> -test_expect_success GPG 'inconsistent push options in signed push not allowed' '
> +test_expect_success GPG,PERL_TEST_HELPERS 'inconsistent push options in signed push not allowed' '
>  	# First, invoke receive-pack with dummy input to obtain its preamble.
>  	prepare_dst &&
>  	git -C dst config receive.certnonceseed sekrit &&
Here, that prereq is appended.
Show 22 quoted lines
> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> index d0c18660e33..d743d986c40 100755
> --- a/t/t5601-clone.sh
> +++ b/t/t5601-clone.sh
> @@ -649,7 +649,7 @@ test_expect_success 'GIT_TRACE_PACKFILE produces a usable pack' '
>  	git -C replay.git index-pack -v --stdin <tmp.pack
>  '
>
> -test_expect_success 'clone on case-insensitive fs' '
> +test_expect_success PERL_TEST_HELPERS 'clone on case-insensitive fs' '
>  	git init icasefs &&
>  	(
>  		cd icasefs &&
> @@ -662,7 +662,7 @@ test_expect_success 'clone on case-insensitive fs' '
>  	)
>  '
>
> -test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
> +test_expect_success PERL_TEST_HELPERS,CASE_INSENSITIVE_FS 'colliding file detection' '
>  	grep X icasefs/warning &&
>  	grep x icasefs/warning &&
>  	test_grep "the following paths have collided" icasefs/warning
Here, too.
Show 12 quoted lines
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index a62699d6c79..59162a3c834 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -1706,6 +1706,7 @@ test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
>  test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
>  test -n "$SANITIZE_LEAK" && test_set_prereq SANITIZE_LEAK
>  test -n "$GIT_VALGRIND_ENABLED" && test_set_prereq VALGRIND
> +test -n "$PERL_PATH" && test_set_prereq PERL_TEST_HELPERS
>
>  if test -z "$GIT_TEST_CHECK_CACHE_TREE"
>  then
And this is obviously correct, too.

Thank you, Johannes

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 69 of 125 in “t: drop Perl as a mandatory prerequisite”
  1. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Mar 20, 2025
  2. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Mar 20, 2025
  3. Eric SunshineMar 20, 2025
  4. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Mar 20, 2025
  5. Karthik NayakMar 21, 2025
  6. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Mar 20, 2025
  7. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Mar 20, 2025
  8. Karthik NayakMar 21, 2025
  9. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Mar 20, 2025
  10. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Mar 20, 2025
  11. Eric SunshineMar 20, 2025
  12. Patrick SteinhardtMar 24, 2025
  13. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Mar 20, 2025
  14. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Mar 20, 2025
  15. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Mar 20, 2025
  16. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Mar 20, 2025
  17. Phillip WoodMar 24, 2025
  18. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Mar 20, 2025
  19. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Mar 20, 2025
  20. Eric SunshineMar 20, 2025
  21. Patrick SteinhardtMar 24, 2025
  22. Eric SunshineMar 24, 2025
  23. Patrick SteinhardtMar 25, 2025
  24. Phillip WoodMar 24, 2025
  25. Patrick SteinhardtMar 25, 2025
  26. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Mar 20, 2025
  27. Eric SunshineMar 20, 2025
  28. Patrick SteinhardtMar 24, 2025
  29. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  30. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  31. Eric SunshineMar 20, 2025
  32. Patrick SteinhardtMar 24, 2025
  33. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  34. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  35. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Mar 20, 2025
  36. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  37. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  38. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Mar 25, 2025
  39. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Mar 25, 2025
  40. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Mar 25, 2025
  41. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Mar 25, 2025
  42. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Mar 25, 2025
  43. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Mar 25, 2025
  44. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Mar 25, 2025
  45. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Mar 25, 2025
  46. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Mar 25, 2025
  47. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Mar 25, 2025
  48. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Mar 25, 2025
  49. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Mar 25, 2025
  50. Phillip WoodMar 25, 2025
  51. Patrick SteinhardtMar 27, 2025
  52. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Mar 25, 2025
  53. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Mar 25, 2025
  54. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  55. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  56. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  57. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  58. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Mar 25, 2025
  59. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  60. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  61. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Mar 27, 2025
  62. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Mar 27, 2025
  63. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Mar 27, 2025
  64. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Mar 27, 2025
  65. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Mar 27, 2025
  66. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Mar 27, 2025
  67. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Mar 27, 2025
  68. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Mar 27, 2025
  69. Johannes SchindelinApr 1, 2025
  70. Patrick SteinhardtApr 2, 2025
  71. Johannes SchindelinApr 2, 2025
  72. Patrick SteinhardtApr 3, 2025
  73. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Mar 27, 2025
  74. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Mar 27, 2025
  75. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Mar 27, 2025
  76. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Mar 27, 2025
  77. Johannes SchindelinApr 1, 2025
  78. Patrick SteinhardtApr 2, 2025
  79. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Mar 27, 2025
  80. Johannes SchindelinApr 1, 2025
  81. Patrick SteinhardtApr 2, 2025
  82. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Mar 27, 2025
  83. Johannes SchindelinApr 1, 2025
  84. Patrick SteinhardtApr 2, 2025
  85. Johannes SchindelinApr 2, 2025
  86. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  87. Johannes SchindelinApr 1, 2025
  88. Patrick SteinhardtApr 2, 2025
  89. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  90. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  91. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  92. Johannes SchindelinApr 1, 2025
  93. Patrick SteinhardtApr 2, 2025
  94. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Mar 27, 2025
  95. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  96. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  97. Phillip WoodMar 28, 2025
  98. Johannes SchindelinApr 2, 2025
  99. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Apr 3, 2025
  100. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Apr 3, 2025
  101. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Apr 3, 2025
  102. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Apr 3, 2025
  103. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Apr 3, 2025
  104. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Apr 3, 2025
  105. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Apr 3, 2025
  106. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Apr 3, 2025
  107. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Apr 3, 2025
  108. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Apr 3, 2025
  109. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Apr 3, 2025
  110. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Apr 3, 2025
  111. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Apr 3, 2025
  112. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  113. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Apr 3, 2025
  114. SZEDER GáborJun 10, 2025
  115. Junio C HamanoJun 10, 2025
  116. Patrick SteinhardtJul 7, 2025
  117. Junio C HamanoJun 10, 2025
  118. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  119. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  120. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  121. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Apr 3, 2025
  122. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  123. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  124. Johannes SchindelinApr 3, 2025
  125. Junio C HamanoApr 8, 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.