WebAssembly: Fix emcc execution for some emsdk versions on Linux

In order to run emcc 1.39.8 on Ubuntu 20.04., the PATH environment
variable must not be empty, because the emsdk wrapper scripts depend on
it.

Therefore, in WebAssemblyEmSdk::version(), we don't start anymore with a
clean environment bu with the related device environment.

Task-number: QTCREATORBUG-26199
Change-Id: I8b7603ef8126ebaef0fa4ed9e254296623c945e9
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2021-09-06 21:10:28 +02:00
parent f6ede253c7
commit 7d3f59c995

View File

@@ -109,7 +109,7 @@ QVersionNumber WebAssemblyEmSdk::version(const FilePath &sdkRoot)
return {};
const QString cacheKey = sdkRoot.toString();
if (!emSdkVersionCache()->contains(cacheKey)) {
Environment env;
Environment env = sdkRoot.deviceEnvironment();
WebAssemblyEmSdk::addToEnvironment(sdkRoot, env);
QLatin1String scriptFile{sdkRoot.osType() == OsType::OsTypeWindows ? "emcc.bat" : "emcc"};
FilePath script = sdkRoot.withNewPath(scriptFile).searchOnDevice(env.path());