git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem running 'make install' as root when on mounted fs
@ 2009-08-07 10:08 Alex Blewitt
  2009-08-07 17:51 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Blewitt @ 2009-08-07 10:08 UTC (permalink / raw)
  To: git

I just tried building and installing Git on Mac OSX. My home directory  
is NFS mounted, to which I have write (but root doesn't).

When I do make, everything compiles OK
When I do sudo make install, I get '/bin/sh: GIT-BUILD-OPTIONS:  
permission denied'

It seems that make install is re-running the GIT-BUILD-OPTIONS target,  
and that tries to write to the current directory. In my case, on an  
NFS mounted home, root doesn't have write permissions to the local dir  
and so the install step fails.

I could build on a local partition (e.g. /tmp) but I'd prefer to have  
the code on my local drive so that I can do a git update and other  
such changes subsequently. I was able to get it to work by removing  
the echo>> from the GIT-BUILD-OPTIONS step after having built the code  
the first time.

The problem basically seems to be:

install: all
all:: ... GIT-BUILD-OPTIONS

I think it would be possible to restrict the GIT-BUILD-OPTIONS to be  
generated during a build phase, so restructuring the Makefile like:

install: build
all:: build GIT-BUILD-OPTIONS
build: ...

would then mean the install phase wouldn't have to touch the GIT-BUILD- 
OPTIONS step.

Does that sound reasonable? I'm happy to test it out and submit a  
patch if people agree (and/or have opinions on what the inner target  
'build' should be called)

Alex

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

* Re: Problem running 'make install' as root when on mounted fs
  2009-08-07 10:08 Problem running 'make install' as root when on mounted fs Alex Blewitt
@ 2009-08-07 17:51 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2009-08-07 17:51 UTC (permalink / raw)
  To: Alex Blewitt; +Cc: git

Alex Blewitt <alex.blewitt@gmail.com> writes:

> I think it would be possible to restrict the GIT-BUILD-OPTIONS to be
> generated during a build phase, so restructuring the Makefile like:
>
> install: build
> all:: build GIT-BUILD-OPTIONS
> build: ...

If you did:

	make prefix=$HOME all
        make prefix=/usr install

then the second step needs to notice that the gitexecdir computed and
stored in exec_cmd.o in the first step is now invalid, and needs to
recompile the file.  The whole purpose of GIT-BUILD-OPTIONS is to detect
such a case---doesn't your change defeat it?

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

end of thread, other threads:[~2009-08-07 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 10:08 Problem running 'make install' as root when on mounted fs Alex Blewitt
2009-08-07 17:51 ` Junio C Hamano

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 NNTP newsgroup(s).