[MINIMAL_RUNTIME] Fix ENVIRONMENT_IS_WORKER under WASM_WORKERS + nodejs#26562
Merged
Conversation
ENVIRONMENT_IS_WORKER under WASM_WORKERS + node
This fix came about because I was trying to remove the @requied_pthread decorator from the WASM_WORKER tests in test_core.py Without this fix the `ENVIRONMENT_IS_WORKER` is not set correctly under node which means that `emscripten_is_main_browser_thread` was reporting the wrong value when called from within a Wasm Worker. This bug was being hidden when the program was compiled with both pthreads and wasm workers enabled.
4238034 to
419a077
Compare
ENVIRONMENT_IS_WORKER under WASM_WORKERS + nodeENVIRONMENT_IS_WORKER under MINIMAL_RUNTIME + WASM_WORKERS + nodejs
ENVIRONMENT_IS_WORKER under MINIMAL_RUNTIME + WASM_WORKERS + nodejsENVIRONMENT_IS_WORKER under WASM_WORKERS + nodejs
dschuff
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix came about because I was trying to remove the
@requires_pthreaddecorator from theWASM_WORKERtests in test_core.py. This decorator should not be needed or used for wasm worker tests because it injects the-pthreadcompile flag.Without this fix the
ENVIRONMENT_IS_WORKERis not set correctly under node which means thatemscripten_is_main_browser_threadwas reporting the wrong value when called from within a Wasm Worker.This bug was being hidden when the program was compiled with both pthreads and wasm workers enabled.