Compiling Python in a path which contains $BUILD_SYS
Hi,
When compiling Python in a path which contains $BUILD_SYS (typically "x86_64-linux"), then Python fails to build with the following error:
| x86_64-angstromsdk-linux-gcc
--sysroot=/home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/sysroots/x86_64-nativesdk-angstromsdk-linux -L/home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/lib -Wl,-rpath-link,/home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/lib -Wl,-rpath,/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/lib
-Wl,-O1 -L/home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/lib -Wl,-rpath-link,/home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/lib -Wl,-rpath,/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/lib
-Wl,-O1 -L. -L/home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/lib -Xlinker -export-dynamic -o python \
| Modules/python.o \ | -L. -lpython2.7 -lpthread -ldl -lpthread -lutil -lm | error: invalid Python installation: unable to open /home/ags/localbin/toradex/bsp/linux/x86_64-angstromsdk-linux/bsp/oe-core/build/out-glibc/work/x86_64-nativesdk-angstromsdk-linux/nativesdk-python/2.7.3-r0.3/Python-2.7.3/pyconfig.h (No such file or directory) | make: *** [sharedmods] Error 1 | ERROR: oe_runmake failed | WARNING:
/home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/work/x86_64-nativesdk-angstromsdk-linux/nativesdk-python/2.7.3-r0.3/temp/run.do_compile.5641:1 exit 1 from
| exit 1
| ERROR: Function failed: do_compile (log file is located at /home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/out-glibc/work/x86_64-nativesdk-angstromsdk-linux/nativesdk-python/2.7.3-r0.3/temp/log.do_compile.5641)
My builddir is in /home/ags/localbin/toradex/bsp/linux/x86_64-linux/bsp/oe-core/build/
But Python suddenly searches in /home/ags/localbin/toradex/bsp/linux/x86_64-angstromsdk-linux/bsp/oe-core/build/
I think the issue comes from the patch 12-distutils-prefix-is-inside-staging-area.patch, which replaces BUILD_SYS with HOST_SYS in the whole absolute path, even outside of the build directory... Is there a easy fix for this? As a workaround, making sure that the user does not build in a directory which contains $BUILD_SYS would already be helpful, e.g.
# Check if $BUILDDIR contains the string $BUILD_SYS
if [ "${BUILDDIR/${BUILD_SYS}//}" != "$BUILDDIR" ]; then
bberror "Python can not be built in a directory which contains
the BUILD_SYS string."
fi
--
Stefan