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

[PATCH v2 0/3] t: improve compatibility with NixOS

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 8, 2023, 14:57 UTC
Message-ID
<cover.1699455383.git.ps@pks.im>
In-Reply-To
<cover.1699428122.git.ps@pks.im>
Hi,

this is the second version of my patch series to improve compatibility of our tests with NixOS.

There's only a single change compared to v1. As suggested by Junio, we now use the executable discovered via PATH and the modules detected via `HTTPD_ROOT` as fallback values if none of our hardcoded paths were detected. This should further ensure that the refactoring doesn't cause any issues on platforms that follow the FHS more closely than NixOS does. It also has the benefit that the change is now a lot more straight forward.

Patrick
Patrick Steinhardt (3):
  t/lib-httpd: dynamically detect httpd and modules path
  t/lib-httpd: stop using legacy crypt(3) for authentication
  t9164: fix inability to find basename(1) in hooks
 t/lib-httpd.sh                        | 10 ++++++++--
 t/lib-httpd/passwd                    |  2 +-
 t/lib-httpd/proxy-passwd              |  2 +-
 t/t9164-git-svn-dcommit-concurrent.sh | 12 +++++++++---
 4 files changed, 19 insertions(+), 7 deletions(-)
Range-diff against v1:
1:  ac059db8fed ! 1:  cee8fbebf84 t/lib-httpd: dynamically detect httpd and modules path
    @@ Commit message
             - The module directory can (in many cases) be derived via the
               `HTTPD_ROOT` compile-time variable.
     
    -    Refactor the code to do so. If runtime detection of the paths fails we
    -    continue to fall back to the hardcoded list of paths.
    +    Amend the code to do so. The new runtime-detected paths will only be
    +    used in case none of the hardcoded paths are usable.
     
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
    @@ t/lib-httpd.sh: fi
      HTTPD_PARA=""
      
     -for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
    --do
    --	if test -x "$DEFAULT_HTTPD_PATH"
    --	then
    --		break
    --	fi
    --done
    --
    --for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
    --				 '/usr/lib/apache2/modules' \
    --				 '/usr/lib64/httpd/modules' \
    --				 '/usr/lib/httpd/modules' \
    --				 '/usr/libexec/httpd'
    --do
    --	if test -d "$DEFAULT_HTTPD_MODULE_PATH"
    -+DEFAULT_HTTPD_PATH="$(command -v httpd)"
    -+if test -z "$DEFAULT_HTTPD_PATH" -o ! -x "$DEFAULT_HTTPD_PATH"
    -+then
    -+	for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
    -+	do
    -+		if test -x "$DEFAULT_HTTPD_PATH"
    -+		then
    -+			break
    -+		fi
    -+	done
    -+fi
    -+
    -+if test -x "$DEFAULT_HTTPD_PATH"
    -+then
    -+	HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')"
    -+	if test -n "$HTTPD_ROOT" -a -d "$HTTPD_ROOT/modules"
    ++for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2' "$(command -v httpd)"
    + do
    + 	if test -x "$DEFAULT_HTTPD_PATH"
      	then
    --		break
    -+		DEFAULT_HTTPD_MODULE_PATH="$HTTPD_ROOT/modules"
    +@@ t/lib-httpd.sh: do
      	fi
    --done
    -+	unset HTTPD_ROOT
    -+fi
    -+
    -+if test -z "$DEFAULT_HTTPD_MODULE_PATH" -o ! -d "$DEFAULT_HTTPD_MODULE_PATH"
    + done
    + 
    ++if test -x "$DEFAULT_HTTPD_PATH"
     +then
    -+	for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
    -+					 '/usr/lib/apache2/modules' \
    -+					 '/usr/lib64/httpd/modules' \
    -+					 '/usr/lib/httpd/modules' \
    -+					 '/usr/libexec/httpd'
    -+	do
    -+		if test -d "$DEFAULT_HTTPD_MODULE_PATH"
    -+		then
    -+			break
    -+		fi
    -+	done
    ++	DETECTED_HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')"
     +fi
    - 
    - case $(uname) in
    - 	Darwin)
    ++
    + for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
    + 				 '/usr/lib/apache2/modules' \
    + 				 '/usr/lib64/httpd/modules' \
    + 				 '/usr/lib/httpd/modules' \
    +-				 '/usr/libexec/httpd'
    ++				 '/usr/libexec/httpd' \
    ++				 "${DETECTED_HTTPD_ROOT:+${DETECTED_HTTPD_ROOT}/modules}"
    + do
    + 	if test -d "$DEFAULT_HTTPD_MODULE_PATH"
    + 	then
2:  23835763002 = 2:  f4c6c754f1e t/lib-httpd: stop using legacy crypt(3) for authentication
3:  b50e625f967 = 3:  361f1bd9c88 t9164: fix inability to find basename(1) in hooks
base-commit: 98009afd24e2304bf923a64750340423473809ff
-- 
2.42.0
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 9 of 41 in “t: improve compatibility with NixOS”
  1. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 8, 2023
  2. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 8, 2023
  3. Junio C HamanoNov 8, 2023
  4. Patrick SteinhardtNov 8, 2023
  5. Jeff KingNov 8, 2023
  6. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 8, 2023
  7. Junio C HamanoNov 8, 2023
  8. 3/3 t9164: fix inability to find basename(1) in hooksPatrick Steinhardt, Nov 8, 2023
  9. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 8, 2023
  10. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 8, 2023
  11. Jeff KingNov 8, 2023
  12. Junio C HamanoNov 9, 2023
  13. Patrick SteinhardtNov 9, 2023
  14. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 8, 2023
  15. Jeff KingNov 8, 2023
  16. 3/3 t9164: fix inability to find basename(1) in hooksPatrick Steinhardt, Nov 8, 2023
  17. Jeff KingNov 8, 2023
  18. Junio C HamanoNov 8, 2023
  19. Patrick SteinhardtNov 9, 2023
  20. Patrick SteinhardtNov 9, 2023
  21. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 9, 2023
  22. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 9, 2023
  23. Jeff KingNov 9, 2023
  24. Patrick SteinhardtNov 9, 2023
  25. Junio C HamanoNov 9, 2023
  26. Patrick SteinhardtNov 9, 2023
  27. Jeff KingNov 9, 2023
  28. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 9, 2023
  29. 3/3 t9164: fix inability to find basename(1) in Subversion hooksPatrick Steinhardt, Nov 9, 2023
  30. Jeff KingNov 9, 2023
  31. Jeff KingNov 9, 2023
  32. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 10, 2023
  33. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 10, 2023
  34. Junio C HamanoNov 11, 2023
  35. Patrick SteinhardtNov 13, 2023
  36. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 10, 2023
  37. 3/3 t9164: fix inability to find basename(1) in Subversion hooksPatrick Steinhardt, Nov 10, 2023
  38. Jeff KingNov 10, 2023
  39. Junio C HamanoNov 11, 2023
  40. Patrick SteinhardtNov 13, 2023
  41. Junio C HamanoNov 13, 2023

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.