Skip to contentSkip to conversation

python3-ninja: New recipe

PATCH Ross Burton 1 participant 1 message Mar 20, 2023

lore
Share & tools
lore
#0 lore raw

The patch is missing an explanation, an Upstream-Status, and your Signed-off-by.

Review

Quoted 5 lines
(quoted diff) +5 -0
+SUMMARY = "Ninja is a small build system with a focus on speed"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE_Apache_20;md5=19cbd64715b51267a47bf3750cc6a8a5"
+
+DEPENDS = "ninja-native cmake-native python3-scikit-build-native”

All of these depends are to build a binary that we immediately delete which is very sad.

Review

Quoted 11 lines
(quoted diff) +11 -0
+SRC_URI += " \
+ file://CMakeLists.txt \
+ file://run-ninja-from-path.patch \
+"
+
+addtask do_patchbuild after do_patch before do_configure
+
+do_patchbuild () {
+ rm -f ${S}/CMakeLists.txt
+ cp ${WORKDIR}/CMakeLists.txt ${S}/
+}

You can do this by setting subdir in SRC_URI: file://CMakeLists.txt;subdir=${S} will put the file directly into ${S} for you.

Quoted 4 lines

+RDEPENDS:${PN} = " \
+ ninja \
+ python3-scikit-build \
+”

This dependency on scikit-build means that anything that wants to use ninja on target pulls cmake into the image too.

This dependency isn’t needed at all because it only happens when the code is being ran in the build tree, which obviously a package won’t ever do.

Did you test this recipe? I believe that nothing you’ve tested actually uses the ‘import ninja’ functionality:

root@qemuarm64:~# python3 -mninja
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/ninja/__init__.py", line 13, in <module>
    from .ninja_syntax import Writer, escape, expand  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'ninja.ninja_syntax'

If nothing actually uses the ninja module, then a simple recipe that simply RDEPENDS on ninja and claims the name would work better.

Ross