[Buildroot] [PATCH v4] python: rework *.pyc files generation

Samuel Martin s.martin49 at gmail.com
Fri Dec 11 22:58:30 UTC 2015


On Fri, Dec 11, 2015 at 11:32 PM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> Samuel,
>
> On Fri, 11 Dec 2015 23:22:52 +0100, Samuel Martin wrote:
>
>> AFAI have tested, this change works as expected, except for broken
>> python modules.
>> In such cases, 'compileall.compile_dir(...)' does not raise any
>> exceptions when it failed to compile the *.py file, leading to the
>> unfortunate consequence: the *.pyc file is not generated and the *.py
>> file is lost if BR2_PACKAGE_PYTHON_PYC_ONLY is enabled.
>
> Do you have some specific examples that exhibit this behavior?
Do you mean some case where this happens and the trace it does?

Here is a log exhibiting the kind of issue aforementioned [1] (got
with this defconfig [2] on top of master + this patch)
In this case, /usr/lib/python2.7/site-packages/_xmlplus/xpath/ParsedAbbreviatedRelativeLocationPath.py
and /usr/lib/python2.7/site-packages/_xmlplus/xpath/ParsedAbbreviatedAbsoluteLocationPath.py
cannot be compiled due to syntax error, so only their corresponding
*.pyc are missing in the final target fs.

[1] http://code.bulix.org/k3brrc-89950?raw
[2] http://code.bulix.org/idvog6-89952?raw

>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

Regards,

-- 
Samuel


More information about the buildroot mailing list