kbuild: remove PYTHON variable
Subsystems (2)
PATCH 1/1 kbuild: remove PYTHON variable
Python retired in 2020, and some distributions do not provide the 'python' command any more.
As in commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), we need to use more specific 'python3' to invoke scripts even if they are written in a way compatible with both Python 2 and 3.
This commit removes the variable 'PYTHON', and switches the existing users to 'PYTHON3'.
BTW, PEP 394 (https://www.python.org/dev/peps/pep-0394/) is a helpful material.
---
Documentation/Makefile | 2 +- Documentation/kbuild/makefiles.rst | 2 +- Makefile | 3 +-- arch/ia64/Makefile | 2 +- arch/ia64/scripts/unwcheck.py | 2 +- scripts/jobserver-exec | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-)
Documentation/Makefile +1 -1
@@ -75,7 +75,7 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \ PYTHONDONTWRITEBYTECODE=1 \ BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ - $(PYTHON) $(srctree)/scripts/jobserver-exec \ + $(PYTHON3) $(srctree)/scripts/jobserver-exec \ $(SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \ $(SPHINXBUILD) \ -b $2 \
Documentation/kbuild/makefiles.rst +1 -1
@@ -755,7 +755,7 @@ more details, with real examples. bits on the scripts nonetheless. Kbuild provides variables $(CONFIG_SHELL), $(AWK), $(PERL), - $(PYTHON) and $(PYTHON3) to refer to interpreters for the respective + and $(PYTHON3) to refer to interpreters for the respective scripts. Example::
Makefile +1 -2
@@ -452,7 +452,6 @@ AWK = awk INSTALLKERNEL := installkernel DEPMOD = depmod PERL = perl -PYTHON = python PYTHON3 = python3 CHECK = sparse BASH = bash
@@ -508,7 +507,7 @@ CLANG_FLAGS : export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL -export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX +export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
arch/ia64/Makefile +1 -1
@@ -69,7 +69,7 @@ vmlinux.bin: vmlinux FORCE $(call if_changed,objcopy) unwcheck: vmlinux - -$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $< + -$(Q)READELF=$(READELF) $(PYTHON3) $(srctree)/arch/ia64/scripts/unwcheck.py $< archclean:
arch/ia64/scripts/unwcheck.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # # Usage: unwcheck.py FILE
scripts/jobserver-exec +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0+ # # This determines how many parallel tasks "make" is expecting, as it is
Signature · 1 line
2.27.0
Jonathan Corbet
maintainerQuoted 7 lines · Masahiro Yamada
Python retired in 2020, and some distributions do not provide the 'python' command any more.
As in commit
51839e29cb59("scripts: switch explicitly to Python 3"), we need to use more specific 'python3' to invoke scripts even if they are written in a way compatible with both Python 2 and 3.
Quoted 7 lines
This commit removes the variable 'PYTHON', and switches the existing users to 'PYTHON3'.
BTW, PEP 394 (https://www.python.org/dev/peps/pep-0394/) is a helpful material.
Signed-off-by Masahiro Yamada <[email protected]>
So this will have the effect of making the docs build impossible for folks who only have Python 2. As I said before, this is a step that we knew was coming, we just hadn't decided on the exact timing - I guess this decides for us :)
That said, I'll copy linux-doc to see if anybody screams. I assume this is a 5.12 change?
Thanks,
jon
Quoted 13 lines · Jonathan Corbet
Quoted 10 lines · Masahiro Yamada
Python retired in 2020, and some distributions do not provide the 'python' command any more.
As in commit
51839e29cb59("scripts: switch explicitly to Python 3"), we need to use more specific 'python3' to invoke scripts even if they are written in a way compatible with both Python 2 and 3.This commit removes the variable 'PYTHON', and switches the existing users to 'PYTHON3'.
Quoted 7 lines
Quoted 4 lines
BTW, PEP 394 (https://www.python.org/dev/peps/pep-0394/) is a helpful material.
Signed-off-by Masahiro Yamada <[email protected]>So this will have the effect of making the docs build impossible for folks who only have Python 2.
Is this a problem? Python 2 is EOL.
Everybody who wants to use Python must install Python 3.
Rather, people are screaming
that the 'python' command does not exist.
Quoted 6 lines
As I said before, this is a step that we
knew was coming, we just hadn't decided on the exact timing - I guess this decides for us :)That said, I'll copy linux-doc to see if anybody screams. I assume this is a 5.12 change?
No, I am planning to do this for 5.11
(a pull request this week if there is no objection).
Quoted 4 lines
Thanks,
jon
Signature · 2 lines
Best Regards Masahiro Yamada
Jonathan Corbet
maintainerQuoted 8 lines · Masahiro Yamada
Quoted 2 lines · Jonathan Corbet
So this will have the effect of making the docs build impossible for folks who only have Python 2.
Is this a problem? Python 2 is EOL.
Everybody who wants to use Python
must install Python 3.
I honestly don't know, but people do keep things around for a surprisingly long time.
Quoted 9 lines
Quoted 6 lines
As I said before, this is a step that we
knew was coming, we just hadn't decided on the exact timing - I guess this decides for us :)That said, I'll copy linux-doc to see if anybody screams. I assume this is a 5.12 change?
No, I am planning to do this for 5.11
(a pull request this week if there is no objection).
I'm not going to truly object and try to block this, but I worry that it's soon and without warning. It's not a change I would merge for -rc7. IMO this should be done in 5.12 with an appropriate note added to Documentation/process/changes.rst as well.
Thanks,
jon