git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Pat Pannuto <pat.pannuto@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/2] Use env for all perl invocations
Date: Thu, 12 Jan 2017 00:21:38 -0800	[thread overview]
Message-ID: <xmqqshoolmct.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAAnLKaHrGkAkF+kZtrawDSkuhVkvvUZONp6PQj6=3AGoAwFxyw@mail.gmail.com> (Pat Pannuto's message of "Thu, 12 Jan 2017 02:13:03 -0500")

Pat Pannuto <pat.pannuto@gmail.com> writes:

> It feels weird to me that the perl path is fixed at
> compile/install-time as opposed to run-time discovery -- this means
> users can't change their perl install without breaking git?

Among the software packages that use interpreters like perl, python,
ruby, etc., there are ones that seem to consider that it is a good
idea to let "#!/usr/bin/env $language" pick whatever variant
[*1*] of the $language that happens to be on end-user's $PATH.

Git does not subscribe to that thought, and it is done for very good
reasons.

When you take a popular $language used by many software packages, it
is more than likely that one particular end user uses more than one
such package written in the same $language.  If one assumes that
there is one variant of $language such software packages can all
use, then $PATH can be tweaked so that the common variant and no
other variants of $language can be found and you are done.

However, that is too simplistic in real life.  If you are using Git
(which wants Perl 5.8 or later with certain libs) and some other
software package that needs a much older Perl, there is no such
single variant that can be placed on end-user's $PATH.  Only when
all the other software packages write their she-bang line without
"env" and instead point at the exact variant they need, Git can use
the "env" to rely on $PATH, but at that point, Git is being overly
arrogant.  It insists to be special among packages that use the same
$language and wants the variant it needs to be on $PATH.

Git knows that the real-world is not simplistic.  Git is not
arrogant, either.  And that is why it does not use "#!/usr/bin/env".


[Footnote]

*1* Here a "variant" of a $language refers to a binary of one
    particular version of the $language, together with libs and
    extensions it uses that are installed on the system.  You
    apparently have two variants, one installed as /usr/bin/perl,
    the other as /usr/local/bin/perl.

      reply	other threads:[~2017-01-12  8:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  5:51 [PATCH 0/2] Use env for all perl invocations Pat Pannuto
2017-01-12  5:51 ` [PATCH 1/2] Convert all 'perl -w' to 'perl' + 'use warnings;' Pat Pannuto
2017-01-12  5:51 ` [PATCH 2/2] Use 'env' to find perl instead of fixed path Pat Pannuto
2017-01-12  6:27   ` Johannes Sixt
2017-01-12  7:17     ` Pat Pannuto
2017-01-12 10:21       ` Johannes Schindelin
2017-01-12 20:40         ` Junio C Hamano
2017-01-12 21:01           ` Pat Pannuto
2017-01-12 21:49             ` Junio C Hamano
2017-01-13  2:48             ` Eric Wong
2017-01-13 15:27               ` Johannes Schindelin
2017-01-13 16:58                 ` Eric Wong
2017-01-13 17:13                   ` Johannes Schindelin
2017-01-13 18:27               ` Junio C Hamano
2017-01-13 18:52                 ` Eric Wong
2017-01-13 20:01                   ` Junio C Hamano
2017-01-13 21:39                     ` Eric Wong
2017-01-14  7:54                   ` Jeff King
2017-01-14 10:31                     ` Eric Wong
2017-01-14 21:57                       ` brian m. carlson
2017-01-13 15:21             ` Johannes Schindelin
2017-01-12  6:21 ` [PATCH 0/2] Use env for all perl invocations Junio C Hamano
2017-01-12  7:13   ` Pat Pannuto
2017-01-12  8:21     ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqshoolmct.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pat.pannuto@gmail.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.
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).