Thread (1 message) 1 message, 1 author, 2025-02-06

Re: `git p4` broken on machines which do not have python on path

From: Junio C Hamano <hidden>
Date: 2025-02-06 23:17:16

"brian m. carlson" [off-list ref] writes:
On 2025-02-06 at 02:12:02, Kapil Somani wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help