<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Am Do., 5. Juli 2018 um 12:59Â Uhr schrieb Burton, Ross <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5 July 2018 at 08:26, Oliver Westermann <<a href="mailto:owestermann@gmail.com" target="_blank">owestermann@gmail.com</a>> wrote:<br>
> I'm fiddeling around with yocto. I want to move some python stuff onto an<br>
> embedded board and use the nxp mx8 yocto. Everything worked as expected<br>
> until now, I was able to create yocto recipes for python modules like pyv4l2<br>
> (is there any interest for recipes like these to be commited to<br>
> meta-python?).<br>
><br>
> Now I wanted to install pillow for some image manipulation, but whereas<br>
> other python module recipes worked fine, this one fails and I don't<br>
> understand why.<br>
><br>
> Yocto reports missing setuptools:<br>
><br>
> Log data follows:<br>
> | DEBUG: Executing shell function do_configure<br>
> | NOTE: make clean<br>
> | python setup.py clean<br>
> | Traceback (most recent call last):<br>
> |Â Â File "setup.py", line 22, in <module><br>
> |Â Â Â from setuptools import Extension, setup<br>
> | ImportError: No module named setuptools<br>
><br>
> I've googled around and everything suggests that inherit setuptools3 is<br>
> missing, but it's present in my recipe. This is my <a href="http://python3-pillow_5.2.0.bb" rel="noreferrer" target="_blank">python3-pillow_5.2.0.bb</a>:<br>
><br>
> SUMMARY = "Pillow (The friendly PIL fork)"<br>
> HOMEPAGE = "<a href="http://python-pillow.org/" rel="noreferrer" target="_blank">http://python-pillow.org/</a>"<br>
> LICENSE = "EPLv1"<br>
> LIC_FILES_CHKSUM = "file://LICENSE;md5=c6379001ecb47e2a0420c40177fc1125"<br>
><br>
> SRC_URI[md5sum] = "52d93a34f4180abcff04876f23eaa9b9"<br>
><br>
> PYPI_PACKAGE = "Pillow"<br>
><br>
> inherit pypi setuptools3<br>
><br>
> BBCLASSEXTEND = "native nativesdk"<br>
><br>
> Any idea whats missing or what I am doing wrong (other than that the license<br>
> line is incorrect)?<br>
<br>
Oh, that's a fun one.<br>
<br>
So setuptools/distutils/etc doesn't have the concept of a "configure"<br>
phase but it also doesn't remove the default implementation. The<br>
default implementation will try to do a 'make clean' first to remove<br>
existing build artifacts. Normally this does nothing with Python code<br>
as there's never a Makefile, but pillow has a Makefile. This makefile<br>
does 'python setup.py clean', which is running the *host* Python2 and<br>
you don't have distutils installed. So, it fails.<br>
<br>
Three solutions in order of hackiness (more to less)<br>
1) Set CLEANBROKEN="1" in the recipe to stop the clean happening<br>
2) Nullify do_configure in the recipe with do_configure[noexec] = "1"<br>
3) Override do_configure in distutils3.bbclass to call setup.py<br>
directly to do a clean in do_configure<br>
<br>
I'd say do (1) in your recipe and I'll send a patch for (3) to oe-core.<br>
<br>
And yes, this recipe would be very welcome in meta-python.<br>
<br>
Ross<br></blockquote><div><br></div><div>Â This does not seem to work as expected. With option 1) and 2) it fails in do_compile:</div><div><br></div><div><div></div><div>| DEBUG: Executing shell function do_compile</div><div>| /data/workspace/yocto-build/build/mysys/tmp/work/aarch64-poky-linux/python3-pillow/5.2.0-r0/temp/run.do_compile.14093: 112: /data/workspace/yocto-build/build/<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">mysys</span>/tmp/work/aarch64-poky-linux/python3-pillow/5.2.0-r0/temp/run.do_compile.14093: /data/workspace/yocto-build/build/<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">mysys</span>/tmp/work/aarch64-poky-linux/python3-pillow/5.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3: not found</div><div>| ERROR: python3 setup.py build_ext execution failed.</div><div>| WARNING: exit code 1 from a shell command.</div><div>| ERROR: Function failed: do_compile (log file is located at /data/workspace/yocto-build/build/mysys/tmp/work/aarch64-poky-linux/python3-pillow/5.2.0-r0/temp/log.do_compile.14093)</div></div><div><br></div><div>Option 3 seems to be out of my league right now, I'm still missing some understanding of what happens when in which context :O</div><div><br></div><div>But thanks already for the help :)</div><div><br></div><div>Olli<br><br></div></div></div>