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

Re: Install-prefix when building should not be hardcoded

From
Ddarkdragon <darkdragon-001@web.de>
Date
Oct 4, 2022, 08:40 UTC
Message-ID
<CAAOCJVD+NHqhwRQnnz-krLfK=_4_Yaa5MhKhVv5GY9-fi4kEqw@mail.gmail.com>
In-Reply-To
<YzvnadnAYce0dIpi@danh.dev>
Thanks for the hint to DESTDIR, it helps!

Nevertheless, I would like to point towards the following section in the [MAKEFILE][1]: ```Makefile # Among the variables below, these: # gitexecdir # ... # can be specified as a relative path some/where/else; # this is interpreted as relative to $(prefix) and "git" at # runtime figures out where they are based on the path to the executable. # ... # This can help installing the suite in a relocatable way. # ... gitexecdir = libexec/git-core ```

[1]: https://github.com/git/git/blob/master/Makefile#L525-L547
On Tue, Oct 4, 2022 at 9:57 AM Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:
Show 26 quoted lines
>
> On 2022-10-04 09:38:24+0200, darkdragon <darkdragon-001@web.de> wrote:
> > Even though in Makefile, it is stated that git will figure out
> > gitexecdir at runtime based on the path to the executable, there are
> > many output files where $(prefix) will be hardcoded. Even git
> > --exec-path will print out $(compile_prefix)/libexec/git-core instead
> > of using run_prefix.
>
> I'm not sure about this part.
>
> > Example: We are building git in Docker at a separate stage to /deploy
> > (since /usr/local is populated with our compiler toolchain). The final
> > image is assembled by copying the contents of /deploy to /usr/local.
> > Commands like "git submodule" will fail because of the wrong git exec
> > path. Searching via "grep -r /deploy" in /deploy after make install
> > yields many results.
>
> But you may be interested in $(DESTDIR)
>
>         make prefix=/usr/local all
>         make prefix=/usr/local DESTDIR=/deploy install
>
> Does that work for you?
>
> --
> Danh
Previous: Đoàn Trần Công DanhNext: Junio C Hamano
Message 3 of 7 in “Install-prefix when building should not be hardcoded”
  1. darkdragonOct 4, 2022
  2. Đoàn Trần Công DanhOct 4, 2022
  3. darkdragonOct 4, 2022
  4. Junio C HamanoOct 5, 2022
  5. darkdragonOct 5, 2022
  6. Junio C HamanoOct 5, 2022
  7. Makefile: clarify runtime relative gitexecdirĐoàn Trần Công Danh, Oct 6, 2022

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.