File tree 6 files changed +38
-4
lines changed
Misc/NEWS.d/next/Core and Builtins
6 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,16 @@ DOM APIs as well as limited networking capabilities with JavaScript's
112
112
links are limited and don't support some operations. For example, WASI does
113
113
not permit symlinks with absolute file names.
114
114
115
+ * ``wasm32-emscripten `` has optional support for shared extensions. Since
116
+ Emscripten does not provide a stable ABI, yet. Shared libraries include
117
+ the Emscripten SDK version, for example
118
+ ``.cpython-312-wasm32-emscripten-3_1_19.so ``. Unqualified extensions with
119
+ ``.abi3.so `` or ``.so `` suffix are not supported.
120
+
121
+ * ``wasm32-wasi `` does not support shared extensions, yet. All extensions
122
+ must be compiled into the main WASM binary.
123
+
124
+
115
125
.. _WebAssembly : https://webassembly.org/
116
126
.. _Emscripten : https://emscripten.org/
117
127
.. _Emscripten Networking : https://emscripten.org/docs/porting/networking.html>
Original file line number Diff line number Diff line change @@ -456,5 +456,20 @@ def test_unencodeable(self):
456
456
os .rmdir (name )
457
457
458
458
459
+ @unittest .skipUnless (support .is_emscripten , "Emscripten specific test" )
460
+ @requires_load_dynamic
461
+ class EmscriptenSuffixes (unittest .TestCase ):
462
+ def test_extension_suffixes (self ):
463
+ # see gh-96426
464
+ suffixes = _imp .extension_suffixes ()
465
+ uname = os .uname ()
466
+ release = uname .release .replace ("." , "_" )
467
+ shortver = f"{ sys .version_info .major } { sys .version_info .minor } "
468
+ self .assertEqual (
469
+ suffixes ,
470
+ [f".cpython-{ shortver } -{ uname .machine } -emscripten-{ release } .so" ]
471
+ )
472
+
473
+
459
474
if __name__ == "__main__" :
460
475
unittest .main ()
Original file line number Diff line number Diff line change
1
+ ``wasm32-emscripten `` platform now include the Emscripten SDK version in
2
+ platform triplet and suffix for shared extension modules (``SOABI ``).
3
+ Extensions with `.abi3.so ` and `.so ` are no longer importable. This avoids
4
+ problems with ABI incompatible builds or accidental mixing of ELF shared
5
+ extensions and WASM shared extensions.
Original file line number Diff line number Diff line change @@ -42,8 +42,12 @@ const char *_PyImport_DynLoadFiletab[] = {
42
42
#ifdef ALT_SOABI
43
43
"." ALT_SOABI ".so" ,
44
44
#endif
45
+ #if !defined (__EMSCRIPTEN__ )
46
+ // gh-96426: Emscripten has no stable ABI, only support extensions
47
+ // with full SOABI, e.g. ".cpython-312-wasm32-emscripten-3_1_19.so".
45
48
".abi" PYTHON_ABI_STRING ".so" ,
46
49
".so" ,
50
+ #endif // Emscripten
47
51
#endif /* __CYGWIN__ */
48
52
NULL ,
49
53
};
Original file line number Diff line number Diff line change @@ -1051,15 +1051,15 @@ cat > conftest.c <<EOF
1051
1051
vxworks
1052
1052
# elif defined(__wasm32__)
1053
1053
# if defined(__EMSCRIPTEN__)
1054
- wasm32-emscripten
1054
+ wasm32-emscripten - __EMSCRIPTEN_major__ _ __EMSCRIPTEN_minor__ _ __EMSCRIPTEN_tiny__
1055
1055
# elif defined(__wasi__)
1056
1056
wasm32-wasi
1057
1057
# else
1058
1058
# error unknown wasm32 platform
1059
1059
# endif
1060
1060
# elif defined(__wasm64__)
1061
1061
# if defined(__EMSCRIPTEN__)
1062
- wasm64-emscripten
1062
+ wasm64-emscripten - __EMSCRIPTEN_major__ _ __EMSCRIPTEN_minor__ _ __EMSCRIPTEN_tiny__
1063
1063
# elif defined(__wasi__)
1064
1064
wasm64-wasi
1065
1065
# else
You can’t perform that action at this time.
0 commit comments