classification
Title: Support cross-compiling of cpython modules using setuptools
Type: Stage: resolved
Components: Cross-Build Versions: Python 3.9
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Alex.Willmer, jmoguill2, ned.deily
Priority: normal Keywords:

Created on 2021-05-13 18:15 by jmoguill2, last changed 2021-05-20 20:41 by jmoguill2. This issue is now closed.

Messages (6)
msg393599 - (view) Author: Jeff Moguillansky (jmoguill2) Date: 2021-05-13 18:15
Hi,
I was able to cross-compile Python 3.9.4 for Android.
How do I cross-compile cython modules?
I found one tool online: https://pypi.org/project/crossenv/
but it doesn't seem to be compatible with android clang?
Does cython support cross-compiling modules?
msg393603 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-05-13 20:08
This issue tracker is for issues with cPython and the Python Standard Library. Cython is a third-party project that is not part of cPython. You should ask in a Cython forum (see https://cython.org/#development) or a general forum like StackOverflow.
msg393615 - (view) Author: Jeff Moguillansky (jmoguill2) Date: 2021-05-13 22:12
Sorry I meant cpython.
Distutils is part of cpython?
Currently it doesn't seem to support cross compiling?

On Thu, May 13, 2021, 1:08 PM Ned Deily <report@bugs.python.org> wrote:

>
> Ned Deily <nad@python.org> added the comment:
>
> This issue tracker is for issues with cPython and the Python Standard
> Library. Cython is a third-party project that is not part of cPython. You
> should ask in a Cython forum (see https://cython.org/#development) or a
> general forum like StackOverflow.
>
> ----------
> nosy: +ned.deily
> resolution:  -> third party
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue44126>
> _______________________________________
>
msg393672 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-05-14 15:55
Ah, that makes more sense.

Alas, while there has been some support for various cross-compiling scenarios added to cPython itself, including targeting for Android, for the most part they are not well-documented if at all and are not regularly tested as part of our release process. Further, while Distutils has been a part of the cPython standard library for many years, it is now deprecated for building modules not in the standard library. The PyPA recommends using setuptools instead of Distutils, in general, and there are other build tools out there. How well each of them support cross-compiling would be a good thing to research and ask. https://packaging.python.org/key_projects/?highlight=setuptools#distutils
msg393703 - (view) Author: Jeff Moguillansky (jmoguill2) Date: 2021-05-14 23:49
Thanks for the info, I will forward the question to the setuptools mailing list
msg394059 - (view) Author: Jeff Moguillansky (jmoguill2) Date: 2021-05-20 20:22
Is it possible to add support for cross-compiling of cpython modules to setuptools?
It seems that currently there's some 3rd party solutions like "crossenv" but they don't seem to work with clang / ndk-toolchain for example.
History
Date User Action Args
2021-05-20 20:41:55jmoguill2setstatus: open -> closed
2021-05-20 20:22:25jmoguill2setstatus: closed -> open

messages: + msg394059
title: Cross Compile CPython Modules -> Support cross-compiling of cpython modules using setuptools
2021-05-14 23:49:43jmoguill2setstatus: open -> closed

messages: + msg393703
2021-05-14 23:44:09jmoguill2setstatus: closed -> open
2021-05-14 23:44:01jmoguill2settitle: Cross Compile Cython Modules -> Cross Compile CPython Modules
2021-05-14 15:55:21ned.deilysetmessages: + msg393672
2021-05-13 22:12:18jmoguill2setmessages: + msg393615
2021-05-13 20:08:18ned.deilysetstatus: open -> closed

nosy: + ned.deily
messages: + msg393603

resolution: third party
stage: resolved
2021-05-13 18:15:40jmoguill2create