Skip to contentSkip to conversation

package/ninja: invoke python3 explicitly to configure the package

PATCH Superseded Avi Shukron 2 participants 3 messages Nov 11, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/ninja: invoke python3 explicitly to configure the package

ninja depends on python3 specifically, but the configure.py file simply uses "env python". Where no python is selected for the target you simply won't get a python symlink in $(HOST_DIR)/usr/bin, so the configure.py script fails to run since it can't find "python".

Notice that in order to reproduce the issue, you must not have python2 installed on your host machine.

---
 package/ninja/ninja.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/ninja/ninja.mk +1 -1
index 4897012150..867b92c4c3 100644
@@ -17,7 +17,7 @@ NINJA_LICENSE_FILES = COPYING
 HOST_NINJA_DEPENDENCIES = host-python3
 
 define HOST_NINJA_BUILD_CMDS
-	(cd $(@D); ./configure.py --bootstrap)
+	(cd $(@D); $(HOST_DIR)/bin/python3 ./configure.py --bootstrap)
 endef
 
 define HOST_NINJA_INSTALL_CMDS
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 package/qemu: add host-python as an explicit dependency

qemu requires python in its configre script. Yet host-python was not listed as one of the package's dependencies. If no other package requested host-python, then configuring this package will fail since it won't find any executable named python in the host dir.

In order to reproduce this issue you must not have python2 installed on your host machine.

---
 package/qemu/qemu.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/qemu/qemu.mk +2 -2
index a91f9d3eeb..00d413b68d 100644
@@ -21,7 +21,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
 #-------------------------------------------------------------
 # Target-qemu
 
-QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
+QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman host-python
 
 # Need the LIBS variable because librt and libm are
 # not automatically pulled. :-(
@@ -182,7 +182,7 @@ $(eval $(generic-package))
 #-------------------------------------------------------------
 # Host-qemu
 
-HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
+HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman host-python
 
 #       BR ARCH         qemu
 #       -------         ----
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/2 package/ninja: invoke python3 explicitly to configure the package

In reply to Avi Shukron

Hello,

Quoted 19 lines · Avi Shukron

ninja depends on python3 specifically, but the configure.py file simply uses "env python". Where no python is selected for the target you simply won't get a python symlink in $(HOST_DIR)/usr/bin, so the configure.py script fails to run since it can't find "python".

Notice that in order to reproduce the issue, you must not have python2 installed on your host machine.

---
 package/ninja/ninja.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/ninja/ninja.mk +0 -0
index 4897012150..867b92c4c3 100644

package/ninja/ninja.mk NINJA_LICENSE_FILES = COPYING · line 20

Quoted 5 lines
package/ninja/ninja.mk +1 -1
@@ -17,7 +17,7 @@ NINJA_LICENSE_FILES = COPYING
 HOST_NINJA_DEPENDENCIES = host-python3
 
 define HOST_NINJA_BUILD_CMDS
-       (cd $(@D); ./configure.py --bootstrap)
+       (cd $(@D); $(HOST_DIR)/bin/python3 ./configure.py --bootstrap)

Well, I guess you can now remove the "./" before configure.py as now you explicitly call python3 before it.

Quoted 10 lines
package/ninja/ninja.mk +0 -1
 endef
 
 define HOST_NINJA_INSTALL_CMDS
--

2.17.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Asaf.