summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-03 16:32:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-04 17:14:15 +0000
commited2ba22d108f79cc0f9e9aa555862158f61793ea (patch)
treec142e4393ca30f776559081585c85aea3902eca1 /meta/recipes-devtools/python
parent306f7b5ca101ec139572203e222d28610f2b5797 (diff)
downloadpoky-ed2ba22d108f79cc0f9e9aa555862158f61793ea.tar.gz
python3-native: Remove all pyc files
This removes a further 1600 files from sstate handling and lets python create the ones it wants at runtime which is likely much better overall for performance. (From OE-Core rev: 2d6490fa23cce58922a1b54f87c8369925ff8f90) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/python3_3.10.2.bb13
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/recipes-devtools/python/python3_3.10.2.bb b/meta/recipes-devtools/python/python3_3.10.2.bb
index b28aa6505a..41b7b92b34 100644
--- a/meta/recipes-devtools/python/python3_3.10.2.bb
+++ b/meta/recipes-devtools/python/python3_3.10.2.bb
@@ -156,14 +156,19 @@ do_install:append:class-native() {
156 # Remove the opt-1.pyc and opt-2.pyc files. There are over 3,000 of them 156 # Remove the opt-1.pyc and opt-2.pyc files. There are over 3,000 of them
157 # and the overhead in each recipe-sysroot-native isn't worth it, particularly 157 # and the overhead in each recipe-sysroot-native isn't worth it, particularly
158 # when they're only used for python called with -O or -OO. 158 # when they're only used for python called with -O or -OO.
159 find ${D} -name *opt-*.pyc -delete 159 #find ${D} -name *opt-*.pyc -delete
160 # Remove all pyc files. There are a ton of them and it is probably faster to let
161 # python create the ones it wants at runtime rather than manage in the sstate
162 # tarballs and sysroot creation.
163 find ${D} -name *.pyc -delete
164
160} 165}
161 166
162do_install:append() { 167do_install:append() {
163 for c in ${D}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do 168 for c in ${D}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do
164 python3 ${WORKDIR}/reformat_sysconfig.py $c 169 python3 ${WORKDIR}/reformat_sysconfig.py $c
165 done 170 done
166 rm ${D}${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sysconfigdata*.cpython* 171 rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sysconfigdata*.cpython*
167 172
168 mkdir -p ${D}${libdir}/python-sysconfigdata 173 mkdir -p ${D}${libdir}/python-sysconfigdata
169 sysconfigfile=`find ${D} -name _sysconfig*.py` 174 sysconfigfile=`find ${D} -name _sysconfig*.py`
@@ -182,8 +187,8 @@ do_install:append() {
182 # Upstream is discussing ways to solve the issue properly, until then let's 187 # Upstream is discussing ways to solve the issue properly, until then let's
183 # just not install the problematic files. 188 # just not install the problematic files.
184 # More info: http://benno.id.au/blog/2013/01/15/python-determinism 189 # More info: http://benno.id.au/blog/2013/01/15/python-determinism
185 rm ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython* 190 rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython*
186 rm ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_xml_etree.cpython* 191 rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_xml_etree.cpython*
187} 192}
188 193
189do_install:append:class-nativesdk () { 194do_install:append:class-nativesdk () {