A more reliable way of installing bazel on windows workers (#28835)

* more reliable bazel installation for win bazel RBE builds

* win RBE build already using the same credentials

* also recognize MSYS_NT returned by kokoro workers
pull/28890/head
Jan Tattermusch 3 years ago committed by GitHub
parent d1db000f62
commit fea1f3de33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      tools/bazel
  2. 10
      tools/internal_ci/windows/bazel_rbe.bat

@ -41,7 +41,7 @@ then
fi
# IMPORTANT: if you update the version here, other parts of infrastructure might needs updating as well
# (e.g. win RBE builds, sanity checks, bazel toolchains etc.)
# (e.g. sanity checks, bazel toolchains etc.)
VERSION=${OVERRIDE_BAZEL_VERSION:-4.2.1}
echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." >&2
@ -62,6 +62,9 @@ case $(uname -sm) in
"Darwin x86_64")
suffix=darwin-x86_64
;;
"MINGW"* | "MSYS_NT"*)
suffix=windows-x86_64.exe
;;
*)
echo "Unsupported architecture: $(uname -sm)" >&2
exit 1

@ -26,15 +26,17 @@ cd github/grpc
call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
@rem TODO(jtattermusch): make this generate less output
@rem TODO(jtattermusch): use tools/bazel script to keep the versions in sync
choco install bazel -y --version 4.2.1 --limit-output || exit /b 1
@rem Install bazel
@rem Side effect of the tools/bazel script is that it downloads the correct version of bazel binary.
mkdir C:\bazel
bash -c "tools/bazel --version && cp tools/bazel-*.exe /c/bazel/bazel.exe"
set PATH=C:\bazel;%PATH%
bazel --version
@rem Generate a random UUID and store in "bazel_invocation_ids" artifact file
powershell -Command "[guid]::NewGuid().ToString()" >%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
set /p BAZEL_INVOCATION_ID=<%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
@rem TODO(jtattermusch): windows RBE should be able to use the same credentials as Linux RBE.
bazel --bazelrc=tools/remote_build/windows.bazelrc --output_user_root=T:\_bazel_output test --invocation_id="%BAZEL_INVOCATION_ID%" %BAZEL_FLAGS% --workspace_status_command=tools/remote_build/workspace_status_kokoro.bat //test/...
set BAZEL_EXITCODE=%errorlevel%

Loading…
Cancel
Save