From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: ross.burton@arm.com
Cc: Alexander Kanavin <alex.kanavin@gmail.com>,
Mikko Rapeli <mikko.rapeli@linaro.org>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH] ovmf-native: remove .pyc files from install
Date: Mon, 14 Oct 2024 13:52:13 +0100 [thread overview]
Message-ID: <d90e529a8aaf0f3db3ca9ea233a5f942cdfbb9d2.camel@linuxfoundation.org> (raw)
In-Reply-To: <5F96FA44-761F-4C3A-9892-266B9FDD0366@arm.com>
On Mon, 2024-10-14 at 12:34 +0000, Ross Burton via
lists.openembedded.org wrote:
> On 14 Oct 2024, at 13:01, Richard Purdie via lists.openembedded.org
> <richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:
> >
> > On Mon, 2024-10-14 at 13:05 +0200, Alexander Kanavin via
> > lists.openembedded.org wrote:
> > > This doesn't quite make sense. Why is the problem specific to
> > > .pyc
> > > files and not other files ovmf installs?
> >
> > If it helps, I do roughly understand what is happening here and I
> > believe this is the right fix.
>
> So my understanding is that this is a general problem: if a native
> recipe ships a .py but not .pyc then when that script is used python
> will write a .pyc _into the sysroot_. If we then upgrade that recipe
> and it now ships a .pyc then you get this error, as the sysroot
> construction call wants to create a file that already exists.
>
> I think for scripts that are ran with python3-native then we should
> be shipping the .pyc files, even in native recipes, because then
> they’re pregenerated and will be used by python. The fun is when the
> script is ran by the host python, which is of indeterminate version.
For fun, there are things which could be called by either the host
python or python3-native from the sysroot depending on whether that was
added to PATH for other reasons. That complicates things somewhat.
> I wonder if python has a way to control where the files get written,
> so we could put freshly generated files into a separate directory
> that isn’t part of the sysroot? We could also make the sysroot read-
> only outside of the sysroot manipulation, which would force python to
> do something different too (though I believe this is just “don’t
> write pyc?).
>
> Note that this problem impacts plenty of other recipes that for
> historical reasons can't ship bytecode into the sysroot (see eg
> python3-setuptools), so I do think we need a general solution and not
> just a creeping and irreversible trend of deleting .pyc from the
> sysroot.
I'm torn. It is a complex problem causing issues for patches which are
otherwise ok and requires a great deal of thought to fix differently.
The performance impact of python generating those files at first run
probably is negligible, compared even to the overhead of extracting
files from sstate.
Is this an issue we want to focus effort on? Are there gains here to be
had?
Cheers,
Richard
next prev parent reply other threads:[~2024-10-14 12:52 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 10:28 [PATCH] ovmf-native: remove .pyc files from install Mikko Rapeli
2024-10-14 11:05 ` [OE-core] " Alexander Kanavin
2024-10-14 11:21 ` Mikko Rapeli
2024-10-14 11:28 ` Alexander Kanavin
2024-10-14 11:39 ` Mikko Rapeli
2024-10-14 11:42 ` Alexander Kanavin
2024-10-14 12:01 ` Richard Purdie
2024-10-14 12:34 ` Ross Burton
2024-10-14 12:52 ` Richard Purdie [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-10-11 12:20 [PATCH v8 0/8] systemd uki support Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 1/8] uki.bbclass: add class for building Unified Kernel Images (UKI) Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 2/8] wic bootimg-efi.py: keep timestamps and add debug prints Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 3/8] wic bootimg-efi.py: change UKI support from wic plugin to uki.bbclass Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 4/8] oeqa selftest uki.py: add tests for uki.bbclass Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 5/8] oeqa selftest efibootpartition.py: add TEST_RUNQEMUPARAMS to runqemu Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 6/8] oeqa selftest efibootpartition.py: remove systemd-boot from grub-efi test Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 7/8] oeqa selftest wic.py: add TEST_RUNQEMUPARAMS to runqemu Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 8/8] oeqa selftest wic.py: support UKIs via uki.bbclass Mikko Rapeli
2024-10-13 7:43 ` [OE-core] [PATCH v8 0/8] systemd uki support Richard Purdie
2024-10-14 10:30 ` Mikko Rapeli
2024-10-14 12:13 ` Mikko Rapeli
[not found] ` <17FE4B15CF045259.4702@lists.openembedded.org>
2024-10-15 6:44 ` Mikko Rapeli
2024-10-15 9:45 ` Richard Purdie
2024-10-15 10:43 ` Richard Purdie
2024-10-15 11:23 ` Mikko Rapeli
2024-10-15 11:32 ` Alexander Kanavin
[not found] ` <17FE9D06966A2DE5.32376@lists.openembedded.org>
2024-10-15 11:36 ` Alexander Kanavin
2024-10-15 14:13 ` Richard Purdie
2024-10-15 14:23 ` Mikko Rapeli
[not found] ` <17FE9C82DB831F81.27606@lists.openembedded.org>
2024-10-17 8:52 ` Mikko Rapeli
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=d90e529a8aaf0f3db3ca9ea233a5f942cdfbb9d2.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=alex.kanavin@gmail.com \
--cc=mikko.rapeli@linaro.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=ross.burton@arm.com \
/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.