Skip to content

Commit a756ff0

Browse files
authored
Stop generating empty .worker.js in pthreads builds (#22598)
We stopped using a separate worker file back in #21701. That was released in 3.1.58 back in April. This change ends the transition period by no longer generating a dummy/useless worker.js file alongside the output.
1 parent cac4688 commit a756ff0

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.68 (in development)
2222
-----------------------
23+
- Pthread-based programs no longer generates `.worker.js` file. This file was
24+
made redundant back in 3.1.58 and now is completely removed. (#22598)
2325
- The freetype port was updated from v2.6 to v2.13.3. (#22585)
2426
- The number of arguments passed to Embind function calls is now only verified
2527
with ASSERTIONS enabled. (#22591)

test/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3697,7 +3697,7 @@ def test_pthread_create(self, args):
36973697
if '-sSINGLE_FILE' in args:
36983698
self.assertEqual(len(files), 1, files)
36993699
else:
3700-
self.assertEqual(len(files), 4, files)
3700+
self.assertEqual(len(files), 3, files)
37013701

37023702
# Test that preallocating worker threads work.
37033703
def test_pthread_preallocates_workers(self):

test/test_other.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,6 @@ def test_export_es6(self, args, package_json):
439439
Hello();
440440
''')
441441

442-
if package_json:
443-
# This makes node load all files in the directory as ES6 modules,
444-
# including the worker.js file.
445-
create_file('package.json', '{"type":"module"}')
446-
447442
self.assertContained('hello, world!', self.run_js('runner.mjs'))
448443

449444
def test_emcc_out_file(self):
@@ -14881,20 +14876,9 @@ def test_embind_no_duplicate_symbols(self):
1488114876
create_file('b.cpp', '#include <emscripten/bind.h>')
1488214877
self.run_process([EMXX, '-std=c++23', '-lembind', 'a.cpp', 'b.cpp'])
1488314878

14884-
def test_legacy_pthread_worker_js(self):
14885-
self.do_runf('hello_world.c', emcc_args=['-pthread', '-sSTRICT'])
14886-
self.assertNotExists('hello_world.worker.js')
14887-
self.do_runf('hello_world.c', emcc_args=['-pthread'])
14888-
self.assertExists('hello_world.worker.js')
14889-
os.mkdir('out')
14890-
self.do_runf('hello_world.c', output_basename='out/foo', emcc_args=['-pthread'])
14891-
self.assertExists('out/foo.js')
14892-
self.assertExists('out/foo.worker.js')
14893-
1489414879
def test_no_pthread(self):
1489514880
self.do_runf('hello_world.c', emcc_args=['-pthread', '-no-pthread'])
1489614881
self.assertExists('hello_world.js')
14897-
self.assertNotExists('hello_world.worker.js')
1489814882
self.assertNotContained('Worker', read_file('hello_world.js'))
1489914883

1490014884
def test_sysroot_includes_first(self):

tools/link.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,15 +2073,6 @@ def phase_final_emitting(options, state, target, wasm_target):
20732073
return
20742074

20752075
target_dir = os.path.dirname(os.path.abspath(target))
2076-
if settings.PTHREADS and not settings.STRICT and not settings.SINGLE_FILE:
2077-
worker_file = shared.replace_suffix(target, get_worker_js_suffix())
2078-
write_file(worker_file, '''\
2079-
// This file is no longer used by emscripten and has been created as a placeholder
2080-
// to allow build systems to transition away from depending on it.
2081-
//
2082-
// Future versions of emscripten will likely stop generating this file at all.
2083-
throw new Error('Dummy worker.js file should never be used');
2084-
''')
20852076

20862077
# Deploy the Wasm Worker bootstrap file as an output file (*.ww.js)
20872078
if settings.WASM_WORKERS == 1:

0 commit comments

Comments
 (0)