Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+6 -7
+1 -1
Documentation/Makefile
··· 75 75 cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \ 76 76 PYTHONDONTWRITEBYTECODE=1 \ 77 77 BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ 78 - $(PYTHON) $(srctree)/scripts/jobserver-exec \ 78 + $(PYTHON3) $(srctree)/scripts/jobserver-exec \ 79 79 $(SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \ 80 80 $(SPHINXBUILD) \ 81 81 -b $2 \
+1 -1
Documentation/kbuild/makefiles.rst
··· 755 755 bits on the scripts nonetheless. 756 756 757 757 Kbuild provides variables $(CONFIG_SHELL), $(AWK), $(PERL), 758 - $(PYTHON) and $(PYTHON3) to refer to interpreters for the respective 758 + and $(PYTHON3) to refer to interpreters for the respective 759 759 scripts. 760 760 761 761 Example::
+1 -2
Makefile
··· 452 452 INSTALLKERNEL := installkernel 453 453 DEPMOD = depmod 454 454 PERL = perl 455 - PYTHON = python 456 455 PYTHON3 = python3 457 456 CHECK = sparse 458 457 BASH = bash ··· 507 508 508 509 export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC 509 510 export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL 510 - export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX 511 + export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX 511 512 export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD 512 513 export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE 513 514
+1 -1
arch/ia64/Makefile
··· 69 69 $(call if_changed,objcopy) 70 70 71 71 unwcheck: vmlinux 72 - -$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $< 72 + -$(Q)READELF=$(READELF) $(PYTHON3) $(srctree)/arch/ia64/scripts/unwcheck.py $< 73 73 74 74 archclean: 75 75
+1 -1
arch/ia64/scripts/unwcheck.py
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 4 # Usage: unwcheck.py FILE
+1 -1
scripts/jobserver-exec
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0+ 3 3 # 4 4 # This determines how many parallel tasks "make" is expecting, as it is