From 3994b15fea8d38cc6cc7c684bc54b046db220789 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Fri, 16 Feb 2024 09:20:42 -0800 Subject: [PATCH] buildscripts: Avoid vswhere crashing Gradle I'm trying to upgrade to a newer Windows Kokoro image, but the new one has an old vswhere installed that breaks Gradle. Our old image doesn't have vswhere at all. If vswhere isn't found, this rename prints some errors, but the bat script continues executing. So this change is compatible with both the older and newer image. --- buildscripts/kokoro/windows.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildscripts/kokoro/windows.bat b/buildscripts/kokoro/windows.bat index 709b61c988..7b017d5cdb 100644 --- a/buildscripts/kokoro/windows.bat +++ b/buildscripts/kokoro/windows.bat @@ -11,6 +11,8 @@ cd /d %~dp0\..\.. set WORKSPACE=T:\src\github\grpc-java set ESCWORKSPACE=%WORKSPACE:\=\\% +@rem vswhere is too old, so it crashes gradle. https://github.com/gradle/gradle/issues/21993 +rename "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" vswhere-disabled.exe @rem Clear JAVA_HOME to prevent a different Java version from being used