From: darkdragon <darkdragon-001@web.de>
To: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Install-prefix when building should not be hardcoded
Date: Tue, 4 Oct 2022 10:40:24 +0200 [thread overview]
Message-ID: <CAAOCJVD+NHqhwRQnnz-krLfK=_4_Yaa5MhKhVv5GY9-fi4kEqw@mail.gmail.com> (raw)
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:
>
> 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
next prev parent reply other threads:[~2022-10-04 8:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 7:38 Install-prefix when building should not be hardcoded darkdragon
2022-10-04 7:57 ` Đoàn Trần Công Danh
2022-10-04 8:40 ` darkdragon [this message]
2022-10-05 19:34 ` Junio C Hamano
2022-10-05 20:23 ` darkdragon
2022-10-05 21:21 ` Junio C Hamano
2022-10-06 1:32 ` [PATCH] Makefile: clarify runtime relative gitexecdir Đoàn Trần Công Danh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAOCJVD+NHqhwRQnnz-krLfK=_4_Yaa5MhKhVv5GY9-fi4kEqw@mail.gmail.com' \
--to=darkdragon-001@web.de \
--cc=congdanhqx@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).