[Buildroot] [PATCH 1/2] target-finalize: generate all *.pyc

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Mar 9 21:44:49 UTC 2015


Dear Samuel Martin,

On Mon, 9 Mar 2015 22:30:02 +0100, Samuel Martin wrote:

> Indeed, it'd be better to avoid  wasting time building *.pyc during
> per-package build, though it does not seem really easy to do at first
> glance.
> Well, after hacking around, it is not that hard to do it! :-)
> I cleanup my hacks and will submit them.

Ok, cool.

> The hook is simple enough to be moved in pkg-python.mk as a helper,
> then just being added to the PYTHON{,3}_TARGET_FINALIZE_HOOKS.

Indeed.

> However, if we decide to not go using a global TARGET_FINALIZE_HOOKS,
> but per-package target-install hook, the helper can be easily added to
> the packages that need it; the biggest remaining task being
> identifying and updating all packages not using the pkg-python infra
> but providing a python module.

Well, as it is currently implemented, the hook byte-compiles *all* .py
files. So if you call this hook multiple times, you're going to
byte-compile all .py files multiple times. Doesn't seem like the most
efficient thing to do.

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



More information about the buildroot mailing list