From 09411c80b35d1371bf0865db8801623e0c970c6a Mon Sep 17 00:00:00 2001 From: Dmitri Plotnikov Date: Thu, 14 May 2026 14:29:29 -0700 Subject: [PATCH] Rewrote the Windows presubmit script from .ps1 to .bat to fix execution issues on Kokoro Windows executors where .ps1 files could not be executed directly. Updated the build config to point to the new batch file. PiperOrigin-RevId: 915618695 --- release/kokoro/build_windows.cfg | 2 +- release/kokoro/presubmit_windows.ps1 | 49 ---------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 release/kokoro/presubmit_windows.ps1 diff --git a/release/kokoro/build_windows.cfg b/release/kokoro/build_windows.cfg index 5a81152..7454eac 100644 --- a/release/kokoro/build_windows.cfg +++ b/release/kokoro/build_windows.cfg @@ -1,7 +1,7 @@ # proto-file: //devtools/kokoro/config/proto/build.proto # proto-message: BuildConfig -build_file: "cel-python/release/kokoro/presubmit_windows.ps1" +build_file: "cel-python/release/kokoro/presubmit_windows.bat" timeout_mins: 30 container_properties { diff --git a/release/kokoro/presubmit_windows.ps1 b/release/kokoro/presubmit_windows.ps1 deleted file mode 100644 index 2097dba..0000000 --- a/release/kokoro/presubmit_windows.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -# PowerShell script for Windows Presubmit -$ErrorActionPreference = 'Stop' - -Write-Host '--- Environment Info ---' -Write-Host "Host Name: $env:COMPUTERNAME" -Write-Host "User Name: $env:USERNAME" -Write-Host "Current Directory: $(Get-Location)" - -# Change directory to the repository root -Set-Location "$PSScriptRoot\..\.." -Write-Host "New Directory: $(Get-Location)" - -$PYTHON_EXE = 'python' -if (Get-Command 'python3.11' -ErrorAction SilentlyContinue) { - $PYTHON_EXE = 'python3.11' -} -else { - if (Test-Path 'C:\Python311\python.exe') { - $PYTHON_EXE = 'C:\Python311\python.exe' - } -} - -Write-Host '--- Python Version ---' -& $PYTHON_EXE --version - -# Ensure Bazel is available -Write-Host '--- Bazel Version ---' -& bazel version - -# Build all targets -Write-Host '--- Bazel Build ---' -& bazel build --config=windows //... - -if ($LASTEXITCODE -ne 0) { - Write-Host 'Build failed!' - exit 1 -} - -# Run all tests -Write-Host '--- Bazel Test ---' -& bazel test --config=windows --test_output=errors //... - -if ($LASTEXITCODE -ne 0) { - Write-Host 'Tests failed!' - exit 1 -} - -Write-Host '--- Success ---' -Write-Host 'Build and tests passed successfully.'