The new QtQuick application wizard for Qt 6.2-based applications now
uses different names for the project and for the main target.
The WebAssembly plugin cannot construct the html file name for launching
like <projectname>.html, anymore. It instead would need to use
<targetname>.html for that.
The author of this patch did not manage to programmatically retrieve the
target name or buildkey. So, as a hack, we simply chose the first html
file that we find in the build directory.
Fixes: QTCREATORBUG-26562
Change-Id: I7e929fe265a15501c7275e2c76b7f5fa4ed1e6b5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
From now on do on Linux and macOS what was already done on Windows in
order to launch a WebAssembly program: Directly call the emrun.py python
script instead of indirectly via the wrapper shell script.
The wrapper was too fragile. Also, this change consolidates the code
paths on the three host platforms a bit.
Fixes: QTCREATORBUG-25905
Fixes: QTCREATORBUG-26189
Change-Id: If79567e4dc688de460b38daa479becb53d3c5f03
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This affects Windows only. Instead of searching python.exe in the Path,
use the executable name which is stored in the "EMSDK_PYTHON"
environment variable (which is set by emsdk_env).
emsdk_env also prepends entries to Path, but not the one pointing to the
emsdk-shipped python interpreter. I believe that earlier versions of
emsdk_env used to add the python location to Path, else this is an old
bug.
Fixes: QTCREATORBUG-25897
Change-Id: I9b5bc43f865d19a862f8c6cd45105be54286a549
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Qt Creator's ability to register Emscripten toolchains depended on an
SDK being activated "globally", and on the presence of the ~/.emscripten
file. Qt Creator would parse that file in order to determine the
location of the compiler and the necessary environment variables that
have to be set.
As of recently, the Emscripten SDK does neither activate gobally
anymore, nor is the ~/.emscripten generated. This change here addresses
the new situation in a couple of ways:
- Instead of trying to silently detect everything, add a UI
(IOptionsPageWidget) that lets the user select the Emscripten SDK root.
- Instead of parsing the ~/.emscripten file, parse the output of the
emsdk_env tool to determine the toolchain environment
(ToolChain::addToEnvironment). The parsing is cached. A test for the
parsing is included.
- Instead of registering the underlying clang as compiler, register the
emcc/em++ wrapper scripts, which are (also as of recently) compatible
with Qt Creator's way of determining gcc's predefined macros and built-
in header paths.
One Emscripten SDK is registered globally in Qt Creator. When changing
that, the previous Emscripten toolchains are removed, the new ones are
registered and the kit are "fixed" to use those.
On startup, an InfoBar entry is shown if Qt for Webassembly kits exist
and no Emscripten toolchains are present. That's the case for first-time
use after installing Qt for Webassembly via Qt SDK installer. The
InfoBar entry opens up the IOptionsPageWidget.
Qt 5.15.0 for WebAssembly and Emscripten SDK 1.39.0 are the minimum
supported versions. The new UI will show warnings accordingly.
Task-number: QTCREATORBUG-24811
Fixes: QTCREATORBUG-24822
Fixes: QTCREATORBUG-24814
Fixes: QTCREATORBUG-23741
Fixes: QTCREATORBUG-23561
Fixes: QTCREATORBUG-23160
Fixes: QTCREATORBUG-23126
Change-Id: I017c61586b17e815bb20a90e3f305a6bf705da36
Reviewed-by: hjk <hjk@qt.io>
In most cases they are used directly, so there's not much Base* in that.
Added the old name as alias as porting help for a while.
Change-Id: I494a8a560b8996bcf74915ea3570b504df6a6b4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
With Emscripten SDK 1.39.x, emrun quits and shuts down the web server
before the complete WebAssembly application can be fetched by the
browser.
Adding "--serve_after_close" to the emrun call restores the original
behavior. That parameter is accepted by previous Emscripten SDK versions
and seems to not change how it used behave in earlier versions.
Task-number: QTCREATORBUG-24072
Change-Id: Ie43604d42eb9c5a7cccd09fdf1c33391dc31098d
Reviewed-by: hjk <hjk@qt.io>
This spares us the typical r = runnable(); modify(r); setRunnable(r)
roundtrip and the m_runnable storage that might or might not
be the same as runControl->runnable. Similar for m_device.
Change-Id: I8300260dd8dd7cd395e40bcd3d2ae45089085008
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This is what the consuming code expects in most cases.
Change-Id: I135592039e28b994996186f627215ab1d2f8d6dc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This combines two of the previous three paths to create run workers,
and refers to RunConfigurations by id, not by type where possible
to decrease coupling between the classes.
Only allow "type of run configuration" and "type of device"
as the only possible kind of restriction and require a uniform
RunWorker constructor signature.
Adapt user code to fit that pattern.
Change-Id: I5a6d49c9a144785fd0235d7586f244b56f67b366
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This change adds WebAssembly support in the shape of a plugin.
- Auto-detection of the emsdk toolchain
- Handling of "asmjs-unknown-emscripten" Abi
- Binary detection of WebAssembly libraries
- Auto-creation of a "WebAssembly runtime" device (with icon)
- Runconfiguration that launches the application via the "emrun"
tool which spawns a local web server and runs the application on
the chosen web browser.
Limitations:
- So far only tested on Windows/MinGW and Linux
- Not yet tested with Qt WebAssembly installation form the installer
Only tested with self-built Qt and manually added kit
- The attempt to launch an application via emrun, while a previous
application is still running, will fail. The reason is that the
web servers spawned by emrun listen to the same default port but
serve only the content of one application.
Possible solutions: We could either spawn the different web servers
with different ports, or we could use one single web server instance
which serves the whole default project location (home directory).
Task-number: QTCREATORBUG-21068
Task-number: QTCREATORBUG-22249
Change-Id: I1a16fbe52382d45c37e9bc624a943a6ca475fa09
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>