git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Kapil Somani <kmsomani@alumni.ncsu.edu>,  git@vger.kernel.org
Subject: Re: `git p4` broken on machines which do not have python on path
Date: Thu, 06 Feb 2025 15:17:13 -0800	[thread overview]
Message-ID: <xmqqmseyhddy.fsf@gitster.g> (raw)
In-Reply-To: <Z6U1GoGVA7IiPg3A@tapette.crustytoothpaste.net> (brian m. carlson's message of "Thu, 6 Feb 2025 22:18:02 +0000")

"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> On 2025-02-06 at 02:12:02, Kapil Somani wrote:
>> Thanks for quick response Brian
>> 
>> Yes, our team compiles git for use within our organization.
>> I'll reach out to them and see if they can provide path during build.
>> 
>> Meanwhile, I was able to update copy of the git (compiled by my team) to
>> use python3 on shebang line.
>> It appears that the git-p4 is compatible with Python3. Is git team planning
>> to update it near future?
>
> It's my understanding that it's designed to work with both Python 2 and
> 3.  It's unlikely that the shebang will be updated until it's no longer

Correct.  The CI has jobs to try git-p4 with both python2 and python3
since Mar 2020.

> guaranteed to work with Python 2, since `python` is more generic than
> `python3`.  When that is, I don't know, since I don't use Perforce and
> don't maintain git-p4, which has a separate maintainer.

I am not sure what story about shebang is discussed here.

If the complaint is "your script says '/usr/bin/env python', but my
users don't have 'python' on their $PATH", I think that is barking
up a wrong tree.  As a general principle, we try not to rely on
"env".

Just like other scripts, we munge git-p4.py script to replace the
shebang line to use the path to the python binary specified by the
builder into resulting git-p4 "executable" file that is installed.

We do this (not specifically for git-p4 but as a general principle)
because we do not want to get affected by random customized versions
of stuff end-users install on their $PATH that overrides the ones
from the system that builders determined to be used by Git.

Is the complaint that "on my system there are /usr/bin/python2 and
/usr/bin/python3 but no vanilla /usr/bin/python installed"?  

So it is your responsibility to tell the build procedure that you
want to use "/usr/bin/python3", as the build procedure defaults to
"/usr/bin/python" when you do not specify any.

      reply	other threads:[~2025-02-06 23:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06  1:27 `git p4` broken on machines which do not have python on path Kapil Somani
2025-02-06  1:46 ` brian m. carlson
2025-02-06  2:16   ` Illia Bobyr
     [not found]   ` <CANF_+=7hM7QqLNE3d4=UO-8erYoeQwYG5SrsDTXtgqZq3AKJwg@mail.gmail.com>
2025-02-06 22:18     ` brian m. carlson
2025-02-06 23:17       ` 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

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

  git send-email \
    --in-reply-to=xmqqmseyhddy.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kmsomani@alumni.ncsu.edu \
    --cc=sandals@crustytoothpaste.net \
    /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).