git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Does Git build things during 'make install"?
@ 2017-10-16  5:05 Jeffrey Walton
  2017-10-16  5:58 ` Johannes Sixt
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffrey Walton @ 2017-10-16  5:05 UTC (permalink / raw)
  To: Git List

My script to build Git dies during cleanup. Cleanup removes the
downloaded tarball and the unpacked directory:

********** Cleanup **********

rm: cannot remove 'git-2.14.2/perl/blib/lib/.exists': Permission denied
rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Fetcher.pm':
Permission denied
rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Utils.pm': Permission denied
rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Ra.pm': Permission denied
rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/GlobSpec.pm':
Permission denied
...

When I look at the permissions:

$ ls -Al git-2.14.2/perl/blib/lib/.exists
-rw-r--r--   1 root     root           0 Oct 16 00:43
git-2.14.2/perl/blib/lib/.exists

The only place in my script that does anything with privileges is
'make install' because it runs with sudo.

Is Git building things in the install recipe? If so, then I don't
believe that's supposed to happen. According to the GNU coding
standards, Git should not be doing that. Cf;
https://www.gnu.org/prep/standards/html_node/Standard-Targets.html.

Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does Git build things during 'make install"?
  2017-10-16  5:05 Does Git build things during 'make install"? Jeffrey Walton
@ 2017-10-16  5:58 ` Johannes Sixt
  2017-10-16  8:23   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2017-10-16  5:58 UTC (permalink / raw)
  To: noloader; +Cc: Git List

Am 16.10.2017 um 07:05 schrieb Jeffrey Walton:
> My script to build Git dies during cleanup. Cleanup removes the
> downloaded tarball and the unpacked directory:
> 
> ********** Cleanup **********
> 
> rm: cannot remove 'git-2.14.2/perl/blib/lib/.exists': Permission denied
> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Fetcher.pm':
> Permission denied
> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Utils.pm': Permission denied
> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Ra.pm': Permission denied
> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/GlobSpec.pm':
> Permission denied
> ...
> 
> When I look at the permissions:
> 
> $ ls -Al git-2.14.2/perl/blib/lib/.exists
> -rw-r--r--   1 root     root           0 Oct 16 00:43
> git-2.14.2/perl/blib/lib/.exists
> 
> The only place in my script that does anything with privileges is
> 'make install' because it runs with sudo.
> 
> Is Git building things in the install recipe? If so, then I don't
> believe that's supposed to happen. According to the GNU coding
> standards, Git should not be doing that. Cf;
> https://www.gnu.org/prep/standards/html_node/Standard-Targets.html.

Yes, running "sudo make install" is a nightmare. sudo clears the path, 
and the git command is not found by the make invoked with root 
permissions. This changes the version string that gets compiled into the 
executable, which finally triggers a complete rebuild under root. Sad...

-- Hannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does Git build things during 'make install"?
  2017-10-16  5:58 ` Johannes Sixt
@ 2017-10-16  8:23   ` Junio C Hamano
  2017-10-16 17:13     ` Johannes Sixt
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2017-10-16  8:23 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: noloader, Git List

Johannes Sixt <j6t@kdbg.org> writes:

> Yes, running "sudo make install" is a nightmare. sudo clears the path,
> and the git command is not found by the make invoked with root
> permissions. This changes the version string that gets compiled into
> the executable, which finally triggers a complete rebuild under
> root. Sad...

In the meantime, would it help to intall as yourself under DESTDIR
set to where you can write into, and then limit the potential
damange done while pretending to be a privileged user to "cp -R" (or
"tar cf" in $DESTDIR piped to "tar xf" in /)?

It appears that some dependencies are screwed up around "perl"
related things, which may want to get fixed.  I agree that "make &&
make install" that runs two 'make' under the same environment and
user shouldn't (re)build anything during the latter 'make', but we
somehow seem to do so.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does Git build things during 'make install"?
  2017-10-16  8:23   ` Junio C Hamano
@ 2017-10-16 17:13     ` Johannes Sixt
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Sixt @ 2017-10-16 17:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: noloader, Git List

Am 16.10.2017 um 10:23 schrieb Junio C Hamano:
> Johannes Sixt <j6t@kdbg.org> writes:
> 
>> Yes, running "sudo make install" is a nightmare. sudo clears the path,
>> and the git command is not found by the make invoked with root
>> permissions. This changes the version string that gets compiled into
>> the executable, which finally triggers a complete rebuild under
>> root. Sad...
> 
> In the meantime, would it help to intall as yourself under DESTDIR
> set to where you can write into, and then limit the potential
> damange done while pretending to be a privileged user to "cp -R" (or
> "tar cf" in $DESTDIR piped to "tar xf" in /)?
> 
> It appears that some dependencies are screwed up around "perl"
> related things, which may want to get fixed.  I agree that "make &&
> make install" that runs two 'make' under the same environment and
> user shouldn't (re)build anything during the latter 'make', but we
> somehow seem to do so.

We do so only, if 'make install' does not run in the same environment
and if there is no version file.

I use the patch below. It works for me, but I could imagine that it
suffers from the original problem if there is no git in PATH and there
is no version file, i.e., when the source is not a release tarball.

----- 8< -----
Subject: [PATCH] version-gen: Use just built git if no other git is in PATH

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 GIT-VERSION-GEN | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 0e88e23653..b610aa3249 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -3,6 +3,9 @@
 GVF=GIT-VERSION-FILE
 DEF_VER=v2.15.0-rc1
 
+# use git that was just compiled if there is no git elsewhere in PATH
+PATH=$PATH:.
+
 LF='
 '
 
-- 
2.14.2.808.g3bc32f2729

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-16 17:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16  5:05 Does Git build things during 'make install"? Jeffrey Walton
2017-10-16  5:58 ` Johannes Sixt
2017-10-16  8:23   ` Junio C Hamano
2017-10-16 17:13     ` Johannes Sixt

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).