From 2bc7f6603c93f9754b5dfe7a86ea0b42ae17f35f Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 30 Jun 2021 15:21:04 +0200 Subject: 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 Reviewed-by: Eike Ziller --- src/plugins/webassembly/webassemblyrunconfiguration.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 8bef1249dc..d50c3abc23 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -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(); -- cgit v1.2.3