execWithResult("{$candidate} --version", false); if ($code === 0) { $python = $candidate; break; } } if ($python === null) { throw new EnvironmentException('meson needs Python 3; the python-win tool package did not install and no system Python was found.'); } if (is_dir($venv)) { FileSystem::removeDir($venv); } cmd()->exec("{$python} -m venv \"{$venv}\"") ->exec("\"{$venv}\\Scripts\\python.exe\" -m pip install --no-index --no-deps \"{$target_path}\""); FileSystem::writeFile("{$dir}\\meson.bat", "@echo off\r\n\"%~dp0venv\\Scripts\\meson.exe\" %*\r\n"); } }