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

Debian package #11895

Closed
jodogne opened this issue Aug 13, 2020 · 9 comments
Closed

Debian package #11895

jodogne opened this issue Aug 13, 2020 · 9 comments

Comments

@jodogne
Copy link

jodogne commented Aug 13, 2020

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!

@sylvestre
Copy link
Contributor

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 :)

@kripken
Copy link
Member

kripken commented Aug 13, 2020

#11362 proposes that we support stable LLVM versions, which could help here.

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.

@jonassmedegaard
Copy link

jonassmedegaard commented Nov 18, 2020

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.

@sylvestre
Copy link
Contributor

You rock Jonas, many thanks! 🥇

@sbc100 sbc100 closed this as completed Nov 18, 2020
@sbc100
Copy link
Collaborator

sbc100 commented Nov 18, 2020

Awesome work! Thank you for working on this!

@sbc100 sbc100 reopened this Nov 18, 2020
@sbc100 sbc100 closed this as completed Nov 18, 2020
@jodogne
Copy link
Author

jodogne commented Nov 18, 2020

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].

@jonassmedegaard
Copy link

@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).

@jodogne
Copy link
Author

jodogne commented Nov 18, 2020

@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

@jonassmedegaard
Copy link

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.

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

No branches or pull requests

5 participants