git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-instaweb portability issue (maybe?)

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 13, 2008, 14:22 UTC
Message-ID
<m3abhpqusj.fsf@localhost.localdomain>
In-Reply-To
<6dbd4d000806130626pfdb06f2qbfea6f1909710b7b@mail.gmail.com>
"Denis Bueno" <dbueno@gmail.com> writes:
Show 23 quoted lines
> I'm on OS X 10.4.11 on Intel using git 1.5.5.3.
> 
> I'd been trying to use the git-instaweb script (both with and without
> arguments) with lighttpd (which I installed through Macports) without
> success, seeing the following kind of bizarre error message:
> 
>     funsat[290] > git instaweb
>     /opt/local/bin/git-instaweb: line 6033: /usr/bin/env perl: No such
> file or directory
>     2008-06-13 09:09:31: (log.c.75) server started
> 
>     funsat[291] > 2008-06-13 09:09:31: (mod_cgi.c.998) CGI failed:
> Exec format error /Volumes/work/funsat/.git/gitweb/gitweb.cgi
>     mod_cgi.c.1001: aborted
>     2008-06-13 09:09:31: (mod_cgi.c.584) cgi died, pid: 23237
> 
> "/usr/bin/env perl: No such file or directory"? Huh?  I certainly have
> perl installed, so I don't know what that's about.
> 
> That line simply calls perl by the $PERL variable, which is set at the
> top of the script, like so:
> 
>     PERL='/usr/bin/env perl'

This depends on how git was build (on compile time configuration). git-instaweb.sh (source of git-instaweb) has

        PERL='@@PERL@@'

which is set to value of $PERL_PATH (or, to be more exact, its squoted version) during building git-instaweb. So you can simply use

  $ make PERL_PATH=/usr/bin/perl
  # make PERL_PATH=/usr/bin/perl install
or whatever, or you can use ./configure script
  $ make configure
  $ ./configure --with-perl=/usr/bin/perl
On Linux for example the path to perl is set explicitely, instead of
using "/usr/bin/env perl" construct.  The 'env' construct has the
following disadvantages:
 - it uses first Perl find in your $PATH, so if git works for you or
   don't work depends on user's personal configuration
   (reproductability, convenience and security).
 - AFAIK it doesn't allow to pass switches to Perl

P.S. Check if you have new enough Perl (there are problems with Unicode support in old Perl), and if you have CGI.pm new enough installed for gitweb.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Luciano Rocha
Message 14 of 14 in “git-instaweb portability issue (maybe?)”
  1. Denis BuenoJun 13, 2008
  2. Denis BuenoJun 13, 2008
  3. Asheesh LaroiaJun 13, 2008
  4. Denis BuenoJun 13, 2008
  5. Chris RiddJun 13, 2008
  6. Asheesh LaroiaJun 13, 2008
  7. Chris RiddJun 13, 2008
  8. Denis BuenoJun 13, 2008
  9. Luciano RochaJun 13, 2008
  10. Denis BuenoJun 13, 2008
  11. Luciano RochaJun 13, 2008
  12. Jakub NarebskiJun 13, 2008
  13. Luciano RochaJun 13, 2008
  14. Jakub NarebskiJun 13, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.