git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Can git choose perl at runtime?
@ 2018-12-19  3:09 John Passaro
  2018-12-19  3:17 ` Jonathan Nieder
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: John Passaro @ 2018-12-19  3:09 UTC (permalink / raw)
  To: git

I recently submitted my first patch using OSX and found the experience
frustrating, for reasons that have come up on the list before,
concerning git-send-email and perl dependencies that you need to be
root to update.

Last seen here:
https://public-inbox.org/git/878t55qga6.fsf@evledraar.gmail.com/

The struggle is that Mac's package manager Homebrew has opted,
apparently with some finality, to no longer support linking to a user
perl at build time. PERL_PATH is hard-coded to link to the system
perl, which means the user needs sudo to install the SSL libraries
required for send-email. So for send-email to work, you need to either
sudo cpan or build git yourself. The obvious solution here would be to
do /usr/bin/env perl, but in the above message Aevar pointed out
pitfalls with that.

It seems that choosing perl at compile time necessarily comes with
tradeoffs. So I wonder if there is a way we can support choosing a
perl at runtime without breaking the existing mechanism of linking to
perl at compile time.

I'm picturing adding an executable "git-perl" to libexec that checks
config core.perlPath and envvar GIT_PERL_PATH, in some order. Having
chosen one of these or the build-time PERL_PATH as a last resort, it
exec's the correct perl executable.

Then relevant scripts (e.g. git-add--interactive, git-send-email)
invoke git-perl instead of /usr/bin/perl, and the makefile no longer
replaces that with PERL_PATH -- instead that will be used at runtime
via git-perl when we can be sure the user does not explicitly prefer
something different.

That does mean we have a new command to support and document: "git
perl". If it is preferred to keep this hidden as an implementation
detail, we could call the executable something like "util-git-perl"
instead so that it doesn't show up when scanning libexec for git
commands.

Does this seem like a good idea? I'd be happy to work on a patch.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-12-28 15:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19  3:09 Can git choose perl at runtime? John Passaro
2018-12-19  3:17 ` Jonathan Nieder
2018-12-19  6:33 ` Carlo Arenas
2018-12-19 13:53   ` Ævar Arnfjörð Bjarmason
2018-12-19 13:43 ` Ævar Arnfjörð Bjarmason
2018-12-21 23:42 ` brian m. carlson
2018-12-23 22:05   ` Ævar Arnfjörð Bjarmason
2018-12-23 23:18     ` brian m. carlson
2018-12-23 23:34       ` Ævar Arnfjörð Bjarmason
2018-12-24  2:20         ` brian m. carlson
2018-12-28 15:38           ` John Passaro

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).