Dear all,
Emscripten is an extremely important project for Web development. As many developers are working on Debian derivatives (notably Ubuntu), WebAssembly could benefit from a boost in popularity if emscripten were packaged for Debian.
Currently, thanks to @sylvestre, Debian unstable already features emscripten 1.22.1. Unfortunately, this version was released in 2014, and doesn't feature any support of WebAssembly.
My question is the following: Given that the stable version emscripten 2.0.0 was released two days ago, would it be possible to consider updating the Debian package?
Thanks in advance!
I paused my effort a while back because it was requiring a fork of LLVM.
I haven't seen much interest from folks to have emscripten in Debian & Ubuntu but happy to be proven wrong :)
But this could already be possible, by finding which emscripten version corresponds to a particular LLVM release (using the DEPS history). Those should also be tested by our CI.
Thanks to Sylvestre for initial packaging efforts of the Debian package - I took over recently and the package seems to now be reasonably working and is expected to be suitable for the upcoming stable release of Debian.
Developer-oriented state of packaging is here: https://tracker.debian.org/emscripten
User-oriented availability status is here: https://packages.debian.org/emscripten
My concrete reason for this packaging effort was for a goal of getting the Matrix web-app clients "Element" and "Hydrogen" packaged - they both require libolm compiled as WebAssembly, and Debian requires that all distributed code must be compiled from source which implies that all tools needed to build must be in Debian as well (and part of same distribution release of Debian - not acceptable to compile in unstable Debian and distribute in stable Debian).
Seems to me this issue can be closed now.
You rock Jonas, many thanks! :1st_place_medal:
Awesome work! Thank you for working on this!
Thanks so much for this awesome job! FYI, I have succeeded in building my viewer of medical images named "Stone of Orthanc Web viewer" thanks to this updated package.
However, I have faced a problem: During the linking phase, I got the error emscripten:ERROR: emscript: failure to parse metadata output from wasm-emscripten-finalize. I have not managed to reproduce this error on small C++ projects, but it can appear on larger projects such as mine.
After some investigation, it turned out that this error comes from an incompatibility between LLVM 11 and 12. There is indeed a patch in the Debian package to allow Emscripten 2.0.9 to run with LLVM 11, however using LLVM 11 raised the error above in my case.
If someone else encounters this issue before LLVM 12 lands in Debian Sid, I have managed to bypass it by installing LLVM 12 that is currently pending in the Debian experimental packages. Provided that /etc/apt/sources.list is properly configured for experimental, here is how I configured Emscripten:
$ sudo apt-get install llvm-12 clang-12 lld-12 emscripten
$ mv ~/.emscripten ~/.emscripten.BAK
$ emcc
The last invocation of emcc autogenerates the configuration file ~/.emscripten. Then, edit the ~/.emscripten file so as to replace its last lines as follows:
LLVM_ADD_VERSION = '12'
CLANG_ADD_VERSION = '12'
This configuration makes my project compile. The following warning will appear, but is due to the Debian patch, and can thus be safely ignored: em++: warning: LLVM version appears incorrect (seeing "12.0", expected "11.0") [-Wversion-check].
@jodogne please do not discuss Debian-specific issues here, but instead file a Debian bugreport e.g. by following the link at the top of https://bugs.debian.org/emscripten
Emscripten developers have not endorsed the dirty hacks applied to the Debian package, and any breakage there is between Debian and the users of Debian to resolve (and if Debian developers decide that some issues are not Debian-specific then they will involve emscripten developers).
@jonassmedegaard I already filled an issue on Debian a few minutes ago, I just wanted to ensure a cross-reference between this issue and Debian for future reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975069
Thanks for the Debian bugreport.
I just wanted to ensure that anyone stumbling upon this issue are aware that they are doing a disservice by bothering upstream emscripten developers with downstream-specific issues.