threads / discuss / 25159

Reduced privileges install

Subject: Reduced privileges install

## tl;dr

17 messages between Sep 19, 2010 and Sep 20, 2010.

replies: 16people: 6as markdown or json

Andrew Keller· Sep 19, 2010, 23:50 UTC · lore
Hello, all.  Quick question:

I'm trying to build and install git 1.7.2.3 from source on a server at school used for my class. 'uname -a' is 'SunOS bloch 5.9 Generic_122300-54 sun4u sparc SUNW,UltraAX-i2'.

There were a few hiccups at first – things like CC not being defined, tclsh not existing, the path to python being wrong, etc, but they were all relatively easy to work around.  This last error, however, not so much luck.
Because I do not own the server and my account has restricted privileges, I attempted to augment my PATH to include a directory in my home folder, and then install git in there by specifying a prefix at the configure stage.  The configure and the make work, but the make install fails.  Here's the last section of the log:
$ make install
...
make -C templates DESTDIR='' install
make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
/usr/ucb/install -d -m 755 '/usr/users/students/ak4390/.local/share/git-core/templates'
(cd blt && gtar cf - .) | \
        (cd '/usr/users/students/ak4390/.local/share/git-core/templates' && umask 022 && gtar xof -)
make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
make -C perl prefix='/usr/users/students/ak4390/.local' DESTDIR='' install
make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
make[2]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
Warning: You do not have permissions to install into /usr/perl5/site_perl/5.6.1/sun4-solaris-64int at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 85.
Installing /usr/perl5/site_perl/5.6.1/Error.pm
Installing /usr/perl5/site_perl/5.6.1/Git.pm
mkdir /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto: Permission denied at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 165
make[2]: *** [pure_site_install] Error 255
make[2]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
make: *** [install] Error 2
So anyways, it appears that it is trying to install into a directory in which I do not have write permissions.  But why?  I thought that setting the prefix to a folder in my home directory would change that.  Is there another parameter I'm forgetting about at the configure stage?

Thanks, Andrew Keller

PS: not sure if it matters, but just in case...
path to perl: /bin/perl
version of perl: 5.6.1
Randal L. Schwartz· Sep 20, 2010, 01:07 UTC · re: Andrew Keller · lore

Re: Reduced privileges install

>>>>> "Andrew" == Andrew Keller <andrew@kellerfarm.com> writes:

Andrew> Because I do not own the server and my account has restricted Andrew> privileges, I attempted to augment my PATH to include a Andrew> directory in my home folder, and then install git in there by Andrew> specifying a prefix at the configure stage. The configure and Andrew> the make work, but the make install fails. Here's the last Andrew> section of the log:

What's your PREFIX set to? If you set your prefix, the Perl modules are installed below the prefix, not in the system dirs.

Andrew> $ make install
Yeah, I don't see a prefix here, unless you set it in your Makefile.
-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Andrew Keller· Sep 20, 2010, 01:31 UTC · re: Randal L. Schwartz · lore

Re: Reduced privileges install

On Sep 19, 2010, at 9:07 PM, Randal L. Schwartz wrote:
Show 5 quoted lines
> "Andrew" == Andrew Keller <andrew@kellerfarm.com> writes:
> 
>> Because I do not own the server and my account has restricted privileges, I attempted to augment my PATH to include a directory in my home folder, and then install git in there by specifying a prefix at the configure stage.  The configure and the make work, but the make install fails.  Here's the last section of the log:
> 
> What's your PREFIX set to?  If you set your prefix, the Perl modules are installed below the prefix, not in the system dirs.
Here's what I executed:

$ ./configure --prefix=/usr/users/students/ak4390/.local $ make $ make install

I also tried providing the --oldincludedir and --datadir parameters, but I got the same result.
~ Andrew Keller
Kevin Ballard· Sep 20, 2010, 06:51 UTC · re: Andrew Keller · lore

Re: Reduced privileges install

On Sep 19, 2010, at 6:31 PM, Andrew Keller wrote:
Show 15 quoted lines
> On Sep 19, 2010, at 9:07 PM, Randal L. Schwartz wrote:
>> "Andrew" == Andrew Keller <andrew@kellerfarm.com> writes:
>> 
>>> Because I do not own the server and my account has restricted privileges, I attempted to augment my PATH to include a directory in my home folder, and then install git in there by specifying a prefix at the configure stage.  The configure and the make work, but the make install fails.  Here's the last section of the log:
>> 
>> What's your PREFIX set to?  If you set your prefix, the Perl modules are installed below the prefix, not in the system dirs.
> 
> 
> Here's what I executed:
> 
> $ ./configure --prefix=/usr/users/students/ak4390/.local
> $ make
> $ make install
> 
> I also tried providing the --oldincludedir and --datadir parameters, but I got the same result.
I admit, I'm not well-versed on the build system, but my impression was that specifying --prefix in ./configure was indeed supposed to propagate to a subsequent make and make install. However, you may wish to attempt the following to be sure:

$ make PREFIX=/usr/users/students/ak4390/.local $ make install PREFIX=/usr/users/students/ak4390/.local

-Kevin Ballard
Andrew Keller· Sep 20, 2010, 14:06 UTC · re: Kevin Ballard · lore

Re: Reduced privileges install

On Sep 20, 2010, at 2:51 AM, Kevin Ballard wrote:
Show 20 quoted lines
> On Sep 19, 2010, at 6:31 PM, Andrew Keller wrote:
>> On Sep 19, 2010, at 9:07 PM, Randal L. Schwartz wrote:
>>> "Andrew" == Andrew Keller <andrew@kellerfarm.com> writes:
>>> 
>>>> Because I do not own the server and my account has restricted privileges, I attempted to augment my PATH to include a directory in my home folder, and then install git in there by specifying a prefix at the configure stage.  The configure and the make work, but the make install fails.  Here's the last section of the log:
>>> 
>>> What's your PREFIX set to?  If you set your prefix, the Perl modules are installed below the prefix, not in the system dirs.
>> 
>> Here's what I executed:
>> 
>> $ ./configure --prefix=/usr/users/students/ak4390/.local
>> $ make
>> $ make install
>> 
>> I also tried providing the --oldincludedir and --datadir parameters, but I got the same result.
> 
> I admit, I'm not well-versed on the build system, but my impression was that specifying --prefix in ./configure was indeed supposed to propagate to a subsequent make and make install. However, you may wish to attempt the following to be sure:
> 
> $ make PREFIX=/usr/users/students/ak4390/.local
> $ make install PREFIX=/usr/users/students/ak4390/.local
The same error occurs when providing the prefix to the build and install segments.
~ Andrew Keller
Matthieu Moy· Sep 20, 2010, 14:40 UTC · re: Kevin Ballard · lore

Re: Reduced privileges install

Andrew Keller <andrew@kellerfarm.com> writes:
> make -C perl prefix='/usr/users/students/ak4390/.local' DESTDIR='' install
> make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
> make[2]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
> Warning: You do not have permissions to install into /usr/perl5/site_perl/5.6.1/sun4-solaris-64int at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 85.

The DESTDIR='' is suspicious. It seems the prefix is not passed properly in recursive "make" invocations, and perl tries to install things in the default directory.

Kevin Ballard <kevin@sb.org> writes:
Show 8 quoted lines
> Andrew Keller <andrew@kellerfarm.com> writes:
>> $ ./configure --prefix=/usr/users/students/ak4390/.local
>> $ make
>> $ make install
>
> I admit, I'm not well-versed on the build system, but my impression
> was that specifying --prefix in ./configure was indeed supposed to
> propagate to a subsequent make and make install.

It does. I installed Git successfully without ever being root on several machines.

In my case, it was GNU/Linux machines, so something may go wrong because of a non-gnu system. Did you try compiling with gmake instead of make?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Randal L. Schwartz· Sep 20, 2010, 14:52 UTC · re: Matthieu Moy · lore

Re: Reduced privileges install

>>>>> "Matthieu" == Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

Matthieu> In my case, it was GNU/Linux machines, so something may go wrong Matthieu> because of a non-gnu system. Did you try compiling with gmake instead Matthieu> of make?

Works fine for me on OSX.  Here's my build script:
get.git:
    cd ~/MIRROR/git-GIT && git fetch && git diff --stat live origin/master
make.git:
    cd ~/MIRROR/git-GIT &&
    git reset --hard origin/master &&
    make prefix=/opt/git all install quick-install-man &&
    git tag -f live HEAD
And everything (including the Perl bits) ends up under /opt/git.
I don't even run configure.  Not sure why I would. :)
-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Andrew Keller· Sep 20, 2010, 15:48 UTC · re: Matthieu Moy · lore

Re: Reduced privileges install

On Sep 20, 2010, at 10:40 AM, Matthieu Moy wrote:
Show 17 quoted lines
> Kevin Ballard <kevin@sb.org> writes:
>> Andrew Keller <andrew@kellerfarm.com> writes:
>> 
>>> $ ./configure --prefix=/usr/users/students/ak4390/.local
>>> $ make
>>> $ make install
>> 
>> I admit, I'm not well-versed on the build system, but my impression
>> was that specifying --prefix in ./configure was indeed supposed to
>> propagate to a subsequent make and make install.
> 
> It does. I installed Git successfully without ever being root on
> several machines.
> 
> In my case, it was GNU/Linux machines, so something may go wrong
> because of a non-gnu system. Did you try compiling with gmake instead
> of make?
Just did.  There is no change in the result.  A website also suggested disabling curl support, and defining INSTALL as /usr/ucb/install.  No change.  The install target is very insistent on installing into /usr/perl5/site_perl/5.6.1/sun4-solaris-64int.
~ Andrew Keller
Brandon Casey· Sep 20, 2010, 14:53 UTC · re: Andrew Keller · lore

Re: Reduced privileges install

On 09/19/2010 06:50 PM, Andrew Keller wrote:
Show 42 quoted lines
> Hello, all.  Quick question:
> 
> I'm trying to build and install git 1.7.2.3 from source on a server at school used for my class.
> 'uname -a' is 'SunOS bloch 5.9 Generic_122300-54 sun4u sparc SUNW,UltraAX-i2'.
> 
> There were a few hiccups at first – things like CC not being defined, tclsh not existing, the path to python being wrong, etc, but they were all relatively easy to work around.  This last error, however, not so much luck.
> 
> Because I do not own the server and my account has restricted privileges, I attempted to augment my PATH to include a directory in my home folder, and then install git in there by specifying a prefix at the configure stage.  The configure and the make work, but the make install fails.  Here's the last section of the log:
> 
> 
> $ make install
> 
> ...
> 
> make -C templates DESTDIR='' install
> make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
> /usr/ucb/install -d -m 755 '/usr/users/students/ak4390/.local/share/git-core/templates'
> (cd blt && gtar cf - .) | \
>         (cd '/usr/users/students/ak4390/.local/share/git-core/templates' && umask 022 && gtar xof -)
> make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
> make -C perl prefix='/usr/users/students/ak4390/.local' DESTDIR='' install
> make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
> make[2]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
> Warning: You do not have permissions to install into /usr/perl5/site_perl/5.6.1/sun4-solaris-64int at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 85.
> Installing /usr/perl5/site_perl/5.6.1/Error.pm
> Installing /usr/perl5/site_perl/5.6.1/Git.pm
> mkdir /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto: Permission denied at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 165
> make[2]: *** [pure_site_install] Error 255
> make[2]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
> make[1]: *** [install] Error 2
> make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
> make: *** [install] Error 2
> 
> 
> So anyways, it appears that it is trying to install into a directory in which I do not have write permissions.  But why?  I thought that setting the prefix to a folder in my home directory would change that.  Is there another parameter I'm forgetting about at the configure stage?
> 
> Thanks,
> Andrew Keller
> 
> PS: not sure if it matters, but just in case...
> path to perl: /bin/perl
> version of perl: 5.6.1
By chance could INSTALL_BASE be set in your environment?
   $ echo $INSTALL_BASE

A patch was recently made to unset that variable so that it could not influence perl's makemaker. Though the commit message indicates that makemaker complains loudly when both INSTALL_BASE and PREFIX are set, so perhaps this is not the problem.

If INSTALL_BASE is set, then unset it, and try again.

Alternatively, you could avoid makemaker altogether by setting NO_PERL_MAKEMAKER on the make command line and git will build its own make file:

   make NO_PERL_MAKEMAKER=1 install
-Brandon
Andrew Keller· Sep 20, 2010, 16:56 UTC · re: Brandon Casey · lore

Re: Reduced privileges install

On Sep 20, 2010, at 10:53 AM, Brandon Casey wrote:
Show 48 quoted lines
> On 09/19/2010 06:50 PM, Andrew Keller wrote:
> 
>> Hello, all.  Quick question:
>> 
>> I'm trying to build and install git 1.7.2.3 from source on a server at school used for my class.
>> 'uname -a' is 'SunOS bloch 5.9 Generic_122300-54 sun4u sparc SUNW,UltraAX-i2'.
>> 
>> There were a few hiccups at first – things like CC not being defined, tclsh not existing, the path to python being wrong, etc, but they were all relatively easy to work around.  This last error, however, not so much luck.
>> 
>> Because I do not own the server and my account has restricted privileges, I attempted to augment my PATH to include a directory in my home folder, and then install git in there by specifying a prefix at the configure stage.  The configure and the make work, but the make install fails.  Here's the last section of the log:
>> 
>> 
>> $ make install
>> 
>> ...
>> 
>> make -C templates DESTDIR='' install
>> make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
>> /usr/ucb/install -d -m 755 '/usr/users/students/ak4390/.local/share/git-core/templates'
>> (cd blt && gtar cf - .) | \
>>        (cd '/usr/users/students/ak4390/.local/share/git-core/templates' && umask 022 && gtar xof -)
>> make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
>> make -C perl prefix='/usr/users/students/ak4390/.local' DESTDIR='' install
>> make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>> make[2]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>> Warning: You do not have permissions to install into /usr/perl5/site_perl/5.6.1/sun4-solaris-64int at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 85.
>> Installing /usr/perl5/site_perl/5.6.1/Error.pm
>> Installing /usr/perl5/site_perl/5.6.1/Git.pm
>> mkdir /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto: Permission denied at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 165
>> make[2]: *** [pure_site_install] Error 255
>> make[2]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>> make[1]: *** [install] Error 2
>> make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>> make: *** [install] Error 2
>> 
>> 
>> So anyways, it appears that it is trying to install into a directory in which I do not have write permissions.  But why?  I thought that setting the prefix to a folder in my home directory would change that.  Is there another parameter I'm forgetting about at the configure stage?
>> 
>> Thanks,
>> Andrew Keller
>> 
>> PS: not sure if it matters, but just in case...
>> path to perl: /bin/perl
>> version of perl: 5.6.1
> 
> By chance could INSTALL_BASE be set in your environment?
> 
>   $ echo $INSTALL_BASE
env says that INSTALL_BASE is not currently set.
Show 12 quoted lines
> A patch was recently made to unset that variable so that it
> could not influence perl's makemaker.  Though the commit message
> indicates that makemaker complains loudly when both INSTALL_BASE
> and PREFIX are set, so perhaps this is not the problem.
> 
> If INSTALL_BASE is set, then unset it, and try again.
> 
> Alternatively, you could avoid makemaker altogether by setting
> NO_PERL_MAKEMAKER on the make command line and git will build
> its own make file:
> 
>   make NO_PERL_MAKEMAKER=1 install
Setting NO_PERL_MAKEMAKER at the build stage seems to make the install stage work.  Yay!
This is what it took to compile Git on this server without root privileges (Solaris 8 / Sparc):

# create a location for apps in my home folder: mkdir ~/.local export PATH=$PATH:/usr/users/students/ak4390/.local/bin export MANPATH=$MANPATH:/usr/users/students/ak4390/.local/share/man

# compile and install git $ ln -s /usr/local/bin/tclsh8.4 /usr/users/students/ak4390/.local/bin/tclsh $ export CC=/usr/local/bin/gcc $ cd <path-to-git-src> $ ./configure --prefix=/usr/users/students/ak4390/.local --with-python=/usr/local/bin/python --enable-pthreads=no $ make NO_PERL_MAKEMAKER=1 all install

Letting the configure figure out the threading did not seem to work.  The compile and install worked, with lots of warnings from gcc about not recognizing -pthreads, but when you try to do a clone, git complained about not being able to fork off the demultiplexer.  So I just turned off threading and it works.
The quick-install-man target still failed, but it's not really a big deal since I can just install it myself.

Thanks, ~ Andrew Keller

Ævar Arnfjörð Bjarmason· Sep 20, 2010, 17:01 UTC · re: Andrew Keller · lore

Re: Reduced privileges install

On Mon, Sep 20, 2010 at 16:56, Andrew Keller <andrew@kellerfarm.com> wrote:
Show 84 quoted lines
> On Sep 20, 2010, at 10:53 AM, Brandon Casey wrote:
>> On 09/19/2010 06:50 PM, Andrew Keller wrote:
>>
>>> Hello, all.  Quick question:
>>>
>>> I'm trying to build and install git 1.7.2.3 from source on a server at school used for my class.
>>> 'uname -a' is 'SunOS bloch 5.9 Generic_122300-54 sun4u sparc SUNW,UltraAX-i2'.
>>>
>>> There were a few hiccups at first – things like CC not being defined, tclsh not existing, the path to python being wrong, etc, but they were all relatively easy to work around.  This last error, however, not so much luck.
>>>
>>> Because I do not own the server and my account has restricted privileges, I attempted to augment my PATH to include a directory in my home folder, and then install git in there by specifying a prefix at the configure stage.  The configure and the make work, but the make install fails.  Here's the last section of the log:
>>>
>>>
>>> $ make install
>>>
>>> ...
>>>
>>> make -C templates DESTDIR='' install
>>> make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
>>> /usr/ucb/install -d -m 755 '/usr/users/students/ak4390/.local/share/git-core/templates'
>>> (cd blt && gtar cf - .) | \
>>>        (cd '/usr/users/students/ak4390/.local/share/git-core/templates' && umask 022 && gtar xof -)
>>> make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/templates'
>>> make -C perl prefix='/usr/users/students/ak4390/.local' DESTDIR='' install
>>> make[1]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>>> make[2]: Entering directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>>> Warning: You do not have permissions to install into /usr/perl5/site_perl/5.6.1/sun4-solaris-64int at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 85.
>>> Installing /usr/perl5/site_perl/5.6.1/Error.pm
>>> Installing /usr/perl5/site_perl/5.6.1/Git.pm
>>> mkdir /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto: Permission denied at /usr/perl5/5.6.1/lib/ExtUtils/Install.pm line 165
>>> make[2]: *** [pure_site_install] Error 255
>>> make[2]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>>> make[1]: *** [install] Error 2
>>> make[1]: Leaving directory `/usr/users/students/ak4390/Downloads/git-1.7.2.3/perl'
>>> make: *** [install] Error 2
>>>
>>>
>>> So anyways, it appears that it is trying to install into a directory in which I do not have write permissions.  But why?  I thought that setting the prefix to a folder in my home directory would change that.  Is there another parameter I'm forgetting about at the configure stage?
>>>
>>> Thanks,
>>> Andrew Keller
>>>
>>> PS: not sure if it matters, but just in case...
>>> path to perl: /bin/perl
>>> version of perl: 5.6.1
>>
>> By chance could INSTALL_BASE be set in your environment?
>>
>>   $ echo $INSTALL_BASE
>
> env says that INSTALL_BASE is not currently set.
>
>> A patch was recently made to unset that variable so that it
>> could not influence perl's makemaker.  Though the commit message
>> indicates that makemaker complains loudly when both INSTALL_BASE
>> and PREFIX are set, so perhaps this is not the problem.
>>
>> If INSTALL_BASE is set, then unset it, and try again.
>>
>> Alternatively, you could avoid makemaker altogether by setting
>> NO_PERL_MAKEMAKER on the make command line and git will build
>> its own make file:
>>
>>   make NO_PERL_MAKEMAKER=1 install
>
> Setting NO_PERL_MAKEMAKER at the build stage seems to make the install stage work.  Yay!
>
> This is what it took to compile Git on this server without root privileges (Solaris 8 / Sparc):
>
> # create a location for apps in my home folder:
> mkdir ~/.local
> export PATH=$PATH:/usr/users/students/ak4390/.local/bin
> export MANPATH=$MANPATH:/usr/users/students/ak4390/.local/share/man
>
> # compile and install git
> $ ln -s /usr/local/bin/tclsh8.4 /usr/users/students/ak4390/.local/bin/tclsh
> $ export CC=/usr/local/bin/gcc
> $ cd <path-to-git-src>
> $ ./configure --prefix=/usr/users/students/ak4390/.local --with-python=/usr/local/bin/python --enable-pthreads=no
> $ make NO_PERL_MAKEMAKER=1 all install
>
> Letting the configure figure out the threading did not seem to work.  The compile and install worked, with lots of warnings from gcc about not recognizing -pthreads, but when you try to do a clone, git complained about not being able to fork off the demultiplexer.  So I just turned off threading and it works.
>
> The quick-install-man target still failed, but it's not really a big deal since I can just install it myself.
What does this return for you:
    perl -MExtUtils::MakeMaker -le 'print $ExtUtils::MakeMaker::VERSION'
Brandon Casey· Sep 20, 2010, 19:12 UTC · re: Andrew Keller · lore

Re: Reduced privileges install

[We prefer if you hit 'Reply-All' when replying so that all
 commenters are retained on the cc list]
On 09/20/2010 11:56 AM, Andrew Keller wrote:
> This is what it took to compile Git on this server without root privileges (Solaris 8 / Sparc):
I thought it was Solaris 9? :)
> # create a location for apps in my home folder:
> mkdir ~/.local
> export PATH=$PATH:/usr/users/students/ak4390/.local/bin
> export MANPATH=$MANPATH:/usr/users/students/ak4390/.local/share/man

Setting MANPATH is only necessary if you want to be able to type 'man git-add' or something. Instead, you can use the 'help' subcommand of git, or the --help option of each command, and it will display the man page for you.

   $ git help add
> # compile and install git
> $ ln -s /usr/local/bin/tclsh8.4 /usr/users/students/ak4390/.local/bin/tclsh
You can set TCL_PATH instead of creating this symbolic link.
Show 10 quoted lines
> $ export CC=/usr/local/bin/gcc
> $ cd <path-to-git-src>
> $ ./configure --prefix=/usr/users/students/ak4390/.local --with-python=/usr/local/bin/python --enable-pthreads=no
> $ make NO_PERL_MAKEMAKER=1 all install
> 
> Letting the configure figure out the threading did not seem to work.
> The compile and install worked, with lots of warnings from gcc about not
> recognizing -pthreads, but when you try to do a clone, git complained about
> not being able to fork off the demultiplexer.  So I just turned off threading
> and it works.

Maybe the configure script is broken with respect to detecting threads on Solaris 8 (or 9)? You probably don't really need to run the configure script on your platform. I don't. Since you're using gcc to compile, the default pthread switch '-lpthread' should be appropriate. You could try deleting the config.mak.autogen file that configure creates, and just run make by itself. Based on what you've describe, it would look something like this:

   cd <path-to-git-src>
   rm config.mak.autogen
   cat >config.mak <<EOF
CC=/usr/local/bin/gcc
PREFIX=/usr/users/students/ak4390/.local
PYTHON_PATH=/usr/local/bin/python
TCL_PATH=/usr/local/bin/tclsh8.4
NO_PERL_MAKEMAKER=1
EOF
   make
Then add 'install' to the make command line when you are ready.

Notice, I placed all of the make settings in a file named config.mak. This file is imported by the main Makefile automatically and is intended to be used like this for user settings. If you really need to disable pthreads, then you can add NO_PTHREADS=1. Check out the comments at the top of the Makefile for a list of all variables that can be set.

> The quick-install-man target still failed,
Strange.  You tried _after_ you installed git right?
-Brandon
Brandon Casey· Sep 20, 2010, 19:18 UTC · re: Brandon Casey · lore

Re: Reduced privileges install

On 09/20/2010 02:12 PM, Brandon Casey wrote:
> On 09/20/2010 11:56 AM, Andrew Keller wrote:
>> The quick-install-man target still failed,
> 
> Strange.  You tried _after_ you installed git right?

Oh, _and_ you're building within a checkout of the git repository right? Not, within the extraction of a tar archive?

i.e.
   git clone git://git.kernel.org/pub/scm/git/git.git
   cd git
   make
not
   wget http://kernel.org/pub/software/scm/git/git-1.7.2.3.tar.gz
   tar zxf git-1.7.2.3.tar.gz
   cd git
   make
-Brandon
Andrew Keller· Sep 20, 2010, 20:39 UTC · re: Brandon Casey · lore

Re: Reduced privileges install

On Sep 20, 2010, at 3:18 PM, Brandon Casey wrote:
Show 8 quoted lines
> On 09/20/2010 02:12 PM, Brandon Casey wrote:
>> On 09/20/2010 11:56 AM, Andrew Keller wrote:
>> 
>>> The quick-install-man target still failed,
>> 
>> Strange.  You tried _after_ you installed git right?
> 
> Oh, _and_ you're building within a checkout of the git repository right?  Not, within the extraction of a tar archive?
Oh, yea...  Forgot about that.  Yea, the quick-install-man target works just fine.

Thanks, ~ Andrew Keller

Andrew Keller· Sep 20, 2010, 22:53 UTC · re: Brandon Casey · lore

Re: Reduced privileges install

On Sep 20, 2010, at 3:12 PM, Brandon Casey wrote:
Show 5 quoted lines
> On 09/20/2010 11:56 AM, Andrew Keller wrote:
> 
>> This is what it took to compile Git on this server without root privileges (Solaris 8 / Sparc):
> 
> I thought it was Solaris 9? :)
Ah, you're right; I didn't catch that.  The documentation for the server says Solaris 8, but uname -a says "SunOS hpl 5.9 Generic_122300-54 sun4u sparc SUNW,UltraAX-i2".  I'd trust uname, so that makes this Solaris 9.
Show 42 quoted lines
>> # compile and install git
>> $ ln -s /usr/local/bin/tclsh8.4 /usr/users/students/ak4390/.local/bin/tclsh
> 
> You can set TCL_PATH instead of creating this symbolic link.
> 
>> $ export CC=/usr/local/bin/gcc
>> $ cd <path-to-git-src>
>> $ ./configure --prefix=/usr/users/students/ak4390/.local --with-python=/usr/local/bin/python --enable-pthreads=no
>> $ make NO_PERL_MAKEMAKER=1 all install
>> 
>> Letting the configure figure out the threading did not seem to work.
>> The compile and install worked, with lots of warnings from gcc about not
>> recognizing -pthreads, but when you try to do a clone, git complained about
>> not being able to fork off the demultiplexer.  So I just turned off threading
>> and it works.
> 
> Maybe the configure script is broken with respect to detecting threads on
> Solaris 8 (or 9)?  You probably don't really need to run the configure
> script on your platform.  I don't.  Since you're using gcc to compile, the
> default pthread switch '-lpthread' should be appropriate.  You could try
> deleting the config.mak.autogen file that configure creates, and just run
> make by itself.  Based on what you've describe, it would look something
> like this:
> 
>   cd <path-to-git-src>
>   rm config.mak.autogen
>   cat >config.mak <<EOF
> CC=/usr/local/bin/gcc
> PREFIX=/usr/users/students/ak4390/.local
> PYTHON_PATH=/usr/local/bin/python
> TCL_PATH=/usr/local/bin/tclsh8.4
> NO_PERL_MAKEMAKER=1
> EOF
>   make
> 
> Then add 'install' to the make command line when you are ready.
> 
> Notice, I placed all of the make settings in a file named config.mak.  This
> file is imported by the main Makefile automatically and is intended to be
> used like this for user settings.  If you really need to disable pthreads,
> then you can add NO_PTHREADS=1.  Check out the comments at the top of the
> Makefile for a list of all variables that can be set.
Compiling as described above appears to go down in flames:
$ make
/bin/sh: curl-config: not found
    CC fast-import.o
In file included from builtin.h:4,
                 from fast-import.c:147:
git-compat-util.h:140:25: openssl/ssl.h: No such file or directory
git-compat-util.h:141:25: openssl/err.h: No such file or directory
In file included from builtin.h:6,
                 from fast-import.c:147:
cache.h:9:21: openssl/sha.h: No such file or directory
In file included from fast-import.c:156:
csum-file.h:10: error: syntax error before "SHA_CTX"
csum-file.h:10: warning: no semicolon at end of struct or union
csum-file.h:15: error: 'crc32' redeclared as different kind of symbol
/usr/local/include/zlib.h:1285: error: previous declaration of 'crc32' was here
csum-file.h:15: error: 'crc32' redeclared as different kind of symbol
/usr/local/include/zlib.h:1285: error: previous declaration of 'crc32' was here
csum-file.h:17: error: syntax error before '}' token
fast-import.c: In function `store_object':
fast-import.c:995: error: `SHA_CTX' undeclared (first use in this function)
fast-import.c:995: error: (Each undeclared identifier is reported only once
fast-import.c:995: error: for each function it appears in.)
fast-import.c:995: error: syntax error before "c"
fast-import.c:1000: warning: implicit declaration of function `SHA1_Init'
fast-import.c:1000: error: `c' undeclared (first use in this function)
fast-import.c:1001: warning: implicit declaration of function `SHA1_Update'
fast-import.c:1003: warning: implicit declaration of function `SHA1_Final'
fast-import.c: At top level:
fast-import.c:1118: error: syntax error before "SHA_CTX"
fast-import.c: In function `truncate_pack':
fast-import.c:1120: error: `to' undeclared (first use in this function)
fast-import.c:1126: error: dereferencing pointer to incomplete type
fast-import.c:1127: error: dereferencing pointer to incomplete type
fast-import.c:1128: error: dereferencing pointer to incomplete type
fast-import.c:1128: error: `ctx' undeclared (first use in this function)
fast-import.c: In function `stream_blob':
fast-import.c:1140: error: `SHA_CTX' undeclared (first use in this function)
fast-import.c:1140: error: syntax error before "c"
fast-import.c:1154: error: `pack_file_ctx' undeclared (first use in this function)
fast-import.c:1154: error: dereferencing pointer to incomplete type
fast-import.c:1160: error: `c' undeclared (first use in this function)
make: *** [fast-import.o] Error 1
And, this is the same source tree that just worked a minute ago, when I used configure/make/make install.  I then copied the entire source folder, with the modified config.mak file, to my laptop running Snow Leopard, modified the variables in the config.mak file to match the system, and it compiled and installed just fine.  So, this server seems to have a problem with not running the configure script first.
~ Andrew Keller
Brandon Casey· Sep 20, 2010, 23:20 UTC · re: Andrew Keller · lore

Re: Reduced privileges install

On 09/20/2010 05:53 PM, Andrew Keller wrote:
Show 29 quoted lines
> On Sep 20, 2010, at 3:12 PM, Brandon Casey wrote:
>>  You could try
>> deleting the config.mak.autogen file that configure creates, and just run
>> make by itself.  Based on what you've describe, it would look something
>> like this:
>>
>>   cd <path-to-git-src>
>>   rm config.mak.autogen
>>   cat >config.mak <<EOF
>> CC=/usr/local/bin/gcc
>> PREFIX=/usr/users/students/ak4390/.local
>> PYTHON_PATH=/usr/local/bin/python
>> TCL_PATH=/usr/local/bin/tclsh8.4
>> NO_PERL_MAKEMAKER=1
>> EOF
>>   make
>>
>> Then add 'install' to the make command line when you are ready.
>>
>> Notice, I placed all of the make settings in a file named config.mak.  This
>> file is imported by the main Makefile automatically and is intended to be
>> used like this for user settings.  If you really need to disable pthreads,
>> then you can add NO_PTHREADS=1.  Check out the comments at the top of the
>> Makefile for a list of all variables that can be set.
> 
> Compiling as described above appears to go down in flames:
> 
> $ make
> /bin/sh: curl-config: not found

At this point, the above is just a warning that curl-config is not in your path. If curl is not installed on your system, you need to set NO_CURL=1.

Show 5 quoted lines
>     CC fast-import.o
> In file included from builtin.h:4,
>                  from fast-import.c:147:
> git-compat-util.h:140:25: openssl/ssl.h: No such file or directory
> git-compat-util.h:141:25: openssl/err.h: No such file or directory
<snip other related warnings>
Fixed by setting NO_OPENSSL=1.
Show 6 quoted lines
> And, this is the same source tree that just worked a minute ago, when
> I used configure/make/make install.  I then copied the entire source
> folder, with the modified config.mak file, to my laptop running Snow Leopard,
> modified the variables in the config.mak file to match the system, and it
> compiled and installed just fine.  So, this server seems to have a problem
> with not running the configure script first.

git's configure script is a little different from the configure scripts in other projects. All configure does in git is set variables that are used by the Makefile. Using its rules, it tries to figure out what the best setting is for each variable. Any of these variables can be set manually in the user's config.mak file. Apparently, additional variables need to be modified from their default to handle your system. Once you determine the set of variables that need to be set, they most likely will not need to be changed when compiling future versions of git.

The above two variables (NO_CURL, NO_OPENSSL) will likely fix the errors that you reported, but I don't guarantee that more errors will not be produced and will require additional settings. All of the variables are described in the comments at the top of the Makefile. It's an iterative process. You could also use the config.mak.autogen as the baseline for you config.mak file.

-Brandon

← back to recent threads