Skip to content

Commit 61d952c

Browse files
authored
[Unity][WEB] Temp disable wasm exception (#16444)
This PR temp disables wasm exception which requires latest version of nodejs. We can re-enable it after the wasm CI env finishes update.
1 parent 0a3c736 commit 61d952c

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

python/tvm/contrib/emcc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def create_tvmjs_wasm(output, objects, options=None, cc="emcc"):
4242
cmd += ["-O3"]
4343
cmd += ["-std=c++17"]
4444
cmd += ["--no-entry"]
45-
cmd += ["-fwasm-exception"]
45+
# temp disable for backward compact
46+
# can enable after emsdk updates
47+
# cmd += ["-fwasm-exception"]
4648
cmd += ["-s", "WASM_BIGINT=1"]
4749
cmd += ["-s", "ERROR_ON_UNDEFINED_SYMBOLS=0"]
4850
cmd += ["-s", "STANDALONE_WASM=1"]

web/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ all: dist/wasm/tvmjs_runtime.wasm dist/wasm/tvmjs_runtime.wasi.js src/tvmjs_runt
2727

2828
EMCC = emcc
2929

30-
EMCC_CFLAGS = $(INCLUDE_FLAGS) -O3 -std=c++17 -Wno-ignored-attributes -fwasm-exceptions
30+
EMCC_CFLAGS = $(INCLUDE_FLAGS) -O3 -std=c++17 -Wno-ignored-attributes
31+
32+
# -fwasm-exceptions
3133

3234
EMCC_LDFLAGS = --no-entry -s WASM_BIGINT=1 -s ALLOW_MEMORY_GROWTH=1 -s STANDALONE_WASM=1\
3335
-s ERROR_ON_UNDEFINED_SYMBOLS=0 --pre-js emcc/preload.js

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build": "rollup -c",
1414
"lint": "eslint -c .eslintrc.json .",
1515
"typedoc": "typedoc src/index.ts --plugin typedoc-plugin-missing-exports",
16-
"test": "node --experimental-wasm-eh node_modules/.bin/jest",
16+
"test": "node node_modules/.bin/jest",
1717
"bundle": "npm run build && cp lib/index.js dist/index.js && cp lib/index.js dist/tvmjs.bundle.js",
1818
"example": "npm run bundle && node apps/node/example.js",
1919
"example:wasi": "npm run bundle && node --experimental-wasi-unstable-preview1 --experimental-wasm-bigint apps/node/wasi_example.js",

web/tests/node/test_packed_func.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,6 @@ test("RegisterGlobal", () => {
126126
tvm.endScope();
127127
});
128128

129-
test("ExceptionPassing", () => {
130-
tvm.beginScope();
131-
tvm.registerFunc("throw_error", function (msg) {
132-
throw Error(msg);
133-
});
134-
let f = tvm.getGlobalFunc("throw_error");
135-
try {
136-
f("error-xyz");
137-
throw Error("error not caught");
138-
} catch (error) {
139-
assert(error.message.indexOf("error-xyz") != -1);
140-
}
141-
tvm.endScope();
142-
});
143-
144129
test("NDArrayCbArg", () => {
145130
tvm.beginScope();
146131
let use_count = tvm.getGlobalFunc("testing.object_use_count");

0 commit comments

Comments
 (0)