Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross-building python 3.6 with an older interpreter fails #71621

Closed
xdegaye mannequin opened this issue Jul 1, 2016 · 7 comments
Closed

cross-building python 3.6 with an older interpreter fails #71621

xdegaye mannequin opened this issue Jul 1, 2016 · 7 comments
Assignees
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Jul 1, 2016

BPO 27434
Nosy @doko42, @vstinner, @xdegaye, @moreati
Files
  • restrict_interp.patch
  • restrict_interp_2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/xdegaye'
    closed_at = <Date 2016-07-07.16:04:17.245>
    created_at = <Date 2016-07-01.13:00:21.923>
    labels = ['type-bug', 'build']
    title = 'cross-building python 3.6 with an older interpreter fails'
    updated_at = <Date 2016-07-07.16:04:17.245>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2016-07-07.16:04:17.245>
    actor = 'xdegaye'
    assignee = 'xdegaye'
    closed = True
    closed_date = <Date 2016-07-07.16:04:17.245>
    closer = 'xdegaye'
    components = ['Cross-Build']
    creation = <Date 2016-07-01.13:00:21.923>
    creator = 'xdegaye'
    dependencies = []
    files = ['43604', '43638']
    hgrepos = []
    issue_num = 27434
    keywords = ['patch']
    message_count = 7.0
    messages = ['269666', '269671', '269681', '269880', '269900', '269925', '269943']
    nosy_count = 5.0
    nosy_names = ['doko', 'vstinner', 'xdegaye', 'python-dev', 'Alex.Willmer']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27434'
    versions = ['Python 3.6']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Jul 1, 2016

    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 ; \
    fi
    Could not import runpy module
    Traceback (most recent call last):
      File "/home/xavier/src/packages/android/cpython/Lib/runpy.py", line 15, in <module>
        import importlib.util
      File "/home/xavier/src/packages/android/cpython/Lib/importlib/util.py", 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.

    @xdegaye xdegaye mannequin added build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Jul 1, 2016
    @doko42
    Copy link
    Member

    doko42 commented Jul 1, 2016

    yes, I think we have to limit the choice of the interpreter for the build to the same major version.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Jul 1, 2016

    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
    

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Jul 6, 2016

    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.

    @xdegaye xdegaye mannequin self-assigned this Jul 6, 2016
    @vstinner
    Copy link
    Member

    vstinner commented Jul 6, 2016

    restrict_interp_2.patch: LGTM.

    not ... == '...' can be written ... != '...', no?

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Jul 7, 2016

    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.

    [1] https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#Conditional-Constructs

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 7, 2016

    New changeset 62802d373e9f by Xavier de Gaye in branch 'default':
    Issue bpo-27434: Version of interpreter running a cross-build and source version must be the same.
    https://hg.python.org/cpython/rev/62802d373e9f

    @xdegaye xdegaye mannequin closed this as completed Jul 7, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants