File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # GitHub Actions workflow for testing Emscripten/WebAssembly build via Pyodide
2+
3+ name : Emscripten
4+
5+ on :
6+ push :
7+ branches :
8+ - main
9+ pull_request :
10+
11+ jobs :
12+ build-wasm :
13+ name : Build for WebAssembly
14+ runs-on : ubuntu-22.04
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+ with :
20+ fetch-depth : 0
21+
22+ - name : Set up Python
23+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
24+ with :
25+ python-version : ' 3.12'
26+
27+ - name : Install pyodide-build
28+ run : pip install pyodide-build>=0.29.2
29+
30+ - name : Get Emscripten version
31+ run : echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
32+
33+ - name : Set up Emscripten SDK
34+ uses : mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
35+ with :
36+ version : ${{ env.EMSCRIPTEN_VERSION }}
37+
38+ - name : Build wheel for Pyodide
39+ run : pyodide build
Original file line number Diff line number Diff line change 3737#ifdef _MSC_VER
3838# include <stdio.h>
3939#else
40- #if __sun
40+ #if defined( __sun ) || defined( __EMSCRIPTEN__ )
4141# include <stdio.h>
4242#else
4343# include <sys/cdefs.h>
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ static void _npy_set_floatstatus_invalid(void)
7070 fp_raise_xcp (FP_INVALID );
7171}
7272
73- #elif defined(_MSC_VER ) || (defined(__osf__ ) && defined(__alpha ))
73+ #elif defined(_MSC_VER ) || (defined(__osf__ ) && defined(__alpha )) || defined( __EMSCRIPTEN__ )
7474
7575/*
7676 * By using a volatile floating point value,
@@ -80,6 +80,10 @@ static void _npy_set_floatstatus_invalid(void)
8080 * We shouldn't write multiple values to a single
8181 * global here, because that would cause
8282 * a race condition.
83+ *
84+ * Note: Emscripten is included here because its fenv.h implementation
85+ * provides stub functions that don't actually manipulate floating-point
86+ * state (WebAssembly has limited access to hardware exception mechanisms).
8387 */
8488static volatile double _npy_floatstatus_x , _npy_floatstatus_inf ;
8589
Original file line number Diff line number Diff line change 6060# The following indicates which extras_require from setup.cfg will be installed
6161extras =
6262 test
63- alldeps: all
6463
6564install_command =
6665 !devdeps: python -I -m pip install
You can’t perform that action at this time.
0 commit comments