This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: cross-building python 3.6 with an older interpreter fails
Type: behavior Stage: resolved
Components: Cross-Build Versions: Python 3.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: xdegaye Nosy List: Alex.Willmer, doko, python-dev, vstinner, xdegaye
Priority: normal Keywords: patch

Created on 2016-07-01 13:00 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
restrict_interp.patch xdegaye, 2016-07-01 18:10 review
restrict_interp_2.patch xdegaye, 2016-07-06 10:39
Messages (7)
msg269666 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-07-01 13:00
Cross-building the 3.6 source with PYTHON_FOR_BUILD using archlinux python 3.5.1 as found in PATH, fails with:

_PYTHON_PROJECT_BASE=/home/xavier/src/android/pyona/build/python3.6-android-21-x86 _PYTHON_HOST_PLATFORM=linux-x86 PYTHONPATH=/home/xavier/src/packages/android/cpython/Lib:/home/xavier/src/packages/android/cpython/Lib/plat-i386-linux-gnu python3 -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
	echo "generate-posix-vars failed" ; \
	rm -f ./pybuilddir.txt ; \
	exit 1 ; \
Could not import runpy module
Traceback (most recent call last):
  File "/home/xavier/src/packages/android/cpython/Lib/", line 15, in <module>
    import importlib.util
  File "/home/xavier/src/packages/android/cpython/Lib/importlib/", line 25
    raise ValueError(f'no package specified for {repr(name)} '
SyntaxError: invalid syntax
generate-posix-vars failed

The reason is that the syntax of formatted string literals is unknown to python 3.5.
msg269671 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2016-07-01 14:19
yes, I think we have to limit the choice of the interpreter for the build to the same major version.
msg269681 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-07-01 18:10
With this patch, cross-building the 3.6 source with only python 3.5.1 on the PATH, produces the following configure error:

      checking for python interpreter for cross build... configure: error: python3.6 interpreter not found
msg269880 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-07-06 10:39
New patch that gets rid of the changes in configure made by my version of autoconf. This version is 2.69 though, i.e. the same as the generated configure file that is under control of mercurial in the default branch.
msg269900 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-07-06 19:15
restrict_interp_2.patch: LGTM.

not ... == '...' can be written ... != '...', no?
msg269925 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-07-07 07:17
I think the way the  condition was written previously is more expressive, so the patch does not change that. The 'not' here expresses the fact that in the shell syntax, the condition is true when the test returns 0 [1], but we still want to express the fact that the 'break' is taken when the interpreter version matches $PACKAGE_VERSION.

msg269943 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-07 16:01
New changeset 62802d373e9f by Xavier de Gaye in branch 'default':
Issue #27434: Version of interpreter running a cross-build and source version must be the same.
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71621
2016-07-07 16:04:17xdegayesetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2016-07-07 16:01:24python-devsetnosy: + python-dev
messages: + msg269943
2016-07-07 07:17:58xdegayesetmessages: + msg269925
2016-07-06 19:15:02vstinnersetnosy: + vstinner
messages: + msg269900
2016-07-06 10:39:07xdegayesetfiles: + restrict_interp_2.patch
assignee: xdegaye
messages: + msg269880

stage: patch review -> commit review
2016-07-01 18:10:28xdegayesetfiles: + restrict_interp.patch
keywords: + patch
messages: + msg269681

stage: needs patch -> patch review
2016-07-01 14:19:51dokosetmessages: + msg269671
2016-07-01 13:00:21xdegayecreate