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

Re: [PATCH 1/3] t/lib-httpd: dynamically detect httpd and modules path

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 8, 2023, 10:42 UTC
Message-ID
<ZUtmAyVHO4ROhLEq@tanuki>
In-Reply-To
<xmqqcywk7k0d.fsf@gitster.g>
On Wed, Nov 08, 2023 at 04:59:46PM +0900, Junio C Hamano wrote:
Show 30 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > In order to set up the Apache httpd server, we need to locate both the
> > httpd binary and its default module path. This is done with a hardcoded
> > list of locations that we scan. While this works okayish with distros
> > that more-or-less follow the Filesystem Hierarchy Standard, it falls
> > apart on others like NixOS that don't.
> >
> > While it is possible to specify these paths via `LIB_HTTPD_PATH` and
> > `LIB_HTTPD_MODULE_PATH`, it is not a nice experience for the developer
> > to figure out how to set those up. And in fact we can do better by
> > dynamically detecting both httpd and its module path at runtime:
> >
> >     - The httpd binary can be located via PATH.
> >
> >     - 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.
> 
> Hmph.
> 
> I do not think we would want to punish the distros that follow the
> FHS that was created explicitly to help developers by standardizing
> locations of various things, with an approach this patch takes that
> throws everthing with bathwater and rely on $PATH first.
> 
> Would it be sufficient to please NixOS if we simply append $(command
> -v apache) or whatever after the well known candidate locations?

I was a bit torn myself when writing this. I can also see a potential future where we would drop the hardcoded list of locations altogether in favor of always using PATH. After all we already rely on PATH to resolve other tools as well, so why should httpd be special there?

But in the end I opted to use the more conservative approach of using both PATH and the static list as I didn't want to break other distros. I don't mind to make this even more conservative and resolve via PATH as a last resort, only.

Patrick
Show 7 quoted lines
> I know "command -v" is in POSIX, and on both bash and dash (the two
> shells most distros use), it works as this patch expects, but its
> portability is also a bit worrysome, especially because the whole
> point of this patch is to support a platform that is, eh, on the
> fringe.
> 
> So, I dunno.
Previous: Junio C HamanoNext: Jeff King
Message 4 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.