-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Description
Feature or enhancement
I propose to include the Emscripten SDK version in the SOABI for extensions and sysconfig.get_platform
, which is used in wheel tag. I also propose to disable abi3.so
for Emscripten.
Pitch
Typical compilers like gcc/clang and libcs like glibc provide a stable ABI. Modern VS and msvcrt also have a stable ABI. Code compiled with GCC 11 for glibc 2.34 generally works with code compiled with GCC 12 and glibc 2.35. The manylinux binary wheels make use of stable and common ABIs across Linux distros.
Emscripten does not provide a stable ABI for SIDE_MODULES (shared extensions) yet. That means Python packages must be compiled with exactly same version of EMSDK than the MAIN_MODULE, in our case the Python interpreter (python.wasm
and python.js
). An extension compiled with EMSDK 3.1.17 may or may not crash when it is loaded into a Python interpreter which is compiled with EMSDK 3.1.18.
If we include the EMSDK version in SOABI and wheel tag and disable abi3.so
, then Python will only ever load extensions with compatible EMSDK version.
Implementation
- in
configure.ac
include__EMSCRIPTEN_major__
, minor, and tiny inPLATFORM_TRIPLET
- in
Python/dynload_shlib.c
add#ifdef __EMSCRIPTEN__
aroundabi3
.
tags
For technical reasons it is not possible to use a dot as version separator. We can either separate by _
or turn 3.1.18 into 30118
.
wasm32_emscripten_3_1_18
wasm32_emscripten_30118
Previous discussion
Metadata
Metadata
Assignees
Labels
Projects
Status