git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Patrick Steinhardt <ps@pks.im>, Todd Zullinger <tmz@pobox.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] global: resolve Perl executable via PATH
Date: Wed, 5 Apr 2023 21:27:48 -0500	[thread overview]
Message-ID: <CAMP44s2VuvP_mhLSXXyC1__GGYhfQM4Td-bghOE3AmqfQW0Czw@mail.gmail.com> (raw)
In-Reply-To: <xmqqv8iaw4n5.fsf@gitster.g>

On Wed, Apr 5, 2023 at 2:29 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Patrick Steinhardt <ps@pks.im> writes:
>
> >> I don't know what the right choice is for upstream Git, it
> >> can easily be argued in either direction. :)
> >
> > I agree, there is no clearly-superior choice -- both have their merits.
> > I'll probably send a v2 that only munges internal scripts that are used
> > as part of our build and testing infrastructure. That's the area I care
> > most about in this context anyway.
>
> My preference is
>
>  (1) not to touch scripts that are processed by Makefile to use
>      $PERL_PATH,
>
>  (2) fix callers of "./foo.pl" to invoke "$PERL_PATH ./foo.pl" where
>      the perl () { command "$PERL_PATH" "$@" } wrapper is not
>      avialable, and
>
>  (3) fix them to use "perl foo.pl" where the wrapper is visible.

That is orthogonal to the patch.

All those steps can be done *eventually* while the proposed patch is
applied *today*.

> That way, we can wean ourselves away from the assumption that perl
> interpreter should exist at /usr/bin/perl without introducing a new
> assumption that everybody's env should exist at /usr/bin/env.

The patch doesn't introduce such an assumption.

Changing the shebang only affects scripts that are 1) not processed by
the Makefile, and 2) not called as "${PERL_PATH-perl} foo.pl".

If your system does not have /usr/bin/env and everything you cared
about worked yesterday, it would still work with the patch applied
today.

Having a `#!/usr/bin/env perl` shebang is simply a good practice to
write in all scripts.

But that is just the *default*, nobody is being forced to actually use
that shebang because 1) the Makefile is still going to override that
and replace it with $PERL_PATH in generated scripts, and 2) the
scripts that do "$PERL_PATH ./foo.pl" are essentially overriding it
to, and so does 3).

I believe this is a red herring (which might be desirable to fix some day).

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2023-04-06  2:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 10:10 [PATCH] global: resolve Perl executable via PATH Patrick Steinhardt
2023-04-05 13:35 ` Felipe Contreras
2023-04-05 14:48   ` Patrick Steinhardt
2023-04-05 14:42 ` Todd Zullinger
2023-04-05 14:52   ` Patrick Steinhardt
2023-04-05 15:54     ` Todd Zullinger
2023-04-05 17:09       ` Felipe Contreras
2023-04-05 17:35       ` Patrick Steinhardt
2023-04-05 18:44         ` Junio C Hamano
2023-04-06  2:27           ` Felipe Contreras [this message]
2023-04-05 16:54     ` Jeff King
2023-04-05 17:32       ` Patrick Steinhardt
2023-04-05 18:15         ` Jeff King
2023-04-06  2:18           ` Felipe Contreras
2023-04-06  3:35             ` Jeff King
2023-04-06  8:03               ` Ævar Arnfjörð Bjarmason
2023-04-18  8:59                 ` Felipe Contreras
2023-04-06  8:07           ` Patrick Steinhardt
2023-04-05 18:28 ` Kristoffer Haugsbakk
2023-04-05 21:30 ` Eric Wong
2023-04-06  2:16   ` Felipe Contreras
2023-04-06  8:05   ` Ævar Arnfjörð Bjarmason
2023-04-06  3:26 ` Jeff King
2023-04-06  8:19   ` Patrick Steinhardt
2023-04-06  9:36     ` [PATCH] t/lib-httpd: pass PERL_PATH to CGI scripts Jeff King
2023-04-06 16:34       ` Junio C Hamano
2023-04-18  9:04       ` Felipe Contreras

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=CAMP44s2VuvP_mhLSXXyC1__GGYhfQM4Td-bghOE3AmqfQW0Czw@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    --cc=tmz@pobox.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).