Skip to content

Conversation

kripken
Copy link
Member

@kripken kripken commented Jul 17, 2024

Fixes emscripten-core/emscripten#17228

This seems the right default in binaryen.js which is used as a library through
npm mostly. We aren't a main program that wants to control node exclusively.

I verified manually that this does not interfere with our binaryen.js tests here,
just to be safe (that is, I added an error in a test and I saw the test then failed).

@kripken kripken requested a review from sbc100 July 17, 2024 22:34
CMakeLists.txt Outdated
# Avoid catching exit/rejection as that can confuse error reporting in Node,
# see https://github.com/emscripten-core/emscripten/issues/17228
target_link_libraries(binaryen_wasm "-sNODEJS_CATCH_EXIT=0")
target_link_libraries(binaryen_wasm "-sNODEJS_CATCH_REJECTION=0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NODEJS_CATCH_REJECTION is no longer needed here since it already defaults to 0 when targetting node > 15 (which is the default).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I verified it still works that way. Pushed.

target_link_libraries(binaryen_wasm debug "--profiling")
# Avoid catching exit as that can confuse error reporting in Node,
# see https://github.com/emscripten-core/emscripten/issues/17228
target_link_libraries(binaryen_wasm "-sNODEJS_CATCH_EXIT=0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in the process of trying to disable this by default, but this change lgtm either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants