{"thread":{"id":"46973","subject":"Does Git build things during 'make install\"?","startedAt":"2017-10-16T05:05:39Z","lastAt":"2017-10-16T17:14:12Z","messageCount":4,"participants":["Jeffrey Walton","Johannes Sixt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"330441","messageId":"CAH8yC8kx9Td51=UFvLwLAQFPKxUXg0D6KKqWR+JX+-wmTAKYRQ@mail.gmail.com","threadId":"46973","inReplyTo":null,"subject":"Does Git build things during 'make install\"?","fromName":"Jeffrey Walton","fromEmail":"noloader@gmail.com","sentAt":"2017-10-16T05:05:31Z","receivedAt":"2017-10-16T05:05:39Z","isPatch":false,"sender":{"key":"noloader@gmail.com","avatar":null},"body":"My script to build Git dies during cleanup. Cleanup removes the\ndownloaded tarball and the unpacked directory:\n\n********** Cleanup **********\n\nrm: cannot remove 'git-2.14.2/perl/blib/lib/.exists': Permission denied\nrm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Fetcher.pm':\nPermission denied\nrm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Utils.pm': Permission denied\nrm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Ra.pm': Permission denied\nrm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/GlobSpec.pm':\nPermission denied\n...\n\nWhen I look at the permissions:\n\n$ ls -Al git-2.14.2/perl/blib/lib/.exists\n-rw-r--r--   1 root     root           0 Oct 16 00:43\ngit-2.14.2/perl/blib/lib/.exists\n\nThe only place in my script that does anything with privileges is\n'make install' because it runs with sudo.\n\nIs Git building things in the install recipe? If so, then I don't\nbelieve that's supposed to happen. According to the GNU coding\nstandards, Git should not be doing that. Cf;\nhttps://www.gnu.org/prep/standards/html_node/Standard-Targets.html.\n\nJeff\n"},{"id":"330444","messageId":"0ec353db-428c-bb6f-03fe-303487fde197@kdbg.org","threadId":"46973","inReplyTo":"CAH8yC8kx9Td51=UFvLwLAQFPKxUXg0D6KKqWR+JX+-wmTAKYRQ@mail.gmail.com","subject":"Re: Does Git build things during 'make install\"?","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2017-10-16T05:58:05Z","receivedAt":"2017-10-16T05:58:12Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 16.10.2017 um 07:05 schrieb Jeffrey Walton:\n> My script to build Git dies during cleanup. Cleanup removes the\n> downloaded tarball and the unpacked directory:\n> \n> ********** Cleanup **********\n> \n> rm: cannot remove 'git-2.14.2/perl/blib/lib/.exists': Permission denied\n> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Fetcher.pm':\n> Permission denied\n> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Utils.pm': Permission denied\n> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/Ra.pm': Permission denied\n> rm: cannot remove 'git-2.14.2/perl/blib/lib/Git/SVN/GlobSpec.pm':\n> Permission denied\n> ...\n> \n> When I look at the permissions:\n> \n> $ ls -Al git-2.14.2/perl/blib/lib/.exists\n> -rw-r--r--   1 root     root           0 Oct 16 00:43\n> git-2.14.2/perl/blib/lib/.exists\n> \n> The only place in my script that does anything with privileges is\n> 'make install' because it runs with sudo.\n> \n> Is Git building things in the install recipe? If so, then I don't\n> believe that's supposed to happen. According to the GNU coding\n> standards, Git should not be doing that. Cf;\n> https://www.gnu.org/prep/standards/html_node/Standard-Targets.html.\n\nYes, running \"sudo make install\" is a nightmare. sudo clears the path, \nand the git command is not found by the make invoked with root \npermissions. This changes the version string that gets compiled into the \nexecutable, which finally triggers a complete rebuild under root. Sad...\n\n-- Hannes\n"},{"id":"330448","messageId":"xmqq60bfsdpj.fsf@gitster.mtv.corp.google.com","threadId":"46973","inReplyTo":"0ec353db-428c-bb6f-03fe-303487fde197@kdbg.org","subject":"Re: Does Git build things during 'make install\"?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-10-16T08:23:52Z","receivedAt":"2017-10-16T08:24:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Yes, running \"sudo make install\" is a nightmare. sudo clears the path,\n> and the git command is not found by the make invoked with root\n> permissions. This changes the version string that gets compiled into\n> the executable, which finally triggers a complete rebuild under\n> root. Sad...\n\nIn the meantime, would it help to intall as yourself under DESTDIR\nset to where you can write into, and then limit the potential\ndamange done while pretending to be a privileged user to \"cp -R\" (or\n\"tar cf\" in $DESTDIR piped to \"tar xf\" in /)?\n\nIt appears that some dependencies are screwed up around \"perl\"\nrelated things, which may want to get fixed.  I agree that \"make &&\nmake install\" that runs two 'make' under the same environment and\nuser shouldn't (re)build anything during the latter 'make', but we\nsomehow seem to do so.\n"},{"id":"330460","messageId":"446559c7-364a-fb33-905a-74b487900d3b@kdbg.org","threadId":"46973","inReplyTo":"xmqq60bfsdpj.fsf@gitster.mtv.corp.google.com","subject":"Re: Does Git build things during 'make install\"?","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2017-10-16T17:13:42Z","receivedAt":"2017-10-16T17:14:12Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 16.10.2017 um 10:23 schrieb Junio C Hamano:\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n>> Yes, running \"sudo make install\" is a nightmare. sudo clears the path,\n>> and the git command is not found by the make invoked with root\n>> permissions. This changes the version string that gets compiled into\n>> the executable, which finally triggers a complete rebuild under\n>> root. Sad...\n> \n> In the meantime, would it help to intall as yourself under DESTDIR\n> set to where you can write into, and then limit the potential\n> damange done while pretending to be a privileged user to \"cp -R\" (or\n> \"tar cf\" in $DESTDIR piped to \"tar xf\" in /)?\n> \n> It appears that some dependencies are screwed up around \"perl\"\n> related things, which may want to get fixed.  I agree that \"make &&\n> make install\" that runs two 'make' under the same environment and\n> user shouldn't (re)build anything during the latter 'make', but we\n> somehow seem to do so.\n\nWe do so only, if 'make install' does not run in the same environment\nand if there is no version file.\n\nI use the patch below. It works for me, but I could imagine that it\nsuffers from the original problem if there is no git in PATH and there\nis no version file, i.e., when the source is not a release tarball.\n\n----- 8< -----\nSubject: [PATCH] version-gen: Use just built git if no other git is in PATH\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n GIT-VERSION-GEN | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 0e88e23653..b610aa3249 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -3,6 +3,9 @@\n GVF=GIT-VERSION-FILE\n DEF_VER=v2.15.0-rc1\n \n+# use git that was just compiled if there is no git elsewhere in PATH\n+PATH=$PATH:.\n+\n LF='\n '\n \n-- \n2.14.2.808.g3bc32f2729\n"}]}