All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] python3-native: Drop opt-1 and opt-2 pyc files
Date: Thu, 03 Mar 2022 14:37:17 +0000	[thread overview]
Message-ID: <f7d911b79f48eb7da976002533b1f64cccc554d3.camel@linuxfoundation.org> (raw)
In-Reply-To: <16D8E53ED33DE8AA.24484@lists.openembedded.org>

On Thu, 2022-03-03 at 14:28 +0000, Richard Purdie via lists.openembedded.org
wrote:
> 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() {
> 

This does pose an interesting dilemma. We could just go this far, or should we
remove the remaining pyc files (~1,500 of them) and let python create them as
needed, or do we disable them from python entirely?

Cheers,

Richard




       reply	other threads:[~2022-03-03 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <16D8E53ED33DE8AA.24484@lists.openembedded.org>
2022-03-03 14:37 ` Richard Purdie [this message]
2022-03-03 15:19   ` [OE-core] [PATCH] python3-native: Drop opt-1 and opt-2 pyc files Jose Quaresma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7d911b79f48eb7da976002533b1f64cccc554d3.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.