[Qt-creator] WebAssembly rough edges

Alejandro Exojo alex at vikingsoftware.com
Fri Nov 27 07:12:44 CET 2020


Hello.

I can get WebAssembly working for my project on Linux, but I feel I'm
missing something, or there seem to be a few important gaps in Qt
Creator.

1. The latest Qt Creator manual refers to the WASM plugin as
"experimental", but the plugin itself is not marked like this on
Creator.

2. The manual advises "Do not use the --embedded option for activating
the emscripten version in the emsdk", but the SDK itself deprecated
non-embedded, and the latest version doesn't support anything else
("embedded mode is now the only mode available").

3. Adding the location to the emsdk/em++ is fine. It's normal that
Creator is not going to detect where in the disk I got the sources.

4. The Qt 5.15.x WebAssembly version of Qt gets added fine by the
installer, but it shows the yellow triangle warning, and the message
about "ABI detection failed".

5. When going to the kit tab, if I don't add "wasm-emscripten" to the
"Qt mkspec" input, then qmake is invoked with "linux-clang" as mkspec,
and compiles just wrongly.

6. If I don't set EM_CONFIG and point it to the right location where
the SDK and it's ".emscripten" config is, we don't get the compiler
working (em++ spits error about missing BINARYEN_ROOT, because it's
using the one in ~/.emscripten).

7. After the last tweak, I can get things built in Creator, but the
code model chokes on most code, as it can't find anything from the
standard library (qglobal.h can't include type_traits, so pretty much
nothing works). Looking at the code model inspector, I see that it
just doesn't contain any path from the toolchain, so no standard
library. I tried to add it somewhere, but I did not find where. I
don't know if it's because of this, but Creator spins at least one CPU
core constantly while in this state. Switching kit calms it down.

I've seen that some important issues (points 3 to 6 more or less) seem
to be addressed in some tickets
(https://bugreports.qt.io/browse/QTCREATORBUG-24811 and
https://bugreports.qt.io/browse/QTCREATORBUG-24891 and
https://bugreports.qt.io/browse/QTCREATORBUG-23741). I don't know if
point 7 would be fixed as a consequence of the other changes.

However, I see that the fix version is 4.15. :-(  That's two releases
away. Is there any fix/workaround for this last issue, or should I
just (for now) go to the console to do the WebAssembly build/run?

Thank you.

PS: Writing all this mostly as a brain dump (only 7 requires a
solution), in case someone else finds these issues and wants a
solution for the first points, because I did not find much by doing
searches on the web. I had to go to JIRA to find the meat of it. :)


More information about the Qt-creator mailing list