Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spine.wasm could not run in safari with iOS which version is lower than 15. #15515

Merged
merged 3 commits into from
Jun 25, 2023

Conversation

dumganhar
Copy link
Contributor

@dumganhar dumganhar commented Jun 21, 2023

cocos/cocos-engine-external#370
https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#3126---111722

Inline with the recent changes to llvm and binaryen, emscripten will now, by default, enable the sign-extension and mutable-globals WebAssembly proposals. In order to do so the default minimum safari version (MIN_SAFARI_VERSION) was updated from 12.0 to 14.1, and support for the old EdgeHTML engine (MIN_EDGE_VERSION) was removed by default. If you want to continue to support these older engines you can use these settings (-sMIN_SAFARI_VERSION=120000 and/or -sMIN_EDGE_VERSION=44) to revert to the previous defaults, which will result in the new proposals being disabled. Note that in order to avoid support for the sign-extension emscripten uses a binaryen pass, so targeting older browsers requires the running of wasm-opt and is therefore incompatible with ERROR_ON_WASM_CHANGES_AFTER_LINK (i.e. fast linking).

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@dumganhar dumganhar requested a review from minggo June 21, 2023 11:47
set(EMS_LINK_FLAGS "-O3 -s WASM=0 -s INITIAL_MEMORY=33554432 -s ALLOW_MEMORY_GROWTH=1 -s DYNAMIC_EXECUTION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0 \
-flto --no-entry --bind -s USE_ES6_IMPORT_META=0 -s EXPORT_ES6=1 -s MODULARIZE=1 -s EXPORT_NAME='spineWasm' \
-s ENVIRONMENT=web -s FILESYSTEM=0 -s NO_EXIT_RUNTIME=1 -s LLD_REPORT_UNDEFINED --js-library ../library_spine.js")
-s ENVIRONMENT=web -s FILESYSTEM=0 -s NO_EXIT_RUNTIME=1 -s LLD_REPORT_UNDEFINED \
-s MIN_SAFARI_VERSION=110000 \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add -s MIN_SAFARI_VERSION=110000

@dumganhar dumganhar force-pushed the fix/spine-wasm-lower-than-ios15 branch from d280a22 to 386c5a2 Compare June 21, 2023 11:55
@dumganhar dumganhar requested a review from PPpro June 21, 2023 11:55
@github-actions
Copy link

Interface Check Report

This pull request does not change any public interfaces !

@minggo
Copy link
Contributor

minggo commented Jun 25, 2023

@cocos-robot run test cases

@github-actions
Copy link

@dumganhar, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL Morph-Head,deprecated,rich-text-align,rich-text-long-string-truncation,mask-type-change,mask-use-image-stencil,sharedMaterial,rich-text,system-font
windows PASS PASS FAIL label-cacheMode,label-align,ttf-font
ios PASS PASS PASS
android PASS PASS PASS
mac PASS PASS PASS

@minggo minggo merged commit f9dd8bc into cocos:v3.8.0 Jun 25, 2023
@PPpro PPpro mentioned this pull request Jul 18, 2023
6 tasks
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