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

Re: Installing git binaries on a non-default directory (Ubuntu)

From
Jeff King <peff@peff.net>
Date
Apr 23, 2015, 20:17 UTC
Message-ID
<20150423201718.GB28338@peff.net>
In-Reply-To
<0CCD6BBA210ECA418BCD82271FCFD94C556A3CEA@EU-MBX-03.mgc.mentorg.com>
On Mon, Apr 13, 2015 at 11:10:51AM +0000, Macario, Gianpaolo wrote:
> Unfortunately it looks to me that the `--prefix=xxx` option provided
> to configure will be hardcoded to the path returned by 'git
> --exec-path', and I do not see how this may actually be made dependent
> on the directory where the binary tarball will be extracted.

Sorry for the late reply, but I just noticed this and happened to be looking at RUNTIME_PREFIX issues recently.

You're right that no amount of --prefix or other settings can help you with making binaries that are relocatable after the fact. You do need something like RUNTIME_PREFIX, but as you found, it does not work very well on Unix systems.

I do not know if there are other issues, but at least the _first_ issue that must be dealt with is that git_extract_argv0_path may get a bare name like "git", without its PATH. So you will have to compute the full path to the binary in order to find the rest of the files.

There was some minor discussion here:
  http://thread.gmane.org/gmane.comp.version-control.git/267143/focus=267606

(see the notes after the commit message, and the response from Jonathan).

I hope that helps.
-Peff
Previous: Macario, Gianpaolo
Message 4 of 4 in “Installing git binaries on a non-default directory (Ubuntu)”
  1. Gianpaolo MacarioApr 10, 2015
  2. Junio C HamanoApr 13, 2015
  3. Macario, GianpaoloApr 13, 2015
  4. Jeff KingApr 23, 2015

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.