[OE-core] [RFC PATCH] package.bbclass: omit .pyc and .pyo file

Richard Purdie richard.purdie at linuxfoundation.org
Wed Jan 7 10:04:22 UTC 2015


On Wed, 2015-01-07 at 17:32 +0800, Robert Yang wrote:
> 
> On 01/07/2015 05:23 PM, Mike Looijmans wrote:
> > On 01/07/2015 09:07 AM, Richard Purdie wrote:
> >> On Tue, 2015-01-06 at 17:07 -0800, Robert Yang wrote:
> >>> We should not ship .pyc or .pyo file, but there are a few packages
> >>> ship .pyc, should we:
> >>
> >> Why should we not ship them? Doesn't python create these at runtime if
> >> they're not present? What happens on a read only filesystem?
> >
> > You definitely SHOULD ship the .pyc files. If they don't exist, the interpreter
> > is forced to re-compile the .py source, and will attempt to write the result to
> > the filesystem. It won't cause harm, it won't fail, but it's very inefficient.
> > It's better to let the host do the py->pyc conversion anyway.
> 
> AFAIK, the .pyc is not version compatible, the .pyc created with the
> build host's python may not work with the target python.

I thought that was true for pyo but not pyc? Do you have a pointer to
documentation on that?

Cheers,

Richard




More information about the Openembedded-core mailing list