{"thread":{"id":"6939","subject":"Problems installing as root","startedAt":"2007-02-24T15:28:56Z","lastAt":"2007-02-26T02:10:53Z","messageCount":11,"participants":["walt","Shawn O. Pearce","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"35398","messageId":"erpljl$ln9$1@sea.gmane.org","threadId":"6939","inReplyTo":null,"subject":"Problems installing as root","fromName":"walt","fromEmail":"wa1ter@myrealbox.com","sentAt":"2007-02-24T15:28:56Z","receivedAt":"2007-02-24T15:28:56Z","isPatch":false,"sender":{"key":"wa1ter@myrealbox.com","avatar":null},"body":"I'm current as of this morning (7bd59dee...) and I'm still seeing\ntwo problems with doing 'make' as myself but 'make install' as\nroot.\n\nFirst, 'make install' as root leaves dozens of files owned by root\nin my personal source directory.  A minor nit, but inconvenient\nduring the next 'make'.\n\nSecond, this is a more recent problem with 'make install':\nmake -C git-gui all\nmake[1]: Entering directory `/usr/local/mnt/wa1ter/src/git/git-gui'\nGITGUI_VERSION = 0.6.GITGUI\nmake[1]: Leaving directory `/usr/local/mnt/wa1ter/src/git/git-gui'\nmake[1]: Entering directory `/usr/local/mnt/wa1ter/src/git/git-gui'\n/bin/sh ./CREDITS-GEN\nerror: Cannot locate authorship information.\nmake[1]: *** [CREDITS-FILE] Error 1\n\nNow, CREDITS-FILE was generated during 'make' (I checked) so there\nwas no need to generate it again during 'make install', yes?\n\nThanks!\n"},{"id":"35416","messageId":"20070225061258.GA1415@spearce.org","threadId":"6939","inReplyTo":"erpljl$ln9$1@sea.gmane.org","subject":"Re: Problems installing as root","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-25T06:12:58Z","receivedAt":"2007-02-25T06:12:58Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"walt <wa1ter@myrealbox.com> wrote:\n> I'm current as of this morning (7bd59dee...) and I'm still seeing\n> two problems with doing 'make' as myself but 'make install' as\n> root.\n> \n> First, 'make install' as root leaves dozens of files owned by root\n> in my personal source directory.  A minor nit, but inconvenient\n> during the next 'make'.\n\nWhich files, specifically?  I'm sure that the following would be\nbuilt as root during 'make install':\n\n  GIT-CFLAGS\n  GIT-VERSION-FILE\n  git-gui/GIT-VERSION-FILE\n  git-gui/CREDITS-FILE\n\nas these are rebuilt automatically everytime the Makefile runs,\nas they are embedding version data from HEAD.  But others would be\ninteresting to know about.\n \n> Second, this is a more recent problem with 'make install':\n> make -C git-gui all\n> make[1]: Entering directory `/usr/local/mnt/wa1ter/src/git/git-gui'\n> GITGUI_VERSION = 0.6.GITGUI\n\nHmm.  You can't get the right version number for git-gui.  Do you\nhave tags fetched?\n\nIn order to build completely from source git-gui needs its gitgui-*\ntags in refs/tags.  Junio pushed the gitgui-0.6.1 tag when he merged\nthat version into `maint`.\n\n> make[1]: Leaving directory `/usr/local/mnt/wa1ter/src/git/git-gui'\n> make[1]: Entering directory `/usr/local/mnt/wa1ter/src/git/git-gui'\n> /bin/sh ./CREDITS-GEN\n> error: Cannot locate authorship information.\n> make[1]: *** [CREDITS-FILE] Error 1\n\nSame error as above.  Only this time it made the build stop, rather\nthan assuming some default version (0.6.GITGUI).\n \n> Now, CREDITS-FILE was generated during 'make' (I checked) so there\n> was no need to generate it again during 'make install', yes?\n\nOdd.  We created the CREDITS-FILE during `make` but then barfed\nduring `make install` by acting like we cannot locate the gitgui tag?\n\nWhat does `git tag -l | grep gitgui-` give you when run as root?\n\n\nAs a workaround you may be able to copy `git-gui/CREDITS-FILE` to\n`git-gui/credits`, then run `make install`.  CREDITS-GEN defaults\nto the credits file, as that is shipped in the tarfile.\n\n-- \nShawn.\n"},{"id":"35417","messageId":"7vejoewyag.fsf@assigned-by-dhcp.cox.net","threadId":"6939","inReplyTo":"erpljl$ln9$1@sea.gmane.org","subject":"Re: Problems installing as root","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-25T06:23:35Z","receivedAt":"2007-02-25T06:23:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"walt <wa1ter@myrealbox.com> writes:\n\n> I'm current as of this morning (7bd59dee...) and I'm still seeing\n> two problems with doing 'make' as myself but 'make install' as\n> root.\n>\n> First, 'make install' as root leaves dozens of files owned by root\n> in my personal source directory.  A minor nit, but inconvenient\n> during the next 'make'.\n> ...\n> Second, this is a more recent problem with 'make install':\n\nDoes 'make all' followed by 'make install' do the same?  If so\nthese are indeed very bad.\n\nIf you run 'make all', and then if you run, without changing\nanything to cause rebuilding, run 'make install', the build\nprocedure should not create _any_ new file.  Otherwise the build\nprocedure is broken and needs to be fixed.\n"},{"id":"35418","messageId":"7vabz2wxi4.fsf@assigned-by-dhcp.cox.net","threadId":"6939","inReplyTo":"20070225061258.GA1415@spearce.org","subject":"Re: Problems installing as root","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-25T06:40:35Z","receivedAt":"2007-02-25T06:40:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> Which files, specifically?  I'm sure that the following would be\n> built as root during 'make install':\n>\n>   GIT-CFLAGS\n>   GIT-VERSION-FILE\n>   git-gui/GIT-VERSION-FILE\n>   git-gui/CREDITS-FILE\n>\n> as these are rebuilt automatically everytime the Makefile runs,\n> as they are embedding version data from HEAD.\n\nWe should strive to make sure that \"find -type f -newer .stamp\"\nafter \"make all; date >.stamp; sleep 2; make all\" reports\nnothing.  Otherwise we would break:\n\n\t$ make all\n        $ su\n        # make install\n\nHow about doing something like this (you would need -p2 to apply\nto your tree)?\n\ndiff --git a/git-gui/CREDITS-GEN b/git-gui/CREDITS-GEN\nindex da2c076..d1b0f86 100755\n--- a/git-gui/CREDITS-GEN\n+++ b/git-gui/CREDITS-GEN\n@@ -20,8 +20,8 @@ tree_search ()\n generate_credits ()\n {\n \ttip=$1 &&\n-\trm -f $CF &&\n-\tgit shortlog -n -s $tip | sed 's/: .*$//' >$CF || exit\n+\trm -f \"$2\" &&\n+\tgit shortlog -n -s $tip | sed 's/: .*$//' >\"$2\" || exit\n }\n \n # Always use the tarball credits file if found, just\n@@ -36,10 +36,14 @@ generate_credits ()\n # that fact.\n #\n \n+credits_tmp=/var/tmp/gitgui-credits-$$\n+trap 'rm -f \"$credits_tmp\"' 0\n+\n+orig=\"$credits_tmp\"\n+\n if test -f credits\n then\n-\trm -f $CF &&\n-\tcp credits $CF || exit\n+\torig=credits\n elif prefix=\"$(git rev-parse --show-prefix 2>/dev/null)\" &&\n    test -n \"$prefix\" &&\n    head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) &&\n@@ -47,12 +51,21 @@ elif prefix=\"$(git rev-parse --show-prefix 2>/dev/null)\" &&\n    tip=$(tree_search $head $tree) &&\n    test -n \"$tip\"\n then\n-\tgenerate_credits $tip || exit\n+\tgenerate_credits $tip \"$orig\" || exit\n elif tip=\"$(git rev-parse --verify HEAD 2>/dev/null)\" &&\n    test -n \"$tip\"\n then\n-\tgenerate_credits $tip || exit\n+\tgenerate_credits $tip \"$orig\" || exit\n else\n \techo \"error: Cannot locate authorship information.\" >&2\n \texit 1\n fi\n+\n+if test -f \"$orig\" && cmp -s \"$orig\" \"$CF\"\n+then\n+\t: noop\n+else\n+\trm -f \"$CF\" &&\n+\tcat \"$orig\" >\"$CF\"\n+fi\n+\n"},{"id":"35419","messageId":"20070225070811.GA1676@spearce.org","threadId":"6939","inReplyTo":"7vabz2wxi4.fsf@assigned-by-dhcp.cox.net","subject":"Re: Problems installing as root","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-25T07:08:11Z","receivedAt":"2007-02-25T07:08:11Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> How about doing something like this (you would need -p2 to apply\n> to your tree)?\n> \n> diff --git a/git-gui/CREDITS-GEN b/git-gui/CREDITS-GEN\n\nNo dice:\n\n\t$ git apply -p2 e\n\terror: git-gui/CREDITS-GEN: Not a directory\n\n\t$ git version\n\tgit version 1.5.0.1.641.g3d8a\n\nAnyway - I'm applying that now (hand editing the patch), and will\ndo the same in GIT-VERSION-GEN for git-gui.\n\nWhat about the top level GIT-VERSION-GEN in git.git?\n\n-- \nShawn.\n"},{"id":"35421","messageId":"7vvehqvhcu.fsf@assigned-by-dhcp.cox.net","threadId":"6939","inReplyTo":"20070225070811.GA1676@spearce.org","subject":"Re: Problems installing as root","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-25T07:14:41Z","receivedAt":"2007-02-25T07:14:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> ..., and will\n> do the same in GIT-VERSION-GEN for git-gui.\n\nI had an impression that GIT-VERSION-GEN in git-gui was Ok.\n\n> What about the top level GIT-VERSION-GEN in git.git?\n\nI thought it is much more careful than git-gui/CREDITS-GEN about\navoiding unnecessary rebuilding.\n"},{"id":"35422","messageId":"20070225072330.GB1676@spearce.org","threadId":"6939","inReplyTo":"7vvehqvhcu.fsf@assigned-by-dhcp.cox.net","subject":"Re: Problems installing as root","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-25T07:23:30Z","receivedAt":"2007-02-25T07:23:30Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> \n> > ..., and will\n> > do the same in GIT-VERSION-GEN for git-gui.\n> \n> I had an impression that GIT-VERSION-GEN in git-gui was Ok.\n\nIt is.  I just looked at it to see about fixing it too and just\nrealized what the `test $VN = $VC ||` chunk was all about.  :-)\n\n> > What about the top level GIT-VERSION-GEN in git.git?\n> \n> I thought it is much more careful than git-gui/CREDITS-GEN about\n> avoiding unnecessary rebuilding.\n\nYes, it is.  I didn't realize what it was doing until just now.  :-)\n\n\nApparently I'm missing the obvious tonight.  There is a new version\nof git-gui now pushed out (1 commit, your patch).  I did not bother\nto tag it.   Please pull into maint.\n\n-- \nShawn.\n"},{"id":"35423","messageId":"7vr6sevgtx.fsf@assigned-by-dhcp.cox.net","threadId":"6939","inReplyTo":"20070225072330.GB1676@spearce.org","subject":"Re: Problems installing as root","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-25T07:26:02Z","receivedAt":"2007-02-25T07:26:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> ... There is a new version\n> of git-gui now pushed out (1 commit, your patch).  I did not bother\n> to tag it.   Please pull into maint.\n\nThanks, will do.\n"},{"id":"35432","messageId":"ersapr$bu5$1@sea.gmane.org","threadId":"6939","inReplyTo":"20070225061258.GA1415@spearce.org","subject":"Re: Problems installing as root","fromName":"walt","fromEmail":"wa1ter@myrealbox.com","sentAt":"2007-02-25T15:42:48Z","receivedAt":"2007-02-25T15:42:48Z","isPatch":false,"sender":{"key":"wa1ter@myrealbox.com","avatar":null},"body":"Shawn O. Pearce wrote:\n> walt <wa1ter@myrealbox.com> wrote:\n>> First, 'make install' as root leaves dozens of files owned by root\n>> in my personal source directory.\n\n> Which files, specifically? ...\n\n~/src/git $find . -user 0\n./git-fsck-objects\n./git-archive\n./git-cherry\n./git-whatchanged\n./git-annotate\n./git-status\n./git-merge-octopus\n./git-show\n./git-update-index\n./git-format-patch\n./git-quiltimport\n./git-verify-pack\n./git-rev-list\n./git-cvsserver\n./git-runstatus\n./git-pull\n./git-merge-file\n./git-log\n./git-repack\n./git-mailinfo\n./git-rm\n./git-applypatch\n./git-parse-remote\n./git-reset\n./git-mailsplit\n./git-for-each-ref\n./git-svnimport\n./git-grep\n./git-write-tree\n./git-ls-files\n./git-add--interactive\n./git-verify-tag\n./git-prune\n./git-diff\n./git-rebase\n./git-branch\n./git-check-ref-format\n./git-push\n./git-cat-file\n./git-prune-packed\n./git-merge-stupid\n./git-mv\n./git-merge-ours\n./git-add\n./git-name-rev\n./git-merge-base\n./git-read-tree\n./git-commit-tree\n./git-ls-remote\n./git-tag\n./git-init\n./git-init-db\n./git-rev-parse\n./git-pack-refs\n./git\n./git-show-branch\n./git-commit\n./git-get-tar-commit-id\n./git-fsck\n./git-reflog\n./git-applymbox\n./git-merge\n./git-cherry-pick\n./git-diff-files\n./git-fetch\n./git-fmt-merge-msg\n./git-blame\n./git-tar-tree\n./git-request-pull\n./git-archimport\n./git-count-objects\n./git-cvsexportcommit\n./git-show-ref\n./git-shortlog\n./git-merge-resolve\n./git-checkout-index\n./git-gc\n./git-am\n./git-diff-index\n./git-revert\n./git-clean\n./git-stripspace\n./git-ls-tree\n./git-unpack-objects\n./git-checkout\n./git-pack-objects\n./git-merge-one-file\n./git-lost-found\n./git-svn\n./git-remote\n./git-update-ref\n./git-apply\n./git-repo-config\n./git-symbolic-ref\n./git-diff-tree\n./git-upload-archive\n./git-sh-setup\n./git-send-email\n./git-rerere\n./git-config\n./git-relink\n./git-clone\n./git-describe\n./git-bisect\n./git-cvsimport\n\n>> Second, this is a more recent problem with 'make install':\n>> make -C git-gui all\n>> make[1]: Entering directory `/usr/local/mnt/wa1ter/src/git/git-gui'\n>> GITGUI_VERSION = 0.6.GITGUI\n\n> Hmm.  You can't get the right version number for git-gui.  Do you\n> have tags fetched?\n\nOops.  I stupidly forgot to tell you the reason for the failure\nwhen running the script as root:  /usr/local is not in root's path,\nand thus /usr/local/bin/git-* can't be found.  Since the script\nassumes that git is already installed and working, I would guess\nthat it would also fail if I had just fetched Junio's repository\nfor the first time and attempted an initial install.\n\nSorry for that important omission :o(\n"},{"id":"35482","messageId":"ertdaq$mkf$1@sea.gmane.org","threadId":"6939","inReplyTo":"7vejoewyag.fsf@assigned-by-dhcp.cox.net","subject":"Re: Problems installing as root","fromName":"walt","fromEmail":"wa1ter@myrealbox.com","sentAt":"2007-02-26T01:32:03Z","receivedAt":"2007-02-26T01:32:03Z","isPatch":false,"sender":{"key":"wa1ter@myrealbox.com","avatar":null},"body":"Junio C Hamano wrote:\n> walt <wa1ter@myrealbox.com> writes:\n\n>> 'make install' as root leaves dozens of files owned by root\n>> in my personal source directory...\n\n> Does 'make all' followed by 'make install' do the same?  If so\n> these are indeed very bad.\n> \n> If you run 'make all', and then if you run, without changing\n> anything to cause rebuilding, run 'make install', the build\n> procedure should not create _any_ new file.  Otherwise the build\n> procedure is broken and needs to be fixed.\n\n'make all' does exactly the same thing.  (The Makefile says that\n'make all' is the default target, so it should behave the same,\nno?)\n\nThanks.\n"},{"id":"35484","messageId":"20070226021053.GB1884@spearce.org","threadId":"6939","inReplyTo":"ersapr$bu5$1@sea.gmane.org","subject":"Re: Problems installing as root","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-26T02:10:53Z","receivedAt":"2007-02-26T02:10:53Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"walt <wa1ter@myrealbox.com> wrote:\n> Shawn O. Pearce wrote:\n> > walt <wa1ter@myrealbox.com> wrote:\n> >> First, 'make install' as root leaves dozens of files owned by root\n> >> in my personal source directory.\n> \n> > Which files, specifically? ...\n> \n> ~/src/git $find . -user 0\n> ./git-fsck-objects\n...+100 files...\n\nThis is caused by below...\n\n> >> Second, this is a more recent problem with 'make install':\n> >> make -C git-gui all\n> >> make[1]: Entering directory `/usr/local/mnt/wa1ter/src/git/git-gui'\n> >> GITGUI_VERSION = 0.6.GITGUI\n> \n> > Hmm.  You can't get the right version number for git-gui.  Do you\n> > have tags fetched?\n> \n> Oops.  I stupidly forgot to tell you the reason for the failure\n> when running the script as root:  /usr/local is not in root's path,\n> and thus /usr/local/bin/git-* can't be found.  Since the script\n> assumes that git is already installed and working, I would guess\n> that it would also fail if I had just fetched Junio's repository\n> for the first time and attempted an initial install.\n\nRight.  So what is happening is the toplevel Makefile tries to run\nGIT-VERSION-GEN to obtain the version, that calls git-describe,\nwhich does not exist, fails, and falls back on the hardcoded version\nnumber.  That version number differs from what the software was\ncompiled with, so it gets recompiled.  Instant set of +100 files\nowned by root.\n\nSame issue happens down inside of git-gui.\n\nI think the only answer I have for you is the following:\n\n  If you want to run the Makefile without having git in your path\n  then make a tarball first (make dist) with Git in your path,\n  then unpack the tarball and compile that.\n\n  This works as the tarball embeds version and credits files that\n  sidestep the need for git-describe.\n\n-- \nShawn.\n"}]}