Skip to contentSkip to conversation

Makefile: allow to override python3

PATCH New Andrey Zhizhikin 3 participants 3 messages May 1, 2021 – May 18, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: allow to override python3

Python3 taken from the PATH causes build issues when pylibfdt bindings are generated with Yocto SDK.

Python3 provided as a part of SDK is not compatible with host Python3, therefore binding build breaks with following errors:

scripts/dtc/pylibfdt/libfdt_wrap.c:154:11: fatal error: Python.h: No such file or directory
154 | # include <Python.h>

      |           ^~~~~~~~~~

Do not enforce the python3 from the PATH and make it conditionally-assigned so it can be overridden from outside of build system. Keep the default assignment to point to version that is taken from the PATH.

Similar fix has been introduced in b48bfc74ee ("tools: allow to override python"), where conditional assignment is used for python executable to address similar build errors.

Cc Simon Glass <[email protected]>
Fixes e91610da7c ("kconfig: re-sync with Linux 4.17-rc4")
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 404977efa5..f033ab39f2 100644
@@ -408,7 +408,7 @@ AWK		= awk
 PERL		= perl
 PYTHON		?= python
 PYTHON2		= python2
-PYTHON3		= python3
+PYTHON3		?= python3
 DTC		?= $(objtree)/scripts/dtc/dtc
 CHECK		= sparse
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 Makefile: allow to override python3

Quoted 19 lines · Andrey Zhizhikin

Python3 taken from the PATH causes build issues when pylibfdt bindings are generated with Yocto SDK.

Python3 provided as a part of SDK is not compatible with host Python3, therefore binding build breaks with following errors:

scripts/dtc/pylibfdt/libfdt_wrap.c:154:11: fatal error: Python.h: No such file or directory
154 | # include <Python.h>

      |           ^~~~~~~~~~

Do not enforce the python3 from the PATH and make it conditionally-assigned so it can be overridden from outside of build system. Keep the default assignment to point to version that is taken from the PATH.

Similar fix has been introduced in b48bfc74ee ("tools: allow to override python"), where conditional assignment is used for python executable to address similar build errors.

Quoted 6 lines
Cc Simon Glass <[email protected]>
Fixes e91610da7c ("kconfig: re-sync with Linux 4.17-rc4")
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw

PATCH 1/1 Makefile: allow to override python3

In reply to Andrey Zhizhikin
Quoted 14 lines · Andrey Zhizhikin

Python3 taken from the PATH causes build issues when pylibfdt bindings are generated with Yocto SDK.

Python3 provided as a part of SDK is not compatible with host Python3, therefore binding build breaks with following errors:

scripts/dtc/pylibfdt/libfdt_wrap.c:154:11: fatal error: Python.h: No such file or directory
154 | # include <Python.h>

      |           ^~~~~~~~~~

Do not enforce the python3 from the PATH and make it conditionally-assigned so it can be overridden from outside of build system. Keep the default assignment to point to version that is taken from the PATH.

Quoted 8 lines

Similar fix has been introduced in b48bfc74ee ("tools: allow to override python"), where conditional assignment is used for python executable to address similar build errors.

Cc Simon Glass <[email protected]>
Fixes e91610da7c ("kconfig: re-sync with Linux 4.17-rc4")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210518/bffb3c97/attachment.sig>