Skip to content

Commit feb7d3c

Browse files
authored
Fix output location for dummy worker.js file (#21830)
Followup to #21701. See: #21827
1 parent 2953743 commit feb7d3c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

ChangeLog.md

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

2121
3.1.59 (in development)
2222
-----------------------
23+
- Fix the location of the dummy `.worker.js` file that is now generated as part
24+
of pthread builds so that is generated alongside the main JavaScript file.
25+
See #21701. ()
2326

2427
3.1.58 - 04/23/24
2528
-----------------

test/test_other.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14530,6 +14530,10 @@ def test_legacy_pthread_worker_js(self):
1453014530
self.assertNotExists('hello_world.worker.js')
1453114531
self.do_runf('hello_world.c', emcc_args=['-pthread'])
1453214532
self.assertExists('hello_world.worker.js')
14533+
os.mkdir('out')
14534+
self.do_runf('hello_world.c', output_basename='out/foo', emcc_args=['-pthread'])
14535+
self.assertExists('out/foo.js')
14536+
self.assertExists('out/foo.worker.js')
1453314537

1453414538
def test_no_pthread(self):
1453514539
self.do_runf('hello_world.c', emcc_args=['-pthread', '-no-pthread'])

tools/link.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,8 @@ def phase_final_emitting(options, state, target, wasm_target):
20612061

20622062
target_dir = os.path.dirname(os.path.abspath(target))
20632063
if settings.PTHREADS and not settings.STRICT:
2064-
write_file(unsuffixed_basename(target) + '.worker.js', '''\
2064+
worker_file = shared.replace_suffix(target, get_worker_js_suffix())
2065+
write_file(worker_file, '''\
20652066
// This file is no longer used by emscripten and has been created as a placeholder
20662067
// to allow build systems to transition away from depending on it.
20672068
//

0 commit comments

Comments
 (0)