| Summary: | Add option to package .py/.pyc/both in Python packages | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Volker <lists.volker> |
| Component: | devtools / tool chain | Assignee: | Unassigned <unassigned> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Low | CC: | anders.darander, geissonator, meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie, ross.burton, TicoTimo |
| Version: | 1.6 | ||
| Target Milestone: | Future | ||
| Hardware: | All | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Yes (doc changes required) | |
|
Description
Volker
2014-06-11 18:44:42 UTC
From reading the internets it appears that Python's "optimisation" is simply to take the .pyc and remove docstrings, line numbers and asserts. Code would have to be incredibly assert-heavy for this to be noticeable, and dropping line numbers/docstrings can be actively harmful. Globally deleting .pyo (or not generating them in the first place) seems reasonable to me. Offering an option for systems which are "finished" to solely ship the .pyc seems like a reasonable idea. Please also reference http://stackoverflow.com/questions/8822335/what-does-python-file-extensions-pyc-pyd-pyo-stand-for for the differences Beside this, I think I saw a non-Yocto distribution in the past that did not ship the pyc and only compiled it on installation. Beside this, Ubuntu 13.10 does not install the .pyo files. We now don't generate the pointless .pyo files by default. It would be fairly convenient to have an option to just ship .pyc for situations where the source isn't needed. I'm looking to remove the .py files from the python_2.7.14.bb recipe from my image over at https://github.com/openbmc/openbmc (we're running into some flash space issues). I saw a potential mechanism to do this posted in http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100453.html but I'm not having much luck getting it to work. Any pointers on how I could use a .bbappend to ensure that only the .pyc files from the python recipe get packaged into my rootfs? Not sure if it's ideal, but I ended up just manually removing them via a bbappend. https://gerrit.openbmc-project.xyz/#/c/openbmc/meta-phosphor/+/12232/ Assigning to the listed Python maintainer. Still a good idea for resource-constrained systems. In summary, pyo aren't built any more. The proposal here is to allow only pyc on target and to remove the py files. Whilst the manifest generation is much more modern, we still don't support that. The idea is valid but we're not sure it is that useful or a priority. There are risks that the pyc files might not be valid on target. No one is working on this and it doesn't seem to be all that critical so moving to Low importance. |