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

Re: Question about PERL_PATH

From
Jeff King <peff@peff.net>
Date
May 8, 2011, 00:13 UTC
Message-ID
<20110508001326.GA13282@sigill.intra.peff.net>
In-Reply-To
<robbat2-20110507T174237-068953557Z@orbis-terrarum.net>
On Sat, May 07, 2011 at 06:02:48PM +0000, Robin H. Johnson wrote:
Show 10 quoted lines
> On Fri, May 06, 2011 at 09:05:08AM -0700,  Junio C Hamano wrote:
> > The variable is not PERL_COMMAND_LINE, but is PERL_PATH, so I think it
> > should expects the path to the program.
> > 
> > Our testsuite also rely on it being the path to the program by enclosing
> > the reference to it inside double quotes, to make sure that PERL_PATH set
> > to "/Program Files/Perl/perl.exe" works.  Didn't Gentoo folks see any test
> > breakage before shipping the ebuild procedure?
> The entire test suite completes fine with our
> PERL_PATH="${EPREFIX}/usr/bin/env perl" setting.

This is more luck than anything. For example, you are skipping all of the perl tests (t9700) and all of the git-svn tests (t91*), because they both try do something like:

  if ! "$PERL_PATH" -e "use SomeModule"; then
    skip_all="You don't have SomeModule installed"
  fi

So you are skipping many tests accidentally, and it is only luck that all such uses are currently tests that handle a broken "$PERL_PATH" in this way. It is entirely likely that this usage may end up causing a test suite failure at some point in the future.

If we want to support this use of env/, we need to provide separate Makefile variables for "what goes at the top of a perl script" and "what we use to run perl".

Show 13 quoted lines
> This was originally put into place because of our bug #326625 [1].
> From that bug:
> ====
> Git does not compile if local::lib installed in user's home directory if
> 'sudo' is used to raise privileges. Local::lib exports environment
> variable PERL5_MM_OPTS, which contains string INSTALL_BASE='...'.
> Variable PREFIX is set in package's Makefile.pl. Package will not
> compile if both of these variables are set.
> ====
> (Full logs attached in the bug).
> 
> If you can suggest a better way to fix the user's bug, I'll revert the
> PERL_PATH change.
It looks like we auto-build the perl bits of the Makefile by calling:
  $(PERL_PATH) Makefile.PL PREFIX=$(prefix) INSTALL_BASE=''

which seems to me like it should override local::lib's INSTALL_BASE (which also doesn't seem ideal, but I wouldn't expect it to cause this error). But surely the solution involves changing this line in perl/Makefile to handle the local::lib case?

I also don't see how this is git-specific. From my reading of the bug report, local::lib will fail to work any time the user does:

  perl Makefile.PL PREFIX=anything

which seems odd. Wouldn't other packages be running into this problem, then, too (i.e., anything which has a little bit of perl and automagically runs MakeMaker on behalf of the user)?

-Peff
Previous: Robin H. JohnsonNext: Drew Northup
Message 6 of 7 in “Question about PERL_PATH”
  1. Ian AbbottMay 6, 2011
  2. Michael J GruberMay 6, 2011
  3. Junio C HamanoMay 6, 2011
  4. Ian AbbottMay 6, 2011
  5. Robin H. JohnsonMay 7, 2011
  6. Jeff KingMay 8, 2011
  7. Drew NorthupMay 9, 2011

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.