| Summary: | python3-ctypes fails to cross compile | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Peter Bergin <petan679> | ||||
| Component: | devtools / tool chain | Assignee: | Alejandro Hernandez <alejandro.hernandez> | ||||
| Status: | VERIFIED FIXED | QA Contact: | Cristina Agurida <cristina-danielax.agurida> | ||||
| Severity: | major | ||||||
| Priority: | Medium+ | CC: | benjamin.esquivel, cristina-danielax.agurida, jonas.goransson, meta.mr.watcher, meta.watcher, ross.burton | ||||
| Version: | 1.8 | ||||||
| Target Milestone: | 1.9 M2 | ||||||
| Hardware: | All | ||||||
| OS: | arm | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||
| Attachments: |
|
||||||
|
Description
Peter Bergin
2015-06-10 21:40:17 UTC
More information collected about this and it is regarding the PYTHONPATH when building. When buildng in Daisy (working) PYTHONPATH is set to: 'PYTHONPATH': '/work/yocto/qep/qep-media-cgt_build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/python3/3.3.3-r0.0/Python-3.3.3/build/lib.linux-arm-3.3:./Lib:./Lib/plat-linux' When building in fido (not working) PYTHONPATH is empty: 'PYTHONPATH': '' Importing sysconfigdata in fido case will take the host one and in daisy case will take the target one. How should this work? From tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/python3/3.3.3-r1.0/build/Makefile: PYTHON_FOR_BUILD=_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) python3.3 It seems that CROSSPYTHONPATH shall be passed in as PYTHONPATH but in my case this one is empty when executing in the Makefile. FWIW, this works in master for me. (In reply to comment #3) > FWIW, this works in master for me. Which MACHINE are you building against? With 'works', do you mean that you get your _ctype.so file in your RPM? The recipe python3_3.3.3.bb applies the patch python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch:
- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) '$interp
This results in the generated python Makefile being dependent on CROSSPYTHONPATH being defined in order to work properly during crosscompilation. Adding the following CROSSPYTHONPATH export to a .bbappend file makes ctypes build successfully without any warnings.
export CROSSPYTHONPATH = "${B}/build/lib.linux-arm-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux"
The CROSSPYTHONPATH is the resolved version of the original "$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR)".
Now setup.py loads the correct sysconfig target specific dicitionary _sysconfigdata.py found in "${B}/build/lib.linux-arm-${PYTHON_MAJMIN}". When CROSSPYTHONPATH is missing it uses the native (x86_64) python sysconfig instead and on my platform fails to build ctypes for arm.
I can confirm ctypes fails to compile on arm, hence ctypes*.so is not on the final rpm or target, I will send a patch soon to fix this for all archs on fido and master Fixed here: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=fbed86a87064783be376179b3627f55612cd6188 Verified on master: 8ef99a00dc75c6eed87aa1bc1528614a2a27eddf |