git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Randy J. Ray" <rjray@blackperl.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>, Kang-min Liu <gugod@gugod.org>
Subject: Re: Git's Perl scripts can fail if user is configured for perlbrew
Date: Mon, 29 Dec 2014 15:07:40 -0600	[thread overview]
Message-ID: <54A1C29C.4090100@blackperl.com> (raw)
In-Reply-To: <CACBZZX4qKyfRcbowYnM-KsrbKZ2=9RXr+HEgrOU1jaCsSX53QA@mail.gmail.com>

On 12/29/14, 7:21 AM, Ævar Arnfjörð Bjarmason wrote:
> [CC'd the perlbrew author]
>
> This is a bit of a tricky issue.
>
> Using whatever perl is defined in the environment is just as likely to
> break, in general the build process tries to pick these assets at
> compile-time. Imagine you're experimenting with some custom perl
> version and now Git inexplicably breaks.
>
> It's better if Git detects a working perl when you compile it and
> sticks with that, which is why we use /usr/bin/perl by default.

These are good points. I'm not sure when this stopped working for me... 
I don't use the -i or -p options to "git add" very often. So I can't say 
at what point it stopped working with the current configuration, only 
that it "used to work".

> When you're setting PERL5LIB you're indicating to whatever perl
> interpreter you're going to run that that's where they it should pick
> up its modules. IMO they way perlbrew does this is broken, instead of
> setting PATH + PERL5LIB globally for your login shell it should set
> the PATH, and then the "perl" in that path should be a pointer to some
> small shellscript that sets PERL5LIB for *its* perl.

That would be for the perlbrew author to consider, of course.

> I don't know what the right tradeoff here is, but I think it would be
> just as sensible to unset PERL5LIB in our own perl scripts + modules,
> it would make live monkeypatching when you wanted to harder, but we
> could always add a GITPERL5LIB or something...

You would have to have a shell script that un-set PERL5LIB and then 
invoked the given git script, because by the time script execution has 
begun, the contents of PERL5LIB have already been added to the head of 
the list of search paths. One approach I tried was to set the 
environment variable GITPERLLIB (which you already use and recognize, so 
there is no need for GITPERL5LIB), but that did not help. The base 
problem still remained: The content of PERL5LIB (which pointed to 
5.20.1-compiled extensions) took priority over the default @INC contents 
(which were for a 5.16.2 perl).

I don't know the right trade-off, either. I started out reporting this 
as an issue against the homebrew project's recipe for git, because they 
actually add more explicit library paths to @INC than a vanilla 
build/install of git does. But the problem is really in the interaction 
between /usr/bin/perl and a PERL5LIB set for an alternate perl. So the 
solution, if there is one, will lay here in git somewhere...

Randy
-- 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray      Sunnyvale, CA      http://www.dereferenced.com
rjray@blackperl.com
twitter.com/rjray
Silicon Valley Scale Modelers: http://www.svsm.org

  reply	other threads:[~2014-12-29 21:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-28 22:36 Git's Perl scripts can fail if user is configured for perlbrew Randy J. Ray
2014-12-29 13:21 ` Ævar Arnfjörð Bjarmason
2014-12-29 21:07   ` Randy J. Ray [this message]
2014-12-29 23:09     ` Kang-min Liu
2014-12-29 13:40 ` Torsten Bögershausen
2014-12-29 21:57   ` Randy J. Ray
2014-12-29 23:16     ` Ævar Arnfjörð Bjarmason
2015-01-02  3:08 ` Ben Aveling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54A1C29C.4090100@blackperl.com \
    --to=rjray@blackperl.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gugod@gugod.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).