Re: source-less python
You can start by placing it in a separate layer?toggle quoted message Show quoted text
On Thu, 17 Nov 2022 at 13:04, Yishai Jaffe <yishai1999@...> wrote:
I assume by core you mean openembedded-core/poky, yes?
So where would you add it to?
Seems to me like a very useful feature that many people would use if they knew the option exists.
Also, I noticed that in the recipe for python there is a variable named INCLUDE_PYC which does exactly what you think it would. This looks to me like someone did think about the whole python size subject but didn't exactly go through with it all the way. You can decide if to include pyc files but not the opposite. Also, this feature which does exist only applies to the python recipe but not to all other non-base python module recipes. Maybe this can be added to setuptools3 bbclass?
On Thu, Nov 17, 2022, 1:24 PM Alexander Kanavin <alex.kanavin@...> wrote:
I just wonder if this should really be in core. The standards for core
are high: it needs to be both testable and tested, and there's only so
many possible options and tweaks where things can regress that we can
take. On the other hand, there has not been much demand for it.
On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@...> wrote:
After some research, these are the numbers I came up with for compiling core-image-minimal with python3-core:
tar.bz2 - 6.6MB
squashfs-xz - 6.1MB
With my pyc-only patch:
tar.bz2 - 5.8MB
squashfs-xz - 5.2MB
So that's about a 15% decrease in size.
Again, this is for an image only with python3-core. Logically that would mean that if you had an image with more python packages it would be even a bigger percentage.
On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <alex.kanavin@...> wrote:
Generally we slim down python installations by not installing all of
the standard library, and rather having precise dependencies for
specific modules. Can you illustrate the kind of space savings that
can be gained in actual numbers?
Another issue is that this should be supported upstream and in the
wider python community. Is it?
On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@...> wrote:
Just as a small reference since I raised some doubts and questions in Buildroot community on this: there has been also some troubles to understand the correctness or not there (as I found some packages with problems due to this source-less management) and this then sparked, besides discussions in the Buildroot mailing list (roughly end of July / beginning of August if someone interested searching there), also an issue to the Python community, which albeit some discussion I think never arrived to a concrete conclusion. This is the issue: https://github.com/python/cpython/issues/95827 (see also the linked one maybe)
These are just my 2 cents to this discussion, then of course the Python experts will probably chime in and describe the official/discussed position of Yocto regarding to this, but just felt like mentioning that although Buildroot is somehow offering this right now (and likely mostly works as well!), it's not really a so clean and/or agreed solution.
Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <yishai1999@...> ha scritto:
I was wondering if there has been talk about support for source-less python on an image. Installing py and pyc files doubles the size of python on the rootfs. I can imagine this being implemented as an image feature.
I know that in buildroot it is supported.
Was this discussed and decided against? Is this an open issue?
I have a working patch that implements this. I can submit it for review.