Skip to content

Mark wasm2js (WASM=0) as deprecated - #27655

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:deprecate_wasm2js
Sep 3, 2026
Merged

sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:deprecate_wasm2js

Conversation

@sbc100

@sbc100 sbc100 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Add WASM=0 to DEPRECATED_SETTINGS in tools/settings.py so that passing -sWASM=0 emits a deprecation warning under -Wdeprecated.

Also update settings documentation, src/settings.js comments, ChangeLog.md, and test runner/tests to ignore the warning where wasm2js is tested.

See: #27608

@sbc100
sbc100 requested a review from kripken September 2, 2026 23:08
Comment thread tools/link.py

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm otherwise

Add `WASM=0` to `DEPRECATED_SETTINGS` in `tools/settings.py` so that
passing `-sWASM=0` emits a deprecation warning under `-Wdeprecated`.

Also update settings documentation, `src/settings.js` comments,
`ChangeLog.md`, and test runner/tests to ignore the warning where
wasm2js is tested.

See: emscripten-core#27608
@sbc100
sbc100 merged commit dc0f21d into emscripten-core:main Sep 3, 2026
42 checks passed
@sbc100
sbc100 deleted the deprecate_wasm2js branch September 3, 2026 19:56
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 9, 2026
`wasm2js` was marked as deprecated in emscripten-core#27655. This change removes
support for compiling to JavaScript via `wasm2js` (`-sWASM=0` and
`-sWASM=2`), moving `WASM` to `LEGACY_SETTINGS` with `[1]` as the only
valid value.

Also remove `src/wasm2js.js`, `tools/js_optimizer.py`, the
`minifyGlobals`, `minifyLocals`, and `emitSymbolMap` passes in
`tools/acorn-optimizer.mjs`, and all `wasm2js`-specific tests and test
suites.

Fixes: emscripten-core#27608
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 9, 2026
`wasm2js` was marked as deprecated in emscripten-core#27655. This change removes
support for compiling to JavaScript via `wasm2js` (`-sWASM=0` and
`-sWASM=2`), moving `WASM` to `LEGACY_SETTINGS` with `[1]` as the only
valid value.

Also remove `src/wasm2js.js`, `tools/js_optimizer.py`, and the
`minifyGlobals`, `minifyLocals`, and `emitSymbolMap` passes in
`tools/acorn-optimizer.mjs`.

In addition to removing the 6 `wasm2js*` core test suites and `wasm2js`
parameterized test variants (including `@also_with_wasm2js`), this
removes 57 test methods:
- 39 `@only_wasm2js` tests in `test/test_core.py` that tested basic
  C/C++ codegen (such as `i64` arithmetic, `va_arg`, bitfields, and
  float conversions) which were only kept for `wasm2js` coverage since
  LLVM already tests its own Wasm codegen upstream.
- 12 `wasm2js`-specific tests across `test/test_core.py` (2),
  `test/test_other.py` (6), and `test/test_browser.py` (4) that
  directly tested `-sWASM=0` or `-sWASM=2`.
- 3 `tools/js_optimizer.py` tests in `test/test_other.py`, since the
  Python JS optimizer wrapper was only used by the `wasm2js` pipeline.
- 2 long-skipped fastcomp `invoke_*` tests in `test/test_other.py`.
- 1 `test_preallocated_heap` test in `test/test_browser.py`, which
  tested preallocating a plain `ArrayBuffer` (`Module['buffer']`) with
  `-sWASM=0` (an asm.js-era feature not applicable to Wasm).

Fixes: emscripten-core#27608
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants