Skip to content

Commit 65a4e5b

Browse files
committed
Update wasm exception handling model (use wasm-exceptions instead of exceptions)
Add tests
1 parent 253a827 commit 65a4e5b

File tree

16 files changed

+77
-34
lines changed

16 files changed

+77
-34
lines changed

.github/workflows/deploy-github-page.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ jobs:
5656
echo "PREFIX=$PREFIX" >> $GITHUB_ENV
5757
export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
5858
59-
micromamba create -n node-env -c conda-forge nodejs=22
60-
export PATH="$MAMBA_ROOT_PREFIX/envs/node-env/bin:$PATH"
61-
6259
emcmake cmake \
6360
-DCMAKE_BUILD_TYPE=Release \
6461
-DCMAKE_INSTALL_PREFIX=$PREFIX \

.github/workflows/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ jobs:
241241
echo "PREFIX=$PREFIX" >> $GITHUB_ENV
242242
export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
243243
244-
micromamba create -n node-env -c conda-forge nodejs=22
245-
export PATH="$MAMBA_ROOT_PREFIX/envs/node-env/bin:$PATH"
246-
247244
emcmake cmake \
248245
-DCMAKE_BUILD_TYPE=Release \
249246
-DCMAKE_INSTALL_PREFIX=$PREFIX \

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ macro(xeus_cpp_set_common_options target_name)
219219
target_compile_options(${target_name} PUBLIC /wd4251 /wd4141)
220220
target_compile_options(${target_name} PUBLIC /wd4018 /wd4267 /wd4715 /wd4146 /wd4129)
221221
target_compile_options(${target_name} PUBLIC /EHsc)
222+
elseif (EMSCRIPTEN)
223+
target_compile_options(${target_name} PUBLIC -fwasm-exceptions)
222224
else ()
223225
target_compile_options(${target_name} PUBLIC -fexceptions)
224226
endif ()

CONTRIBUTING.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ micromamba create -f environment-wasm-build.yml -y
7171
micromamba activate xeus-cpp-wasm-build
7272
```
7373

74-
You are now in a position to build the xeus-cpp kernel. You build and test it in node by executing the following. Prefer using node 22 and above as prior versions lead to flaky test runs. Once the test pass, run the install command.
74+
You are now in a position to build the xeus-cpp kernel. You build and test it in node by executing the following. Once the test pass, run the install command.
7575

7676
```bash
7777
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
@@ -81,9 +81,6 @@ export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
8181
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
8282
export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
8383

84-
micromamba create -n node-env -c conda-forge nodejs=22
85-
export PATH="$MAMBA_ROOT_PREFIX/envs/node-env/bin:$PATH"
86-
8784
emcmake cmake \
8885
-DCMAKE_BUILD_TYPE=Release \
8986
-DCMAKE_INSTALL_PREFIX=$PREFIX \

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ micromamba create -f environment-wasm-build.yml -y
8888
micromamba activate xeus-cpp-wasm-build
8989
```
9090

91-
You are now in a position to build the xeus-cpp kernel. You build and test it in node by executing the following. Prefer using node 22 and above as prior versions lead to flaky test runs. Once the test pass, run the install command.
91+
You are now in a position to build the xeus-cpp kernel. You build and test it in node by executing the following. Once the test pass, run the install command.
9292
```bash
9393
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
9494
mkdir build
@@ -97,9 +97,6 @@ export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
9797
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
9898
export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
9999

100-
micromamba create -n node-env -c conda-forge nodejs=22
101-
export PATH="$MAMBA_ROOT_PREFIX/envs/node-env/bin:$PATH"
102-
103100
emcmake cmake \
104101
-DCMAKE_BUILD_TYPE=Release \
105102
-DCMAKE_INSTALL_PREFIX=$PREFIX \

docs/source/InstallationAndUsage.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ the following
6666
micromamba create -f environment-wasm-build.yml -y
6767
micromamba activate xeus-cpp-wasm-build
6868
69-
You are now in a position to build the xeus-cpp kernel. You build and test it in node by executing the following. Prefer using node 22 and above as prior versions lead to flaky test runs. Once the test pass, run the install command.
69+
You are now in a position to build the xeus-cpp kernel. You build and test it in node by executing the following. Once the test pass, run the install command.
7070

7171
.. code-block:: bash
7272
@@ -77,9 +77,6 @@ You are now in a position to build the xeus-cpp kernel. You build and test it in
7777
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
7878
export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
7979
80-
micromamba create -n node-env -c conda-forge nodejs=22
81-
export PATH="$MAMBA_ROOT_PREFIX/envs/node-env/bin:$PATH"
82-
8380
emcmake cmake \
8481
-DCMAKE_BUILD_TYPE=Release \
8582
-DCMAKE_INSTALL_PREFIX=$PREFIX \

environment-wasm-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: xeus-cpp-wasm-build
22
channels:
3-
- https://prefix.dev/emscripten-forge-dev
3+
- https://prefix.dev/emscripten-forge-4x
44
- https://prefix.dev/conda-forge
55
dependencies:
66
- cmake
7-
- emscripten_emscripten-wasm32==3.1.73
7+
- emscripten_emscripten-wasm32==4.0.9

environment-wasm-host.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: xeus-cpp-wasm-host
22
channels:
3-
- https://prefix.dev/emscripten-forge-dev
3+
- https://prefix.dev/emscripten-forge-4x
44
- https://prefix.dev/conda-forge
55
dependencies:
66
- nlohmann_json

share/jupyter/kernels/xc11/wasm_kernel.json.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"-Xclang", "-iwithsysroot/include/compat",
77
"-xc",
88
"-std=c11",
9-
"-mllvm", "-enable-emscripten-sjlj",
9+
"-fwasm-exceptions",
10+
"-mllvm", "-wasm-enable-sjlj",
1011
"-msimd128"
1112
],
1213
"language": "c",

share/jupyter/kernels/xc17/wasm_kernel.json.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"-Xclang", "-iwithsysroot/include/compat",
77
"-xc",
88
"-std=c17",
9-
"-mllvm", "-enable-emscripten-sjlj",
9+
"-fwasm-exceptions",
10+
"-mllvm", "-wasm-enable-sjlj",
1011
"-msimd128"
1112
],
1213
"language": "c",

0 commit comments

Comments
 (0)