Skip to content

Commit 4bf9bfa

Browse files
authored
Remove --proxy-to-worker/-sPROXY_TO_WORKER (emscripten-core#25645)
This is pretty large, and complex feature that (as far as we can tell) had no users. See emscripten-core#25440 for more details on the deprecation planning. Fixes: emscripten-core#25440
1 parent 1a64817 commit 4bf9bfa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+35
-3439
lines changed

ChangeLog.md

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

2121
4.0.21 (in development)
2222
-----------------------
23+
- The `-sPROXY_TO_WORKER` setting (along with the corresponding
24+
`--proxy-to-worker` flag) was removed due to lack of usage. If you were
25+
depending on this feature but missed the PSA, please let us know about your
26+
use case. (#25645, #25440)
2327

2428
4.0.20 - 11/18/25
2529
-----------------

site/source/docs/api_reference/module.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,6 @@ Other methods
174174

175175
.. note:: Sanitizers or source map is currently not supported if overriding WebAssembly instantiation with Module.instantiateWasm. Providing Module.instantiateWasm when source map or sanitizer is enabled can prevent WebAssembly instantiation from finishing.
176176

177-
.. js:function:: Module.onCustomMessage
178-
179-
When compiled with ``PROXY_TO_WORKER = 1`` (see `settings.js <https://github.com/emscripten-core/emscripten/blob/main/src/settings.js>`_), this callback (which should be implemented on both the client and worker's ``Module`` object) allows sending custom messages and data between the web worker and the main thread (using the ``postCustomMessage`` function defined in `proxyClient.js <https://github.com/emscripten-core/emscripten/blob/main/src/proxyClient.js>`_ and `proxyWorker.js <https://github.com/emscripten-core/emscripten/blob/main/src/proxyWorker.js>`_).
180-
181177
.. js:function:: Module.fetchSettings
182178

183179
Override the default settings object used when fetching the Wasm module from

site/source/docs/api_reference/wasm_workers.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ The following build options are not supported at the moment with Wasm Workers:
396396

397397
- -sSINGLE_FILE
398398
- Dynamic linking (-sLINKABLE, -sMAIN_MODULE, -sSIDE_MODULE)
399-
- -sPROXY_TO_WORKER
400399
- -sPROXY_TO_PTHREAD
401400

402401
Example Code

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,31 +1683,6 @@ in a worker. See emscripten.h
16831683

16841684
Default value: false
16851685

1686-
.. _proxy_to_worker:
1687-
1688-
PROXY_TO_WORKER
1689-
===============
1690-
1691-
If set to 1, we build the project into a js file that will run in a worker,
1692-
and generate an html file that proxies input and output to/from it.
1693-
1694-
.. note:: This setting is deprecated
1695-
1696-
Default value: false
1697-
1698-
.. _proxy_to_worker_filename:
1699-
1700-
PROXY_TO_WORKER_FILENAME
1701-
========================
1702-
1703-
If set, the script file name the main thread loads. Useful if your project
1704-
doesn't run the main emscripten- generated script immediately but does some
1705-
setup before
1706-
1707-
.. note:: This setting is deprecated
1708-
1709-
Default value: ''
1710-
17111686
.. _proxy_to_pthread:
17121687

17131688
PROXY_TO_PTHREAD
@@ -3431,8 +3406,6 @@ the these settings please open a bug (or reply to one of the existing bugs).
34313406
- ``ASYNCIFY_EXPORTS``: please use JSPI_EXPORTS instead
34323407
- ``LINKABLE``: under consideration for removal (https://github.com/emscripten-core/emscripten/issues/25262)
34333408
- ``RELOCATABLE``: under consideration for removal (https://github.com/emscripten-core/emscripten/issues/25262)
3434-
- ``PROXY_TO_WORKER``: under consideration for removal (See https://github.com/emscripten-core/emscripten/issues/25440)
3435-
- ``PROXY_TO_WORKER_FILENAME``: under consideration for removal (See https://github.com/emscripten-core/emscripten/issues/25440)
34363409

34373410
.. _legacy-settings:
34383411

@@ -3518,3 +3491,4 @@ for backwards compatbility with older versions:
35183491
- ``USE_OFFSET_COVERTER``: No longer supported, not needed with modern v8 versions (Valid values: [0])
35193492
- ``ASYNCIFY_LAZY_LOAD_CODE``: No longer supported (Valid values: [0])
35203493
- ``USE_WEBGPU``: No longer supported; replaced by --use-port=emdawnwebgpu, which implements a newer (but incompatible) version of webgpu.h - see tools/ports/emdawnwebgpu.py (Valid values: [0])
3494+
- ``PROXY_TO_WORKER``: No longer supported (Valid values: [0])

src/lib/libegl.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,6 @@ var LibraryEGL = {
637637
eglSwapBuffers__deps: ['$GLctx'],
638638
eglSwapBuffers__proxy: 'sync',
639639
eglSwapBuffers: (dpy, surface) => {
640-
#if PROXY_TO_WORKER
641-
if (Browser.doSwapBuffers) Browser.doSwapBuffers();
642-
#endif
643-
644640
if (!EGL.defaultDisplayInitialized) {
645641
EGL.setErrorCode(0x3001 /* EGL_NOT_INITIALIZED */);
646642
} else if (!GLctx) {

src/lib/libidbstore.js

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -144,67 +144,6 @@ var LibraryIDBStore = {
144144
wakeUp();
145145
});
146146
}),
147-
// extra worker methods - proxied
148-
emscripten_idb_load_blob__async: true,
149-
emscripten_idb_load_blob: (db, id, pblob, perror) => Asyncify.handleSleep((wakeUp) => {
150-
#if ASSERTIONS
151-
assert(!IDBStore.pending);
152-
#endif
153-
IDBStore.pending = (msg) => {
154-
IDBStore.pending = null;
155-
var blob = msg.blob;
156-
if (!blob) {
157-
{{{ makeSetValue('perror', 0, '1', 'i32') }}};
158-
wakeUp();
159-
return;
160-
}
161-
#if ASSERTIONS
162-
assert(blob instanceof Blob);
163-
#endif
164-
var blobId = IDBStore.blobs.length;
165-
IDBStore.blobs.push(blob);
166-
{{{ makeSetValue('pblob', 0, 'blobId', 'i32') }}};
167-
wakeUp();
168-
};
169-
postMessage({
170-
target: 'IDBStore',
171-
method: 'loadBlob',
172-
db: UTF8ToString(db),
173-
id: UTF8ToString(id)
174-
});
175-
}),
176-
emscripten_idb_store_blob__async: true,
177-
emscripten_idb_store_blob: (db, id, ptr, num, perror) => Asyncify.handleSleep((wakeUp) => {
178-
#if ASSERTIONS
179-
assert(!IDBStore.pending);
180-
#endif
181-
IDBStore.pending = (msg) => {
182-
IDBStore.pending = null;
183-
{{{ makeSetValue('perror', 0, '!!msg.error', 'i32') }}};
184-
wakeUp();
185-
};
186-
postMessage({
187-
target: 'IDBStore',
188-
method: 'storeBlob',
189-
db: UTF8ToString(db),
190-
id: UTF8ToString(id),
191-
blob: new Blob([new Uint8Array(HEAPU8.subarray(ptr, ptr+num))])
192-
});
193-
}),
194-
emscripten_idb_read_from_blob: (blobId, start, num, buffer) => {
195-
var blob = IDBStore.blobs[blobId];
196-
if (!blob) return 1;
197-
if (start+num > blob.size) return 2;
198-
var byteArray = (new FileReaderSync()).readAsArrayBuffer(blob.slice(start, start+num));
199-
HEAPU8.set(new Uint8Array(byteArray), buffer);
200-
return 0;
201-
},
202-
emscripten_idb_free_blob: (blobId) => {
203-
#if ASSERTIONS
204-
assert(IDBStore.blobs[blobId]);
205-
#endif
206-
IDBStore.blobs[blobId] = null;
207-
},
208147
#else
209148
emscripten_idb_load: (db, id, pbuffer, pnum, perror) => {
210149
abort('Please compile your program with async support in order to use synchronous operations like emscripten_idb_load, etc.');

src/lib/libsigs.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,8 @@ sigs = {
675675
emscripten_idb_clear__sig: 'vpp',
676676
emscripten_idb_delete__sig: 'vppp',
677677
emscripten_idb_exists__sig: 'vpppp',
678-
emscripten_idb_free_blob__sig: 'vi',
679678
emscripten_idb_load__sig: 'vppppp',
680-
emscripten_idb_load_blob__sig: 'vpppp',
681-
emscripten_idb_read_from_blob__sig: 'viiip',
682679
emscripten_idb_store__sig: 'vpppip',
683-
emscripten_idb_store_blob__sig: 'vpppip',
684680
emscripten_is_webgl_context_lost__sig: 'ip',
685681
emscripten_lock_async_acquire__sig: 'vpppd',
686682
emscripten_lock_orientation__sig: 'ii',

src/lib/libwasm_worker.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
#if RELOCATABLE || MAIN_MODULE
1919
#error "dynamic linking is not supported with -sWASM_WORKERS"
2020
#endif
21-
#if PROXY_TO_WORKER
22-
#error "-sPROXY_TO_WORKER is not supported with -sWASM_WORKERS"
23-
#endif
2421
#if WASM2JS && MODULARIZE
2522
#error "-sWASM=0 + -sMODULARIZE + -sWASM_WORKERS is not supported"
2623
#endif

src/postamble.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66

77
// === Auto-generated postamble setup entry stuff ===
88

9-
#if PROXY_TO_WORKER
10-
if (ENVIRONMENT_IS_WORKER) {
11-
#include "webGLWorker.js"
12-
#include "proxyWorker.js"
13-
}
14-
#endif
15-
169
#if LOAD_SOURCE_MAP
1710
#include "source_map_support.js"
1811
#endif

0 commit comments

Comments
 (0)