WebAssembly: (Win) Use python.exe from EMSDK_PYTHON instead from Path

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>
This commit is contained in:
Alessandro Portale
2021-06-30 15:21:04 +02:00
parent afa4218871
commit 2bc7f6603c

View File

@@ -50,8 +50,9 @@ static CommandLine emrunCommand(Target *target, const QString &browser, const QS
// that the web server is killed when the application is stopped in Qt Creator.
// On Non-windows, we prefer using the shell script, because that knows how to find the
// right python (not part of emsdk). The shell script stays attached to the server process.
const FilePath interpreter = bc->environment().searchInPath(
QLatin1String(HostOsInfo::isWindowsHost() ? "python" : "sh"));
const FilePath interpreter = HostOsInfo::isWindowsHost()
? FilePath::fromUserInput(bc->environment().value("EMSDK_PYTHON"))
: bc->environment().searchInPath("sh");
const QString emrunLaunchScript = HostOsInfo::isWindowsHost()
? emrun.absolutePath() + "/" + emrun.baseName() + ".py"
: emrun.absoluteFilePath();