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

pip modules and platform MULTIARCH identification #22

Open
pmp-p opened this issue Nov 17, 2020 · 4 comments
Open

pip modules and platform MULTIARCH identification #22

pmp-p opened this issue Nov 17, 2020 · 4 comments
Labels
RFC / help wanted may need to layout some standards here or elsewhere

Comments

@pmp-p
Copy link
Owner

pmp-p commented Nov 17, 2020

Following the pattern <cpuarch>-<libc-api>-<libc-abi> , values defined for sysconfig.get_platform() and sysconfig.get_config_vars('MULTIARCH'):

shell.wasm.sh : wasm_1_emscripten or wasm_1pic_emscripten
TODO: iirc there are variants API/ABI wasm/asm.js flavours regarding asyncify and threading for emscripten.

shell.armeabi-v7a.sh : armv7a_19_android

shell.arm64-v8a.sh : aarch64_21_android

shell.x86.sh : i686_19_android

shell.x86_64.sh : x86_64_21_android

and also :

shell.wasi64.sh : wasm64_1_wasi or wasm64_1pic_wasi

shell.wasi32.sh : wasm32_1_wasi or wasm32_1pic_wasi

shell.asm.js.sh : asmjs_1_fastcomp

Exemple of a pip 3.9 wheel build session :

[PyDK:armeabi-v7a] /data/cross/pydk $ pip3-armeabi-v7a wheel numpy
Collecting numpy
  Using cached numpy-1.19.4.zip (7.3 MB)
Building wheels for collected packages: numpy
  Building wheel for numpy (setup.py) ... done
  Created wheel for numpy: filename=numpy-1.19.4-cp39-cp39-armv7a_19_android.whl size=13205762 sha256=98b79f11fdc6f2c30042551145d5814249f27ebc1921ac26f2bcc5d1658ffb01
  Stored in directory: /cache/pip/wheels/6f/d7/25/0fe5a4a476d4881c00f6e6914d4d40f9c42cfe334faafd79a3
Successfully built numpy
[PyDK:armeabi-v7a] /data/cross/pydk $ file numpy-1.19.4-cp39-cp39-armv7a_19_android.whl 
numpy-1.19.4-cp39-cp39-armv7a_19_android.whl: Zip archive data, at least v2.0 to extract
[PyDK:armeabi-v7a] /data/cross/pydk $ 
@pmp-p pmp-p added the RFC / help wanted may need to layout some standards here or elsewhere label Nov 17, 2020
@pmp-p
Copy link
Owner Author

pmp-p commented Nov 17, 2020

Another example using :

sysconfig.get_platform()
sysconfig.get_config_vars('INCLUDEDIR')
[PyDK:armeabi-v7a] /data/cross/pydk/testing/pygame $ pip3-armeabi-v7a wheel .
Processing /data/cross/pydk/testing/pygame
Building wheels for collected packages: pygame
  Building wheel for pygame (setup.py) ... done
  Created wheel for pygame: filename=pygame-2.0.1.dev1-cp39-cp39-armv7a_19_android.whl size=3158603 sha256=8aab801a2f7f5bb4b1441ea8ef238ab7d87a6146474bc399348293686ba9ab98
  Stored in directory: /tmp/pip-ephem-wheel-cache-2cn1i_9y/wheels/b5/14/de/55664e14fd0cccd3089431b21da9fa1d8aa6deee0833e13657
Successfully built pygame
[PyDK:armeabi-v7a] /data/cross/pydk/testing/pygame $ 
[PyDK:armeabi-v7a] /data/cross/pydk/testing/pygame $ pip3-armeabi-v7a install .
Processing /data/cross/pydk/testing/pygame
Skipping wheel build for pygame, due to binaries being disabled for it.
Installing collected packages: pygame
    Running setup.py install for pygame ... done
Successfully installed pygame-2.0.1.dev1
[PyDK:armeabi-v7a] /data/cross/pydk/testing/pygame $ 

@pmp-p pmp-p pinned this issue Nov 17, 2020
@pmp-p
Copy link
Owner Author

pmp-p commented Dec 19, 2020

is an installation of cross pip toolchain via pip (like p4a) viable ?

pygame/pygame#2311 (comment)

Preleminary discussion was engaged with @tshirtman on python-for-android, idea looks welcomed but time/manpower seems to lack both sides.

Meanwhile Beeware pip support seems stuck somewhere in an ungranted future. Python-Android-support issue 8 maybe.

Interesting side effect of multiarch pip shell with https://github.com/eerimoq/mys from @eerimoq is to allow transpiling + cross compiling a python subset to native code ( AOT ).

llvm-jit based python modules like pythran ( or transonic backends) not tested yet.

sidenote : pip module cross-testing on android and wasm ( not wasi ) is blocked by a 12 years old bug python/cpython#22190 fixed in 3.11

@pmp-p
Copy link
Owner Author

pmp-p commented Mar 2, 2021

see uname machine to reflect wasm architecture :
emscripten-core/emscripten#13440 <= merged !

see uname should return something more meaningful
emscripten-core/emscripten#13356

@pmp-p
Copy link
Owner Author

pmp-p commented Apr 6, 2022

not sure how it would affect pip downloads but it may:
No more exec from data folder on targetAPI >= Android Q
( termux termux-app 1072 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC / help wanted may need to layout some standards here or elsewhere
Projects
None yet
Development

No branches or pull requests

1 participant