{"thread":{"id":"20448","subject":"Problem running 'make install' as root when on mounted fs","startedAt":"2009-08-07T10:08:24Z","lastAt":"2009-08-07T17:51:12Z","messageCount":2,"participants":["Alex Blewitt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119897","messageId":"8F9F4A8A-9515-4A7D-90EE-4BD3DA3F7A2B@gmail.com","threadId":"20448","inReplyTo":null,"subject":"Problem running 'make install' as root when on mounted fs","fromName":"Alex Blewitt","fromEmail":"alex.blewitt@gmail.com","sentAt":"2009-08-07T10:08:24Z","receivedAt":"2009-08-07T10:08:24Z","isPatch":false,"sender":{"key":"alex.blewitt@gmail.com","avatar":"https://gravatar.com/avatar/fb95a3b593b290f03a8d3b022c20b2825205702c5651f731f65d33512dfe6ab2?d=mp&s=160"},"body":"I just tried building and installing Git on Mac OSX. My home directory  \nis NFS mounted, to which I have write (but root doesn't).\n\nWhen I do make, everything compiles OK\nWhen I do sudo make install, I get '/bin/sh: GIT-BUILD-OPTIONS:  \npermission denied'\n\nIt seems that make install is re-running the GIT-BUILD-OPTIONS target,  \nand that tries to write to the current directory. In my case, on an  \nNFS mounted home, root doesn't have write permissions to the local dir  \nand so the install step fails.\n\nI could build on a local partition (e.g. /tmp) but I'd prefer to have  \nthe code on my local drive so that I can do a git update and other  \nsuch changes subsequently. I was able to get it to work by removing  \nthe echo>> from the GIT-BUILD-OPTIONS step after having built the code  \nthe first time.\n\nThe problem basically seems to be:\n\ninstall: all\nall:: ... GIT-BUILD-OPTIONS\n\nI think it would be possible to restrict the GIT-BUILD-OPTIONS to be  \ngenerated during a build phase, so restructuring the Makefile like:\n\ninstall: build\nall:: build GIT-BUILD-OPTIONS\nbuild: ...\n\nwould then mean the install phase wouldn't have to touch the GIT-BUILD- \nOPTIONS step.\n\nDoes that sound reasonable? I'm happy to test it out and submit a  \npatch if people agree (and/or have opinions on what the inner target  \n'build' should be called)\n\nAlex\n"},{"id":"119914","messageId":"7vbpmr1pin.fsf@alter.siamese.dyndns.org","threadId":"20448","inReplyTo":"8F9F4A8A-9515-4A7D-90EE-4BD3DA3F7A2B@gmail.com","subject":"Re: Problem running 'make install' as root when on mounted fs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-07T17:51:12Z","receivedAt":"2009-08-07T17:51:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Blewitt <alex.blewitt@gmail.com> writes:\n\n> I think it would be possible to restrict the GIT-BUILD-OPTIONS to be\n> generated during a build phase, so restructuring the Makefile like:\n>\n> install: build\n> all:: build GIT-BUILD-OPTIONS\n> build: ...\n\nIf you did:\n\n\tmake prefix=$HOME all\n        make prefix=/usr install\n\nthen the second step needs to notice that the gitexecdir computed and\nstored in exec_cmd.o in the first step is now invalid, and needs to\nrecompile the file.  The whole purpose of GIT-BUILD-OPTIONS is to detect\nsuch a case---doesn't your change defeat it?\n"}]}