The version check on line 59 reads [[ $(python -V) != ${PV} ]] && \ python -V returns strings like "Python x.y.z" ${PV} only contains "x.y.z" Further, python -V writes to stderr, so the check should read: [[ "$(python -V 2>&1)" != "Python ${PV}" ]] && \ Reproducible: Always Steps to Reproduce: 1.emerge python with CHOST != CBUILD 2.watch it break 3. Actual Results: * * ERROR: dev-lang/python-2.4.4-r4 failed. * Call stack: * ebuild.sh, line 1642: Called dyn_unpack * ebuild.sh, line 768: Called qa_call 'src_unpack' * ebuild.sh, line 44: Called src_unpack * python-2.4.4-r4.ebuild, line 59: Called die * * Crosscompiling requires the same host and build versions. * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/tmp/portage/dev-lang/python-2.4.4-r4/temp/build.log'. Expected Results: Python would merge because I'm running Python 2.4.4 on the host and merging Python 2.4.4
*** Bug 184394 has been marked as a duplicate of this bug. ***
*** Bug 184527 has been marked as a duplicate of this bug. ***
from Bug 184527: When trying to cross-compile the latest python it always fails due to a wrong check. "python -V" does not only print the version but also "Python " in front of it and it prints to stderr. The following patch should fix this: <quote> --- python-2.4.4-r4.ebuild.orig 2007-07-07 18:22:57.000000000 +0000 +++ python-2.4.4-r4.ebuild 2007-07-07 18:23:41.000000000 +0000 @@ -56,7 +56,7 @@ cd ${S} if tc-is-cross-compiler ; then - [[ $(python -V) != ${PV} ]] && \ + [[ "$(python -V 2>&1)" != "Python ${PV}" ]] && \ die "Crosscompiling requires the same host and build versions." else rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch </quote> Cross compiling fails never the less, but that's another thing.
I've applied the version check fix for cross-compile. I've also applied a small patch to the test code which was giving a unicode error during cross-compile. I applied these to all 2.4.4 and greater versions. I've gotten 2.4.4* to cross-compile this way. However, 2.5.1 is still problematic. A bigger patch is needed to get it to cross-compile. I wandered across a 2.5 cross-compile fix on a gobo-linux site somewhere and modified it so that it works. However, I have not yet applied this more heavy handed patch to the python-2.5.1 ebuild (it replaces the in-utero host python and pgen cross-compile hackery in the ebuild). I will attach the ebuild diff and the patch shortly. I won't commit this bigger change right away in case there is any feedback from the python team.
Created attachment 130627 [details, diff] Python 2.5.1 cross-compile patch
Created attachment 130629 [details, diff] Corresponding changes to python-2.5.1 ebuild
Change summary to reflect that this is tracking python cross-compiles issues generally.
Created attachment 133131 [details, diff] patch to fix "cannot test when crosscompiling"
x86-64 profile crosscompiling for i686-pc-gnu-linux An additional problem pops up when attempting to cross compile python.. configure hangs with a message: checking for %zd printf()...configure cannot test when cross-compiling I looked around a bit and found: https://svn.openwrt.org/openwrt/packages/lang/python/patches/030-cant_check_files.patch I then renamed this 13_all_cant-check-files.patch and bzipped this into python-gentoo-patches-2.5.1.tar.bz2 unfortunately this didn't solve all the problems.... Compiling /var/tmp/portage/dev-lang/python-2.5.1-r2/image//usr/lib/python2.5/xmllib.py ... Compiling /var/tmp/portage/dev-lang/python-2.5.1-r2/image//usr/lib/python2.5/xmlrpclib.py ... Compiling /var/tmp/portage/dev-lang/python-2.5.1-r2/image//usr/lib/python2.5/zipfile.py ... make: *** [libinstall] Error 1 * * ERROR: dev-lang/python-2.5.1-r2 failed. * Call stack: * ebuild.sh, line 1654: Called dyn_install * ebuild.sh, line 1089: Called qa_call 'src_install' * ebuild.sh, line 44: Called src_install * python-2.5.1-r2.ebuild, line 186: Called die * * (no error message) * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/tmp/portage/dev-lang/python-2.5.1-r2/temp/build.log'.
fixed in cvs now ... in the future, one issue per report please http://sources.gentoo.org/dev-lang/python/files/python-2.5-cross-printf.patch?rev=1.1 http://sources.gentoo.org/dev-lang/python/python-2.5.2-r7.ebuild?r1=1.13&r2=1.14 http://sources.gentoo.org/dev-lang/python/python-2.5.2-r8.ebuild?r1=1.8&r2=1.9 http://sources.gentoo.org/dev-lang/python/python-2.5.4-r2.ebuild?r1=1.3&r2=1.4