From 9f2559943f93da1edc25b9f9c8d7eff991c801b6 Mon Sep 17 00:00:00 2001 From: "francois@recisio.com" Date: Wed, 14 Feb 2024 09:53:54 +0100 Subject: [PATCH 1/6] [audio worklet] Fix python error when build with audio worklets enabled since #20881 --- tools/feature_matrix.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 48bca6d2f2010..861a90e04ec9f 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -72,7 +72,6 @@ class Feature(IntEnum): }, Feature.GLOBALTHIS: { 'chrome': 71, - 'edge': 79, 'firefox': 65, 'safari': 120100, 'node': 120000, From d2bb3ba088107e4a03b4eb193534f4e74e33bdc1 Mon Sep 17 00:00:00 2001 From: "francois@recisio.com" Date: Thu, 15 Feb 2024 10:00:43 +0100 Subject: [PATCH 2/6] Try to trigger failed tests --- test/test_browser.py | 6 +++--- tools/feature_matrix.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_browser.py b/test/test_browser.py index fd93ea41fe987..088eb842609d9 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -5816,7 +5816,7 @@ def test_full_js_library_strict(self): def test_audio_worklet(self, args): if '-sMEMORY64' in args and is_firefox(): self.skipTest('https://github.com/emscripten-core/emscripten/issues/19161') - self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args) + self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT'] + args) # Tests that posting functions between the main thread and the audioworklet thread works @parameterized({ @@ -5824,14 +5824,14 @@ def test_audio_worklet(self, args): 'closure': (['--closure', '1', '-Oz'],), }) def test_audio_worklet_post_function(self, args): - self.btest('webaudio/audioworklet_post_function.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args, expected='1') + self.btest('webaudio/audioworklet_post_function.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT'] + args, expected='1') @parameterized({ '': ([],), 'closure': (['--closure', '1', '-Oz'],), }) def test_audio_worklet_modularize(self, args): - self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sMODULARIZE=1', '-sEXPORT_NAME=MyModule', '--shell-file', test_file('shell_that_launches_modularize.html')] + args) + self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT', '-sMODULARIZE=1', '-sEXPORT_NAME=MyModule', '--shell-file', test_file('shell_that_launches_modularize.html')] + args) def test_error_reporting(self): # Test catching/reporting Error objects diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 861a90e04ec9f..48bca6d2f2010 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -72,6 +72,7 @@ class Feature(IntEnum): }, Feature.GLOBALTHIS: { 'chrome': 71, + 'edge': 79, 'firefox': 65, 'safari': 120100, 'node': 120000, From 6e592137a32437e43d2d7d83d4443f1361391e10 Mon Sep 17 00:00:00 2001 From: "francois@recisio.com" Date: Thu, 15 Feb 2024 12:11:08 +0100 Subject: [PATCH 3/6] Add a specific test --- test/test_browser.py | 6 +++--- test/test_interactive.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_browser.py b/test/test_browser.py index 088eb842609d9..fd93ea41fe987 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -5816,7 +5816,7 @@ def test_full_js_library_strict(self): def test_audio_worklet(self, args): if '-sMEMORY64' in args and is_firefox(): self.skipTest('https://github.com/emscripten-core/emscripten/issues/19161') - self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT'] + args) + self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args) # Tests that posting functions between the main thread and the audioworklet thread works @parameterized({ @@ -5824,14 +5824,14 @@ def test_audio_worklet(self, args): 'closure': (['--closure', '1', '-Oz'],), }) def test_audio_worklet_post_function(self, args): - self.btest('webaudio/audioworklet_post_function.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT'] + args, expected='1') + self.btest('webaudio/audioworklet_post_function.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args, expected='1') @parameterized({ '': ([],), 'closure': (['--closure', '1', '-Oz'],), }) def test_audio_worklet_modularize(self, args): - self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT', '-sMODULARIZE=1', '-sEXPORT_NAME=MyModule', '--shell-file', test_file('shell_that_launches_modularize.html')] + args) + self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sMODULARIZE=1', '-sEXPORT_NAME=MyModule', '--shell-file', test_file('shell_that_launches_modularize.html')] + args) def test_error_reporting(self): # Test catching/reporting Error objects diff --git a/test/test_interactive.py b/test/test_interactive.py index c564220fb8ea8..eededd602ebb2 100644 --- a/test/test_interactive.py +++ b/test/test_interactive.py @@ -270,6 +270,7 @@ def test_web_audio(self): def test_audio_worklet(self): self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '--preload-file', test_file('hello_world.c') + '@/']) self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-pthread']) + self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT']) # Tests AudioWorklet with emscripten_futex_wake(). @also_with_minimal_runtime From 30eca4d8041d0ab9500204cae3a2836817b6a6b8 Mon Sep 17 00:00:00 2001 From: "francois@recisio.com" Date: Thu, 15 Feb 2024 14:29:26 +0100 Subject: [PATCH 4/6] Add a specific test (another try) --- test/test_browser.py | 1 + test/test_interactive.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_browser.py b/test/test_browser.py index fd93ea41fe987..35b4b0a7d711d 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -5817,6 +5817,7 @@ def test_audio_worklet(self, args): if '-sMEMORY64' in args and is_firefox(): self.skipTest('https://github.com/emscripten-core/emscripten/issues/19161') self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args) + self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT'] + args) # Tests that posting functions between the main thread and the audioworklet thread works @parameterized({ diff --git a/test/test_interactive.py b/test/test_interactive.py index eededd602ebb2..c564220fb8ea8 100644 --- a/test/test_interactive.py +++ b/test/test_interactive.py @@ -270,7 +270,6 @@ def test_web_audio(self): def test_audio_worklet(self): self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '--preload-file', test_file('hello_world.c') + '@/']) self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-pthread']) - self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT']) # Tests AudioWorklet with emscripten_futex_wake(). @also_with_minimal_runtime From bbd28affd609883448b48fa5f97695dcef180aff Mon Sep 17 00:00:00 2001 From: "francois@recisio.com" Date: Thu, 15 Feb 2024 16:09:11 +0100 Subject: [PATCH 5/6] Fix again --- tools/feature_matrix.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 48bca6d2f2010..861a90e04ec9f 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -72,7 +72,6 @@ class Feature(IntEnum): }, Feature.GLOBALTHIS: { 'chrome': 71, - 'edge': 79, 'firefox': 65, 'safari': 120100, 'node': 120000, From fb4f1781335c9ecd561f52c50d9d0393a762ae55 Mon Sep 17 00:00:00 2001 From: "francois@recisio.com" Date: Thu, 15 Feb 2024 17:06:01 +0100 Subject: [PATCH 6/6] Fix test --- test/test_browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_browser.py b/test/test_browser.py index 35b4b0a7d711d..40e9aac81b099 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -5812,12 +5812,12 @@ def test_full_js_library_strict(self): 'minimal_runtime_pthreads_and_closure': (['-sMINIMAL_RUNTIME', '-pthread', '--closure', '1', '-Oz'],), 'pthreads_es6': (['-pthread', '-sPTHREAD_POOL_SIZE=2', '-sEXPORT_ES6'],), 'es6': (['-sEXPORT_ES6'],), + 'strict': (['-sSTRICT'],), }) def test_audio_worklet(self, args): if '-sMEMORY64' in args and is_firefox(): self.skipTest('https://github.com/emscripten-core/emscripten/issues/19161') self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args) - self.btest_exit('webaudio/audioworklet.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sSTRICT'] + args) # Tests that posting functions between the main thread and the audioworklet thread works @parameterized({