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

Re: Git 2.18: RUNTIME_PREFIX... is it working?

From
Daniel Jacques <dnj@google.com>
Date
Jul 10, 2018, 14:03 UTC
Message-ID
<CAD1RUU8pT-3GKN4qRjysi+re+AKF4eB+VEDr+GzMW_4=E4uftQ@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1807101339370.75@tvgsbejvaqbjf.bet>
Perry Hutchison wrote:
Show 5 quoted lines
> If we need /proc, wouldn't we _already_ be unhappy inside a chroot
> that didn't mount /proc, even _with_ fallback to static paths?
> Last I knew, the whole point of chroots/containers/jails/etc. was to
> prevent access, from a process running inside the container, to any
> part of the FS that's outside of the container.

Yep. The code also allows for use of "argv[0]", but that has its own set of problems. These were previously covered in the discussions leading up to the patch landing, but to summarize, "argv[0]" can be completely manipulated by the calling process, whimsically or in response to constraints such as links, and is wholly unreliable for self-location.

Other kernels have their own behaviors with respect to path self-location, and none seem to be straightforward. This link seems to have a good rundown of the details and differences:

https://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe

All things considered, I think executable path self-location is markedly more fragile than using static paths, both with increased dependencies and added inconsistent behavior and limitations, and should not be the default on any platform.

Both Johannes' original RUNTIME_PREFIX implementation for Windows and the Linux/etc. expansions that I did were written to serve constrained special case deployments. In that capacity, they can be really useful, as the fragility is managed by their respective environments.

My particular use case served the purpose of building Git once and deploying it via archive on other systems. This capability requires the additional work of building portable versions of Git's dependencies and their associated resources, and statically linking everything together.

This is a lot more portability than the conventional user requires, and also necessitates a significantly more complex build process. However, making Git itself portable via RUNTIME_PREFIX without similar work on its dependencies limits the usefulness of that portability, since it's still bound to the system's libraries and their resources.

Cheers, -Dan

Previous: Johannes SchindelinNext: Junio C Hamano
Message 12 of 24 in “Git 2.18: RUNTIME_PREFIX... is it working?”
  1. Paul SmithJul 4, 2018
  2. Johannes SchindelinJul 4, 2018
  3. Paul SmithJul 5, 2018
  4. Johannes SchindelinJul 6, 2018
  5. Daniel JacquesJul 6, 2018
  6. Paul SmithJul 8, 2018
  7. Johannes SchindelinJul 8, 2018
  8. Jeff KingJul 9, 2018
  9. Johannes SchindelinJul 9, 2018
  10. Jeff KingJul 10, 2018
  11. Johannes SchindelinJul 10, 2018
  12. Daniel JacquesJul 10, 2018
  13. Junio C HamanoJul 10, 2018
  14. Junio C HamanoJul 9, 2018
  15. Jeff KingJul 10, 2018
  16. Perry HutchisonJul 10, 2018
  17. Jeff KingJul 10, 2018
  18. Jonathan NiederJul 10, 2018
  19. Jonathan NiederJul 10, 2018
  20. Johannes SchindelinJul 17, 2018
  21. brian m. carlsonJul 14, 2018
  22. Johannes SchindelinJul 18, 2018
  23. brian m. carlsonJul 19, 2018
  24. Jeff HostetlerJul 20, 2018

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.