All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] python3-native: Drop opt-1 and opt-2 pyc files
@ 2022-03-03 14:28 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2022-03-03 14:28 UTC (permalink / raw)
  To: openembedded-core

There are over 3,000 of these in python3-native (of 8,000+ files total) and
copying them to sysroots all the time seems pointless, particularly since
they're only used if python is run with the -O or -OO parameters.

Get rid of them and save the overhead. This is particularly pronounced in
builds using the api-documentation distro feature.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/python/python3_3.10.2.bb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-devtools/python/python3_3.10.2.bb b/meta/recipes-devtools/python/python3_3.10.2.bb
index 429839b6226..b28aa6505a0 100644
--- a/meta/recipes-devtools/python/python3_3.10.2.bb
+++ b/meta/recipes-devtools/python/python3_3.10.2.bb
@@ -152,6 +152,11 @@ do_install:append:class-native() {
         # (these often end up too long for the #! parser in the kernel as the
         # buffer is 128 bytes long).
         ln -s python3-native/python3 ${D}${bindir}/nativepython3
+
+        # Remove the opt-1.pyc and opt-2.pyc files. There are over 3,000 of them
+        # and the overhead in each recipe-sysroot-native isn't worth it, particularly
+        # when they're only used for python called with -O or -OO.
+        find ${D} -name *opt-*.pyc -delete
 }
 
 do_install:append() {
-- 
2.32.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-03 14:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 14:28 [PATCH] python3-native: Drop opt-1 and opt-2 pyc files Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.