From: "Torsten Bögershausen" <tboegi@web.de>
To: "Randy J. Ray" <rjray@blackperl.com>, git@vger.kernel.org
Subject: Re: Git's Perl scripts can fail if user is configured for perlbrew
Date: Mon, 29 Dec 2014 14:40:39 +0100 [thread overview]
Message-ID: <54A159D7.5010307@web.de> (raw)
In-Reply-To: <54A085D1.8060407@blackperl.com>
On 2014-12-28 23.36, Randy J. Ray wrote:
> I use git on MacOS via homebrew (http://brew.sh/), and a custom Perl installation built and managed via perlbrew (http://perlbrew.pl/). At some point, commands like "git add -i" broke. I say "at some point", because I'm not a git power-user and I only just noticed it this week.
>
> I am running Git 2.2.1 with a perlbrew'd Perl 5.20.1. When I would run "git add -i" (or "git add -p"), it would immediately die with a signal 11. Some poking around showed that those git commands that are implemented as Perl scripts run under /usr/bin/perl, and also prefix some directories to the module search-path. The problem stems from the fact that, when you are using perlbrew, you also have the PERL5LIB environment variable set. The contents of it lay between the git-provided paths and the default contents of @INC. When the Git module is loaded, it (eventually) triggers a load of List::Util, whose C-level code fails to load because of a version mismatch; you got List::Util from the paths in PERL5LIB, but it doesn't match the version of perl from /usr/bin/perl.
>
> After poking around and trying a few different things, I have found that using the following line in place of "#!/usr/bin/perl" solves this problem:
>
> #!/usr/bin/env perl
>
> This can be done by defaulting PERL_PATH to "/usr/bin/env perl" in Makefile.
>
> I don't know enough about the overall git ecosystem to know if this would have an adverse effect on anything else (in particular, Windows compatibility, but then Windows probably isn't having this issue in the first place).
>
> I could just create and mail in the one-line patch for this, but I thought it might be better to open it up for some discussion first?
>
> Randy
Having problems with different perl installations is not an unknown problem
in Git, I would say.
And Git itself is prepared to handle this situation:
In Makefile I can read:
# Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl).
(What Git can not decide is which perl it should use, the one pointed out by $PATH or /usr/bin/perl.)
What does
"type perl" say ?
And what happens when you build and install Git like this:
PERL_PATH=/XX/YY/perl make install
-----------
Are you thinking about changing
ifndef PERL_PATH
PERL_PATH = /usr/bin/perl
endif
-- into --
ifndef PERL_PATH
PERL_PATH = $(shell which perl)
endif
---
At first glance that could make sense, at least to me.
next prev parent reply other threads:[~2014-12-29 13:40 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
2014-12-29 23:09 ` Kang-min Liu
2014-12-29 13:40 ` Torsten Bögershausen [this message]
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=54A159D7.5010307@web.de \
--to=tboegi@web.de \
--cc=git@vger.kernel.org \
--cc=rjray@blackperl.com \
/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).