Skip to content

Conversation

@aheejin
Copy link
Member

@aheejin aheejin commented Jan 10, 2025

This replaces the existing WASM_EXNREF option with WASM_LEGACY_EXCEPTIONS option, in an effort to make the new standardized exnref proposal the 'default' state and the legacy proposal needs to be separately enabled an option. But given that most users haven't switched to the new proposal and major web browsers haven't turned it on by default, this WASM_LEGACY_EXCEPTIONS is turned on by default for the moment.

This changes the following function names in test/common.py as well:

  • require(s)_wasm_eh -> require(s)_wasm_legacy_eh
  • require(s)_wasm_exnref -> require(s)_wasm_eh

Even if WASM_LEGACY_EXCEPTIONS defaults to true for now, this adds set_setting(WASM_LEGACY_EXCEPTIONS) in the tests to minimize future fixes when WASM_LEGACY_EXCEPTIONS will eventually be turned off by default.

The test names and suffixes will be changed accordingly in a follow-up.

This is in line with llvm/llvm-project#122158.

This replaces the existing `WASM_EXNREF` option with
`WASM_LEGACY_EXCEPTIONS` option, in an effort to make the new standardized
exnref proposal the 'default' state and the legacy proposal needs to be
separately enabled an option. But given that most users haven't switched
to the new proposal and major web browsers haven't turned it on by
default, this `WASM_LEGACY_EXCEPTIONS` is turned on by default for the
moment.

This changes the following function names in `test/common.py` as well:
- `require(s)_wasm_eh` -> `require(s)_wasm_legacy_eh`
- `require(s)_wasm_exnref` -> `require(s)_wasm_eh`

The test names and suffixes will be changed in a follow-up.
@aheejin aheejin requested review from dschuff and sbc100 January 10, 2025 14:56
self.skipTest('Wasm EH does not work with asan yet')
self.emcc_args.append('-fwasm-exceptions')
self.set_setting('SUPPORT_LONGJMP', 'wasm')
if mode == 'wasm':
Copy link
Member

Choose a reason for hiding this comment

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

Should we also change the mode names to something like 'legacy' and 'exnref'?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah test suffixes / mode names will be changed too in a followup.

Copy link
Member

@dschuff dschuff left a comment

Choose a reason for hiding this comment

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

Looks good, now is definitely the time to change this, before we really have any users.

@aheejin
Copy link
Member Author

aheejin commented Jan 10, 2025

Should we add this to Emscripten 4.0.0 release? It's a new option to let the users to use the new exnref EH proposal so it might be a good idea... I realized we haven't announced the previous option -sWASM_EXNREF in ChangeLog when it was added, which actually seems better at this point.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

Yup lets get this into 4.0

@aheejin
Copy link
Member Author

aheejin commented Jan 10, 2025

Will merge now because f3cd3da passed the CI and the last commit (02b0fe0) just adds the PR number to ChangeLog.

@aheejin aheejin merged commit cbf40dc into emscripten-core:main Jan 10, 2025
11 of 14 checks passed
@aheejin aheejin deleted the wasm_legacy_eh_option branch January 10, 2025 23:11
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.

3 participants