emscripten-core/emsdk

Installing emsdk 1.39.8 on M3 Mac

incredibleLeitman opened this issue · 3 comments

Hey there, I am having the following problem when trying to install a specific (old) version of emscripten:

user@MacBook-Air-Dev emsdk % ./emsdk install 1.39.8
Resolving SDK version '1.39.8' to 'sdk-releases-9e60f34accb4627d7358223862a7e74291886ab6-64bit'
Installing SDK 'sdk-releases-9e60f34accb4627d7358223862a7e74291886ab6-64bit'..
Skipped installing node-18.20.3-64bit, already installed.
Skipped installing python-3.9.2-64bit, already installed.
Installing tool 'releases-9e60f34accb4627d7358223862a7e74291886ab6-64bit'..
Downloading: /Users/user/emsdk/downloads/9e60f34accb4627d7358223862a7e74291886ab6-wasm-binaries-arm64.tar.xz from https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries-arm64.tar.xz
curl: (22) The requested URL returned error: 404                                

Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries-arm64.tar.xz': Command '['curl', '-#', '-f', '-L', '-o', '/Users/user/emsdk/downloads/9e60f34accb4627d7358223862a7e74291886ab6-wasm-binaries-arm64.tar.xz', 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries-arm64.tar.xz']' returned non-zero exit status 22.

Does this mean the link is down / not supported anymore? 🤔

When looking at the google storage I did not see any "mac" folder at all :S
https://storage.googleapis.com/webassembly/

My problem is that I am bound to Qt 5.15.17 and officially the latest supported emsdk version is 1.39.8
https://doc.qt.io/qt-5/wasm.html

Is there anything I can do to solve this?
I have put very little effort into trying to download and install just the latest emsdk version (which worked 👍 ) but then compiling my Qt project throws a lot of errors

wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmintegration.o): undefined symbol: _emval_call_void_method
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmscreen.o): undefined symbol: _emval_call_void_method
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmclipboard.o): undefined symbol: _emval_call_void_method
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmclipboard.o): undefined symbol: _emval_call_void_method
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmclipboard.o): undefined symbol: std::__2::__basic_string_common<true>::__throw_length_error() const
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmclipboard.o): undefined symbol: _emval_call_void_method
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmclipboard.o): undefined symbol: _emval_call_void_method
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/plugins/platforms/libqwasm.a(qwasmservices.o): undefined symbol: _emval_call_void_method
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/lib/libqtfreetype.a(ftbase.o): undefined symbol: emscripten_longjmp_jmpbuf
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/lib/libqtlibpng.a(pngerror.o): undefined symbol: saveSetjmp
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/lib/libqtlibpng.a(pngerror.o): undefined symbol: emscripten_longjmp_jmpbuf
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/lib/libqtlibpng.a(pngerror.o): undefined symbol: __invoke_void_%struct.png_struct_def*_i8*
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/lib/libqtlibpng.a(pngerror.o): undefined symbol: testSetjmp
wasm-ld: error: /Users/user/Qt/5.15.17/wasm_32/lib/libqtlibpng.a(png.o): undefined symbol:

We didn't have an arm64 build of emsdk back when 1.39.8 was created (I'm not even sure arm64 mac machines were available back then).

You could try forcing the architecture to x86_64 and installing the x86_64 version (which should then run fine under Apple's emulation layer). I think you can try this by doing EMSDK_ARCH=x86_64 ./emsdk install 1.39.8.

However it would be much better to ask Qt to support for more recent version of emscripten.

It looks like _emval_call_void_method was removed back in #20368 so they would need to recompile the Qt libraries to support a more recent emscripten version.

Ah sad, seems like just forcing the architecture seems not to work that easy :S

user@MacBook-Air-Dev emsdk % EMSDK_ARCH=x86_64 ./emsdk install 1.39.8
Resolving SDK version '1.39.8' to 'sdk-releases-9e60f34accb4627d7358223862a7e74291886ab6-64bit'
Installing SDK 'sdk-releases-9e60f34accb4627d7358223862a7e74291886ab6-64bit'..
Skipped installing node-18.20.3-64bit, already installed.
Skipped installing python-3.9.2-64bit, already installed.
Installing tool 'releases-9e60f34accb4627d7358223862a7e74291886ab6-64bit'..
Downloading: /Users/user/emsdk/downloads/9e60f34accb4627d7358223862a7e74291886ab6-wasm-binaries.tar.xz from https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries.tar.xz
curl: (22) The requested URL returned error: 404                                                                                                             

Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries.tar.xz': Command '['curl', '-#', '-f', '-L', '-o', '/Users/user/emsdk/downloads/9e60f34accb4627d7358223862a7e74291886ab6-wasm-binaries.tar.xz', 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries.tar.xz']' returned non-zero exit status 22.
Downloading: /Users/user/emsdk/downloads/9e60f34accb4627d7358223862a7e74291886ab6-wasm-binaries.tbz2 from https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries.tbz2
###################################################################################################################################################### 100.0%
Unpacking '/Users/user/emsdk/downloads/9e60f34accb4627d7358223862a7e74291886ab6-wasm-binaries.tbz2' to '/Users/user/emsdk/upstream'
Done installing tool 'releases-9e60f34accb4627d7358223862a7e74291886ab6-64bit'.
Running post-install step: npm ci ...
Running post-install step: npm install google-closure-compiler-osx@20191111.0.0
Error running ['/Users/user/emsdk/node/18.20.3_64bit/bin/npm', 'install', '--production', '--no-optional', 'google-closure-compiler-osx@20191111.0.0']:
npm warn config production Use `--omit=dev` instead.
npm warn config optional Use `--omit=optional` to exclude optional dependencies, or
npm warn config `--include=optional` to include them.
npm warn config
npm warn config       Default value does install optional deps unless otherwise omitted.
npm warn old lockfile
npm warn old lockfile The package-lock.json file was created with an old version of npm,
npm warn old lockfile so supplemental metadata must be fetched from the registry.
npm warn old lockfile
npm warn old lockfile This is a one-time fix-up, please be patient...
npm warn old lockfile
npm error code EBADPLATFORM
npm error notsup Unsupported platform for google-closure-compiler-osx@20191111.0.0: wanted {"os":"darwin","cpu":"x64,x86"} (current: {"os":"darwin","cpu":"arm64"})
npm error notsup Valid os:   darwin
npm error notsup Actual os:  darwin
npm error notsup Valid cpu:  x64,x86
npm error notsup Actual cpu: arm64

I also think that Qt 5.15 is the latest LTS version (that also runs out May 2025) so I am assuming that there will be no more big updates for additional wasm support :s

Emscripten 1.39.8 is almost 5 years old now. I think its not too surprising that it doesn't support arm64 macOS. I imagine we should probably make it work but it would likely require some effort. I'm not sure how the google-closure-compiler-osx package is installable today? Perhaps they added an arm64 version in a later version?