All of lore.kernel.org
 help / color / mirror / Atom feed
* source-less python
@ 2022-11-13 12:55 Yishai Jaffe
  2022-11-13 13:25 ` [yocto] " Federico Pellegrin
  0 siblings, 1 reply; 13+ messages in thread
From: Yishai Jaffe @ 2022-11-13 12:55 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

Hi,
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.

Thanks,
Yishai Jaffe
Yishai Jaffe

[-- Attachment #2: Type: text/html, Size: 716 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-13 12:55 source-less python Yishai Jaffe
@ 2022-11-13 13:25 ` Federico Pellegrin
  2022-11-13 15:12   ` Alexander Kanavin
  0 siblings, 1 reply; 13+ messages in thread
From: Federico Pellegrin @ 2022-11-13 13:25 UTC (permalink / raw)
  To: Yishai Jaffe; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1946 bytes --]

Hello,
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.

Cheers,
Federico

Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <yishai1999@gmail.com>
ha scritto:

> Hi,
> 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.
>
> Thanks,
> Yishai Jaffe
> Yishai Jaffe
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#58548):
> https://lists.yoctoproject.org/g/yocto/message/58548
> Mute This Topic: https://lists.yoctoproject.org/mt/94997538/5117409
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> fede@evolware.org]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 3038 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-13 13:25 ` [yocto] " Federico Pellegrin
@ 2022-11-13 15:12   ` Alexander Kanavin
  2022-11-14  7:23     ` Federico Pellegrin
  2022-11-17 11:12     ` Yishai Jaffe
  0 siblings, 2 replies; 13+ messages in thread
From: Alexander Kanavin @ 2022-11-13 15:12 UTC (permalink / raw)
  To: Federico Pellegrin; +Cc: Yishai Jaffe, yocto

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?

Alex

On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org> wrote:
>
>
> Hello,
> 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.
>
> Cheers,
> Federico
>
> Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <yishai1999@gmail.com> ha scritto:
>>
>> Hi,
>> 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.
>>
>> Thanks,
>> Yishai Jaffe
>> Yishai Jaffe
>>
>>
>>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#58549): https://lists.yoctoproject.org/g/yocto/message/58549
> Mute This Topic: https://lists.yoctoproject.org/mt/94997538/1686489
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-13 15:12   ` Alexander Kanavin
@ 2022-11-14  7:23     ` Federico Pellegrin
  2022-11-17 11:12     ` Yishai Jaffe
  1 sibling, 0 replies; 13+ messages in thread
From: Federico Pellegrin @ 2022-11-14  7:23 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Yishai Jaffe, yocto

[-- Attachment #1: Type: text/plain, Size: 4121 bytes --]

Hello Alex,

Il giorno dom 13 nov 2022 alle ore 16:12 Alexander Kanavin <
alex.kanavin@gmail.com> ha scritto:

> 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?
>

Just to go with some concrete numbers from a Buildroot example I have under
my hands, with just very basic Python 3.10 support (so no additional
modules, just what gets in with only BR2_PACKAGE_PYTHON3=y) the difference
of size you have between using PYC only (BR2_PACKAGE_PYTHON3_PYC_ONLY=y)
and source only (BR2_PACKAGE_PYTHON3_PY_ONLY=y) of the generated
/usr/lib/python3.10 is 14Mb vs 17Mb. So roughly a 20% ?

Besides the space savings, using the PYC only brings also a speedup in
startup of course.

But strictly on space savings: one should also take into account that the
difference we see is not counting the fact that very often then one has a
compressed filesystem underneath. This is especially true when you have
space constrained embedded devices where you'd like to save space, but not
necessarily that -20% is effective, once you take into account the
filesystem compression.

(please note: not the original thread initiator asking to support this in
Yocto, just chimed in soon after as dealed with this in different context
;-) )


>
> Another issue is that this should be supported upstream and in the
> wider python community. Is it?
>

That is the problem IMO: if you look at the linked github issue I posted
last, I don't think there is a full agreement. So while things mostly work
(and pretty well), there are some edge cases for sure (ie trivially
handling pyc compiled scripts or modules that could be executed as scripts
as well as modules). (here is some discussion:
http://lists.busybox.net/pipermail/buildroot/2022-August/648686.html )

Cheers,
Federico





>
> Alex
>
> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org>
> wrote:
> >
> >
> > Hello,
> > 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.
> >
> > Cheers,
> > Federico
> >
> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <
> yishai1999@gmail.com> ha scritto:
> >>
> >> Hi,
> >> 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.
> >>
> >> Thanks,
> >> Yishai Jaffe
> >> Yishai Jaffe
> >>
> >>
> >>
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#58549):
> https://lists.yoctoproject.org/g/yocto/message/58549
> > Mute This Topic: https://lists.yoctoproject.org/mt/94997538/1686489
> > Group Owner: yocto+owner@lists.yoctoproject.org
> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>

[-- Attachment #2: Type: text/html, Size: 5956 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-13 15:12   ` Alexander Kanavin
  2022-11-14  7:23     ` Federico Pellegrin
@ 2022-11-17 11:12     ` Yishai Jaffe
  2022-11-17 11:24       ` Alexander Kanavin
  1 sibling, 1 reply; 13+ messages in thread
From: Yishai Jaffe @ 2022-11-17 11:12 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Federico Pellegrin, yocto

[-- Attachment #1: Type: text/plain, Size: 3074 bytes --]

Hi Alexander,

After some research, these are the numbers I came up with for compiling
core-image-minimal with python3-core:

Normal compilation:
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.


Yishai Jaffe


On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <alex.kanavin@gmail.com>
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?
>
> Alex
>
> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org>
> wrote:
> >
> >
> > Hello,
> > 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.
> >
> > Cheers,
> > Federico
> >
> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <
> yishai1999@gmail.com> ha scritto:
> >>
> >> Hi,
> >> 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.
> >>
> >> Thanks,
> >> Yishai Jaffe
> >> Yishai Jaffe
> >>
> >>
> >>
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#58549):
> https://lists.yoctoproject.org/g/yocto/message/58549
> > Mute This Topic: https://lists.yoctoproject.org/mt/94997538/1686489
> > Group Owner: yocto+owner@lists.yoctoproject.org
> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>

[-- Attachment #2: Type: text/html, Size: 4552 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-17 11:12     ` Yishai Jaffe
@ 2022-11-17 11:24       ` Alexander Kanavin
  2022-11-17 12:03         ` Yishai Jaffe
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kanavin @ 2022-11-17 11:24 UTC (permalink / raw)
  To: Yishai Jaffe; +Cc: Federico Pellegrin, yocto

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.

Alex

On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@gmail.com> wrote:
>
> Hi Alexander,
>
> After some research, these are the numbers I came up with for compiling core-image-minimal with python3-core:
>
> Normal compilation:
> 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.
>
>
> Yishai Jaffe
>
>
> On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <alex.kanavin@gmail.com> 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?
>>
>> Alex
>>
>> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org> wrote:
>> >
>> >
>> > Hello,
>> > 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.
>> >
>> > Cheers,
>> > Federico
>> >
>> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <yishai1999@gmail.com> ha scritto:
>> >>
>> >> Hi,
>> >> 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.
>> >>
>> >> Thanks,
>> >> Yishai Jaffe
>> >> Yishai Jaffe
>> >>
>> >>
>> >>
>> >
>> > -=-=-=-=-=-=-=-=-=-=-=-
>> > Links: You receive all messages sent to this group.
>> > View/Reply Online (#58549): https://lists.yoctoproject.org/g/yocto/message/58549
>> > Mute This Topic: https://lists.yoctoproject.org/mt/94997538/1686489
>> > Group Owner: yocto+owner@lists.yoctoproject.org
>> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin@gmail.com]
>> > -=-=-=-=-=-=-=-=-=-=-=-
>> >


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-17 11:24       ` Alexander Kanavin
@ 2022-11-17 12:03         ` Yishai Jaffe
  2022-11-17 12:21           ` Alexander Kanavin
  0 siblings, 1 reply; 13+ messages in thread
From: Yishai Jaffe @ 2022-11-17 12:03 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Federico Pellegrin, yocto

[-- Attachment #1: Type: text/plain, Size: 4436 bytes --]

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?

Yishai Jaffe

On Thu, Nov 17, 2022, 1:24 PM Alexander Kanavin <alex.kanavin@gmail.com>
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.
>
> Alex
>
> On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@gmail.com> wrote:
> >
> > Hi Alexander,
> >
> > After some research, these are the numbers I came up with for compiling
> core-image-minimal with python3-core:
> >
> > Normal compilation:
> > 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.
> >
> >
> > Yishai Jaffe
> >
> >
> > On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <
> alex.kanavin@gmail.com> 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?
> >>
> >> Alex
> >>
> >> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org>
> wrote:
> >> >
> >> >
> >> > Hello,
> >> > 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.
> >> >
> >> > Cheers,
> >> > Federico
> >> >
> >> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <
> yishai1999@gmail.com> ha scritto:
> >> >>
> >> >> Hi,
> >> >> 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.
> >> >>
> >> >> Thanks,
> >> >> Yishai Jaffe
> >> >> Yishai Jaffe
> >> >>
> >> >>
> >> >>
> >> >
> >> > -=-=-=-=-=-=-=-=-=-=-=-
> >> > Links: You receive all messages sent to this group.
> >> > View/Reply Online (#58549):
> https://lists.yoctoproject.org/g/yocto/message/58549
> >> > Mute This Topic: https://lists.yoctoproject.org/mt/94997538/1686489
> >> > Group Owner: yocto+owner@lists.yoctoproject.org
> >> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> >> > -=-=-=-=-=-=-=-=-=-=-=-
> >> >
>

[-- Attachment #2: Type: text/html, Size: 6477 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-17 12:03         ` Yishai Jaffe
@ 2022-11-17 12:21           ` Alexander Kanavin
  2022-11-17 12:27             ` Yishai Jaffe
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kanavin @ 2022-11-17 12:21 UTC (permalink / raw)
  To: Yishai Jaffe; +Cc: Federico Pellegrin, yocto

You can start by placing it in a separate layer?

Alex

On Thu, 17 Nov 2022 at 13:04, Yishai Jaffe <yishai1999@gmail.com> 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?
>
> Yishai Jaffe
>
> On Thu, Nov 17, 2022, 1:24 PM Alexander Kanavin <alex.kanavin@gmail.com> 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.
>>
>> Alex
>>
>> On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@gmail.com> wrote:
>> >
>> > Hi Alexander,
>> >
>> > After some research, these are the numbers I came up with for compiling core-image-minimal with python3-core:
>> >
>> > Normal compilation:
>> > 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.
>> >
>> >
>> > Yishai Jaffe
>> >
>> >
>> > On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <alex.kanavin@gmail.com> 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?
>> >>
>> >> Alex
>> >>
>> >> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org> wrote:
>> >> >
>> >> >
>> >> > Hello,
>> >> > 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.
>> >> >
>> >> > Cheers,
>> >> > Federico
>> >> >
>> >> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <yishai1999@gmail.com> ha scritto:
>> >> >>
>> >> >> Hi,
>> >> >> 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.
>> >> >>
>> >> >> Thanks,
>> >> >> Yishai Jaffe
>> >> >> Yishai Jaffe
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> > -=-=-=-=-=-=-=-=-=-=-=-
>> >> > Links: You receive all messages sent to this group.
>> >> > View/Reply Online (#58549): https://lists.yoctoproject.org/g/yocto/message/58549
>> >> > Mute This Topic: https://lists.yoctoproject.org/mt/94997538/1686489
>> >> > Group Owner: yocto+owner@lists.yoctoproject.org
>> >> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin@gmail.com]
>> >> > -=-=-=-=-=-=-=-=-=-=-=-
>> >> >


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-17 12:21           ` Alexander Kanavin
@ 2022-11-17 12:27             ` Yishai Jaffe
  2022-11-17 12:33               ` Alexander Kanavin
  0 siblings, 1 reply; 13+ messages in thread
From: Yishai Jaffe @ 2022-11-17 12:27 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Federico Pellegrin, yocto

[-- Attachment #1: Type: text/plain, Size: 4990 bytes --]

What layer would you suggest?

Yishai Jaffe

On Thu, Nov 17, 2022, 2:21 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> You can start by placing it in a separate layer?
>
> Alex
>
> On Thu, 17 Nov 2022 at 13:04, Yishai Jaffe <yishai1999@gmail.com> 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?
> >
> > Yishai Jaffe
> >
> > On Thu, Nov 17, 2022, 1:24 PM Alexander Kanavin <alex.kanavin@gmail.com>
> 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.
> >>
> >> Alex
> >>
> >> On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@gmail.com>
> wrote:
> >> >
> >> > Hi Alexander,
> >> >
> >> > After some research, these are the numbers I came up with for
> compiling core-image-minimal with python3-core:
> >> >
> >> > Normal compilation:
> >> > 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.
> >> >
> >> >
> >> > Yishai Jaffe
> >> >
> >> >
> >> > On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <
> alex.kanavin@gmail.com> 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?
> >> >>
> >> >> Alex
> >> >>
> >> >> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org>
> wrote:
> >> >> >
> >> >> >
> >> >> > Hello,
> >> >> > 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.
> >> >> >
> >> >> > Cheers,
> >> >> > Federico
> >> >> >
> >> >> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <
> yishai1999@gmail.com> ha scritto:
> >> >> >>
> >> >> >> Hi,
> >> >> >> 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.
> >> >> >>
> >> >> >> Thanks,
> >> >> >> Yishai Jaffe
> >> >> >> Yishai Jaffe
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >
> >> >> > -=-=-=-=-=-=-=-=-=-=-=-
> >> >> > Links: You receive all messages sent to this group.
> >> >> > View/Reply Online (#58549):
> https://lists.yoctoproject.org/g/yocto/message/58549
> >> >> > Mute This Topic:
> https://lists.yoctoproject.org/mt/94997538/1686489
> >> >> > Group Owner: yocto+owner@lists.yoctoproject.org
> >> >> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> >> >> > -=-=-=-=-=-=-=-=-=-=-=-
> >> >> >
>

[-- Attachment #2: Type: text/html, Size: 7564 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-17 12:27             ` Yishai Jaffe
@ 2022-11-17 12:33               ` Alexander Kanavin
  2022-11-17 13:05                 ` Yishai Jaffe
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kanavin @ 2022-11-17 12:33 UTC (permalink / raw)
  To: Yishai Jaffe; +Cc: Federico Pellegrin, yocto

 Making your own! You can have it added to the layer index for better publicity.

Alex

On Thu, 17 Nov 2022 at 13:27, Yishai Jaffe <yishai1999@gmail.com> wrote:
>
> What layer would you suggest?
>
> Yishai Jaffe
>
> On Thu, Nov 17, 2022, 2:21 PM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>>
>> You can start by placing it in a separate layer?
>>
>> Alex
>>
>> On Thu, 17 Nov 2022 at 13:04, Yishai Jaffe <yishai1999@gmail.com> 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?
>> >
>> > Yishai Jaffe
>> >
>> > On Thu, Nov 17, 2022, 1:24 PM Alexander Kanavin <alex.kanavin@gmail.com> 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.
>> >>
>> >> Alex
>> >>
>> >> On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@gmail.com> wrote:
>> >> >
>> >> > Hi Alexander,
>> >> >
>> >> > After some research, these are the numbers I came up with for compiling core-image-minimal with python3-core:
>> >> >
>> >> > Normal compilation:
>> >> > 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.
>> >> >
>> >> >
>> >> > Yishai Jaffe
>> >> >
>> >> >
>> >> > On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <alex.kanavin@gmail.com> 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?
>> >> >>
>> >> >> Alex
>> >> >>
>> >> >> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <fede@evolware.org> wrote:
>> >> >> >
>> >> >> >
>> >> >> > Hello,
>> >> >> > 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.
>> >> >> >
>> >> >> > Cheers,
>> >> >> > Federico
>> >> >> >
>> >> >> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <yishai1999@gmail.com> ha scritto:
>> >> >> >>
>> >> >> >> Hi,
>> >> >> >> 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.
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >> Yishai Jaffe
>> >> >> >> Yishai Jaffe
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> > -=-=-=-=-=-=-=-=-=-=-=-
>> >> >> > Links: You receive all messages sent to this group.
>> >> >> > View/Reply Online (#58549): https://lists.yoctoproject.org/g/yocto/message/58549
>> >> >> > Mute This Topic: https://lists.yoctoproject.org/mt/94997538/1686489
>> >> >> > Group Owner: yocto+owner@lists.yoctoproject.org
>> >> >> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin@gmail.com]
>> >> >> > -=-=-=-=-=-=-=-=-=-=-=-
>> >> >> >


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-17 12:33               ` Alexander Kanavin
@ 2022-11-17 13:05                 ` Yishai Jaffe
  2022-11-17 15:48                   ` Josef Holzmayr
  0 siblings, 1 reply; 13+ messages in thread
From: Yishai Jaffe @ 2022-11-17 13:05 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Federico Pellegrin, yocto

[-- Attachment #1: Type: text/plain, Size: 5641 bytes --]

Seems like a shame not to add this feature for everyone to use...

Yishai Jaffe

On Thu, Nov 17, 2022, 2:34 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

>  Making your own! You can have it added to the layer index for better
> publicity.
>
> Alex
>
> On Thu, 17 Nov 2022 at 13:27, Yishai Jaffe <yishai1999@gmail.com> wrote:
> >
> > What layer would you suggest?
> >
> > Yishai Jaffe
> >
> > On Thu, Nov 17, 2022, 2:21 PM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
> >>
> >> You can start by placing it in a separate layer?
> >>
> >> Alex
> >>
> >> On Thu, 17 Nov 2022 at 13:04, Yishai Jaffe <yishai1999@gmail.com>
> 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?
> >> >
> >> > Yishai Jaffe
> >> >
> >> > On Thu, Nov 17, 2022, 1:24 PM Alexander Kanavin <
> alex.kanavin@gmail.com> 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.
> >> >>
> >> >> Alex
> >> >>
> >> >> On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@gmail.com>
> wrote:
> >> >> >
> >> >> > Hi Alexander,
> >> >> >
> >> >> > After some research, these are the numbers I came up with for
> compiling core-image-minimal with python3-core:
> >> >> >
> >> >> > Normal compilation:
> >> >> > 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.
> >> >> >
> >> >> >
> >> >> > Yishai Jaffe
> >> >> >
> >> >> >
> >> >> > On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <
> alex.kanavin@gmail.com> 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?
> >> >> >>
> >> >> >> Alex
> >> >> >>
> >> >> >> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <
> fede@evolware.org> wrote:
> >> >> >> >
> >> >> >> >
> >> >> >> > Hello,
> >> >> >> > 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.
> >> >> >> >
> >> >> >> > Cheers,
> >> >> >> > Federico
> >> >> >> >
> >> >> >> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <
> yishai1999@gmail.com> ha scritto:
> >> >> >> >>
> >> >> >> >> Hi,
> >> >> >> >> 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.
> >> >> >> >>
> >> >> >> >> Thanks,
> >> >> >> >> Yishai Jaffe
> >> >> >> >> Yishai Jaffe
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> > -=-=-=-=-=-=-=-=-=-=-=-
> >> >> >> > Links: You receive all messages sent to this group.
> >> >> >> > View/Reply Online (#58549):
> https://lists.yoctoproject.org/g/yocto/message/58549
> >> >> >> > Mute This Topic:
> https://lists.yoctoproject.org/mt/94997538/1686489
> >> >> >> > Group Owner: yocto+owner@lists.yoctoproject.org
> >> >> >> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> >> >> >> > -=-=-=-=-=-=-=-=-=-=-=-
> >> >> >> >
>

[-- Attachment #2: Type: text/html, Size: 8976 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [yocto] source-less python
  2022-11-17 13:05                 ` Yishai Jaffe
@ 2022-11-17 15:48                   ` Josef Holzmayr
  0 siblings, 0 replies; 13+ messages in thread
From: Josef Holzmayr @ 2022-11-17 15:48 UTC (permalink / raw)
  To: Yishai Jaffe; +Cc: Alexander Kanavin, Federico Pellegrin, yocto

[-- Attachment #1: Type: text/plain, Size: 6107 bytes --]

It can always be added if is is found useful and robust. We tend to be
careful about taking things into core layers as long as those two concerns,
plus the maintenance commitment are not clear. Technical debt is a real
problem.

On Thu, Nov 17, 2022 at 2:05 PM Yishai Jaffe <yishai1999@gmail.com> wrote:

> Seems like a shame not to add this feature for everyone to use...
>
> Yishai Jaffe
>
> On Thu, Nov 17, 2022, 2:34 PM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>>  Making your own! You can have it added to the layer index for better
>> publicity.
>>
>> Alex
>>
>> On Thu, 17 Nov 2022 at 13:27, Yishai Jaffe <yishai1999@gmail.com> wrote:
>> >
>> > What layer would you suggest?
>> >
>> > Yishai Jaffe
>> >
>> > On Thu, Nov 17, 2022, 2:21 PM Alexander Kanavin <alex.kanavin@gmail.com>
>> wrote:
>> >>
>> >> You can start by placing it in a separate layer?
>> >>
>> >> Alex
>> >>
>> >> On Thu, 17 Nov 2022 at 13:04, Yishai Jaffe <yishai1999@gmail.com>
>> 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?
>> >> >
>> >> > Yishai Jaffe
>> >> >
>> >> > On Thu, Nov 17, 2022, 1:24 PM Alexander Kanavin <
>> alex.kanavin@gmail.com> 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.
>> >> >>
>> >> >> Alex
>> >> >>
>> >> >> On Thu, 17 Nov 2022 at 12:13, Yishai Jaffe <yishai1999@gmail.com>
>> wrote:
>> >> >> >
>> >> >> > Hi Alexander,
>> >> >> >
>> >> >> > After some research, these are the numbers I came up with for
>> compiling core-image-minimal with python3-core:
>> >> >> >
>> >> >> > Normal compilation:
>> >> >> > 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.
>> >> >> >
>> >> >> >
>> >> >> > Yishai Jaffe
>> >> >> >
>> >> >> >
>> >> >> > On Sun, Nov 13, 2022 at 5:12 PM Alexander Kanavin <
>> alex.kanavin@gmail.com> 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?
>> >> >> >>
>> >> >> >> Alex
>> >> >> >>
>> >> >> >> On Sun, 13 Nov 2022 at 14:25, Federico Pellegrin <
>> fede@evolware.org> wrote:
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > Hello,
>> >> >> >> > 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.
>> >> >> >> >
>> >> >> >> > Cheers,
>> >> >> >> > Federico
>> >> >> >> >
>> >> >> >> > Il giorno dom 13 nov 2022 alle ore 13:55 Yishai Jaffe <
>> yishai1999@gmail.com> ha scritto:
>> >> >> >> >>
>> >> >> >> >> Hi,
>> >> >> >> >> 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.
>> >> >> >> >>
>> >> >> >> >> Thanks,
>> >> >> >> >> Yishai Jaffe
>> >> >> >> >> Yishai Jaffe
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#58585):
> https://lists.yoctoproject.org/g/yocto/message/58585
> Mute This Topic: https://lists.yoctoproject.org/mt/94997538/4689568
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> jester@theyoctojester.info]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 9394 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* source-less python
@ 2022-06-23 22:40 Aurum Nitrogen
  0 siblings, 0 replies; 13+ messages in thread
From: Aurum Nitrogen @ 2022-06-23 22:40 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

Hi,
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?

Thanks,
John

[-- Attachment #2: Type: text/html, Size: 536 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-11-17 15:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-13 12:55 source-less python Yishai Jaffe
2022-11-13 13:25 ` [yocto] " Federico Pellegrin
2022-11-13 15:12   ` Alexander Kanavin
2022-11-14  7:23     ` Federico Pellegrin
2022-11-17 11:12     ` Yishai Jaffe
2022-11-17 11:24       ` Alexander Kanavin
2022-11-17 12:03         ` Yishai Jaffe
2022-11-17 12:21           ` Alexander Kanavin
2022-11-17 12:27             ` Yishai Jaffe
2022-11-17 12:33               ` Alexander Kanavin
2022-11-17 13:05                 ` Yishai Jaffe
2022-11-17 15:48                   ` Josef Holzmayr
  -- strict thread matches above, loose matches on Subject: below --
2022-06-23 22:40 Aurum Nitrogen

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.