Skip to content

Commit 5229c5b

Browse files
committed
Stop generating empty .worker.js in pthreads builds
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 16a0bf1 commit 5229c5b

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

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)