Skip to content

Commit d8d2d38

Browse files
committed
kbuild: remove PYTHON variable
Python retired in 2020, and some distributions do not provide the 'python' command any more. As in commit 51839e2 ("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 <[email protected]>
1 parent ed4e9e6 commit d8d2d38

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

Documentation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
7575
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \
7676
PYTHONDONTWRITEBYTECODE=1 \
7777
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
78-
$(PYTHON) $(srctree)/scripts/jobserver-exec \
78+
$(PYTHON3) $(srctree)/scripts/jobserver-exec \
7979
$(SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \
8080
$(SPHINXBUILD) \
8181
-b $2 \

Documentation/kbuild/makefiles.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ more details, with real examples.
755755
bits on the scripts nonetheless.
756756

757757
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
759759
scripts.
760760

761761
Example::

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ AWK = awk
452452
INSTALLKERNEL := installkernel
453453
DEPMOD = depmod
454454
PERL = perl
455-
PYTHON = python
456455
PYTHON3 = python3
457456
CHECK = sparse
458457
BASH = bash
@@ -508,7 +507,7 @@ CLANG_FLAGS :=
508507

509508
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
510509
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
511-
export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
510+
export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
512511
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
513512
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
514513

arch/ia64/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ vmlinux.bin: vmlinux FORCE
6969
$(call if_changed,objcopy)
7070

7171
unwcheck: vmlinux
72-
-$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $<
72+
-$(Q)READELF=$(READELF) $(PYTHON3) $(srctree)/arch/ia64/scripts/unwcheck.py $<
7373

7474
archclean:
7575

arch/ia64/scripts/unwcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# SPDX-License-Identifier: GPL-2.0
33
#
44
# Usage: unwcheck.py FILE

scripts/jobserver-exec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# SPDX-License-Identifier: GPL-2.0+
33
#
44
# This determines how many parallel tasks "make" is expecting, as it is

0 commit comments

Comments
 (0)