Skip to contentSkip to conversation

python: Avoid installing test data into recipe-sysroot

PATCH New Mikko Rapeli 1 participant 1 message Feb 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python: Avoid installing test data into recipe-sysroot

From: Richard Purdie <[email protected]>

There are several thousand files in the test directory which we don't need. Adding these for the native and target sysroots is a crazy amount of files to be throwing around needlessly. Delete the files from the sysroot side of things to tidy up the sysroots and improve performance.

(From OE-Core rev: f73ac290617e89b80e10dc700c0e90efddc8e1b2)

(cherry picked from commit f6bced03011ad1663d68b0322a2f8aeb4d836646)
---
 recipes-devtools/python/python_2.7.18.bb | 6 ++++++
 1 file changed, 6 insertions(+)
recipes-devtools/python/python_2.7.18.bb +6 -0
index bca2910d..6cbcffe8 100644
@@ -258,3 +258,9 @@ addtask do_create_manifest
 # Make sure we have native python ready when we create a new manifest
 do_create_manifest[depends] += "${PN}:do_prepare_recipe_sysroot"
 do_create_manifest[depends] += "${PN}:do_patch"
+
+# Python's tests contain large numbers of files we don't need in the recipe sysroots
+SYSROOT_PREPROCESS_FUNCS += " py_sysroot_cleanup"
+py_sysroot_cleanup () {
+       rm -rf ${SYSROOT_DESTDIR}${libdir}/python${PYTHON_MAJMIN}/test
+}
Signature · 1 line
2.20.1