From 90f2bda561cb7d4445fa261c166c8dddfea0a644 Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 9 Jan 2025 17:07:37 -0500 Subject: [PATCH] kokoro: add VS2022 scripts Refactor how files and scripts are named. Add an %ARCH% argument to the build script, in anticipation of adding arm64 builds later. --- kokoro/windows/build.bat | 6 +++-- ...ug_2019.bat => build_2019_amd64_debug.bat} | 2 +- ..._2019.bat => build_2019_amd64_release.bat} | 2 +- kokoro/windows/build_2022_amd64_debug.bat | 23 +++++++++++++++++++ kokoro/windows/build_2022_amd64_release.bat | 23 +++++++++++++++++++ kokoro/windows/continuous_debug_2019.cfg | 2 +- kokoro/windows/continuous_release_2019.cfg | 2 +- kokoro/windows/presubmit_debug_2019.cfg | 2 +- kokoro/windows/presubmit_release_2019.cfg | 2 +- .../windows/vs2022_amd64_debug_continuous.cfg | 22 ++++++++++++++++++ .../windows/vs2022_amd64_debug_presubmit.cfg | 22 ++++++++++++++++++ .../vs2022_amd64_release_continuous.cfg | 22 ++++++++++++++++++ .../vs2022_amd64_release_presubmit.cfg | 22 ++++++++++++++++++ 13 files changed, 144 insertions(+), 8 deletions(-) rename kokoro/windows/{build_debug_2019.bat => build_2019_amd64_debug.bat} (94%) rename kokoro/windows/{build_release_2019.bat => build_2019_amd64_release.bat} (93%) create mode 100644 kokoro/windows/build_2022_amd64_debug.bat create mode 100644 kokoro/windows/build_2022_amd64_release.bat create mode 100644 kokoro/windows/vs2022_amd64_debug_continuous.cfg create mode 100644 kokoro/windows/vs2022_amd64_debug_presubmit.cfg create mode 100644 kokoro/windows/vs2022_amd64_release_continuous.cfg create mode 100644 kokoro/windows/vs2022_amd64_release_presubmit.cfg diff --git a/kokoro/windows/build.bat b/kokoro/windows/build.bat index 66402cc5f..9746a8651 100644 --- a/kokoro/windows/build.bat +++ b/kokoro/windows/build.bat @@ -20,6 +20,7 @@ set BUILD_ROOT=%cd% set SRC=%cd%\github\shaderc set BUILD_TYPE=%1 set VS_VERSION=%2 +set ARCH=%3 :: Force usage of python 3.12 set PATH=C:\python312;%PATH% @@ -38,8 +39,9 @@ cd %SRC%\build :: set up msvc build env :: ######################################### if %VS_VERSION% == 2019 ( - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 - echo "Using VS 2019..." + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% +) else if %VS_VERSION% == 2022 ( + call "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% ) :: ######################################### diff --git a/kokoro/windows/build_debug_2019.bat b/kokoro/windows/build_2019_amd64_debug.bat similarity index 94% rename from kokoro/windows/build_debug_2019.bat rename to kokoro/windows/build_2019_amd64_debug.bat index ea173d984..ef2b10e3c 100644 --- a/kokoro/windows/build_debug_2019.bat +++ b/kokoro/windows/build_2019_amd64_debug.bat @@ -20,4 +20,4 @@ set SCRIPT_DIR=%~dp0 :: Call with correct parameter -call %SCRIPT_DIR%\build.bat Debug 2019 +call %SCRIPT_DIR%\build.bat Debug 2019 amd64 diff --git a/kokoro/windows/build_release_2019.bat b/kokoro/windows/build_2019_amd64_release.bat similarity index 93% rename from kokoro/windows/build_release_2019.bat rename to kokoro/windows/build_2019_amd64_release.bat index f0611e3d1..ebb09cc9b 100644 --- a/kokoro/windows/build_release_2019.bat +++ b/kokoro/windows/build_2019_amd64_release.bat @@ -20,4 +20,4 @@ set SCRIPT_DIR=%~dp0 :: Call with correct parameter -call %SCRIPT_DIR%\build.bat RelWithDebInfo 2019 +call %SCRIPT_DIR%\build.bat RelWithDebInfo 2019 amd64 diff --git a/kokoro/windows/build_2022_amd64_debug.bat b/kokoro/windows/build_2022_amd64_debug.bat new file mode 100644 index 000000000..a3e993a95 --- /dev/null +++ b/kokoro/windows/build_2022_amd64_debug.bat @@ -0,0 +1,23 @@ +:: Copyright (C) 2025 Google Inc. +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: +:: Windows Build Script. + +@echo on + +:: Find out the directory of the common build script. +set SCRIPT_DIR=%~dp0 + +:: Call with correct parameter +call %SCRIPT_DIR%\build.bat Debug 2022 amd64 diff --git a/kokoro/windows/build_2022_amd64_release.bat b/kokoro/windows/build_2022_amd64_release.bat new file mode 100644 index 000000000..467a57593 --- /dev/null +++ b/kokoro/windows/build_2022_amd64_release.bat @@ -0,0 +1,23 @@ +:: Copyright (C) 2025 Google Inc. +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: +:: Windows Build Script. + +@echo on + +:: Find out the directory of the common build script. +set SCRIPT_DIR=%~dp0 + +:: Call with correct parameter +call %SCRIPT_DIR%\build.bat RelWithDebInfo 2022 amd64 diff --git a/kokoro/windows/continuous_debug_2019.cfg b/kokoro/windows/continuous_debug_2019.cfg index 3600e1b5d..e0bb40a8b 100644 --- a/kokoro/windows/continuous_debug_2019.cfg +++ b/kokoro/windows/continuous_debug_2019.cfg @@ -13,7 +13,7 @@ # limitations under the License. # Continuous build configuration. -build_file: "shaderc/kokoro/windows/build_debug_2019.bat" +build_file: "shaderc/kokoro/windows/build_2019_amd64_debug.bat" action { define_artifacts { diff --git a/kokoro/windows/continuous_release_2019.cfg b/kokoro/windows/continuous_release_2019.cfg index 8cbbc7e26..83440b34f 100644 --- a/kokoro/windows/continuous_release_2019.cfg +++ b/kokoro/windows/continuous_release_2019.cfg @@ -13,7 +13,7 @@ # limitations under the License. # Continuous build configuration. -build_file: "shaderc/kokoro/windows/build_release_2019.bat" +build_file: "shaderc/kokoro/windows/build_2019_amd64_release.bat" action { define_artifacts { diff --git a/kokoro/windows/presubmit_debug_2019.cfg b/kokoro/windows/presubmit_debug_2019.cfg index 7aa76d895..cb670675a 100644 --- a/kokoro/windows/presubmit_debug_2019.cfg +++ b/kokoro/windows/presubmit_debug_2019.cfg @@ -13,4 +13,4 @@ # limitations under the License. # Presubmit build configuration. -build_file: "shaderc/kokoro/windows/build_debug_2019.bat" +build_file: "shaderc/kokoro/windows/build_2019_amd64_debug.bat" diff --git a/kokoro/windows/presubmit_release_2019.cfg b/kokoro/windows/presubmit_release_2019.cfg index 734cff0c0..62f6ad672 100644 --- a/kokoro/windows/presubmit_release_2019.cfg +++ b/kokoro/windows/presubmit_release_2019.cfg @@ -13,4 +13,4 @@ # limitations under the License. # Presubmit build configuration. -build_file: "shaderc/kokoro/windows/build_release_2019.bat" +build_file: "shaderc/kokoro/windows/build_2019_amd64_release.bat" diff --git a/kokoro/windows/vs2022_amd64_debug_continuous.cfg b/kokoro/windows/vs2022_amd64_debug_continuous.cfg new file mode 100644 index 000000000..1dbfab3d7 --- /dev/null +++ b/kokoro/windows/vs2022_amd64_debug_continuous.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2025 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Continuous build configuration. +build_file: "shaderc/kokoro/windows/build_2022_amd64_debug.bat" + +action { + define_artifacts { + regex: "install.zip" + } +} diff --git a/kokoro/windows/vs2022_amd64_debug_presubmit.cfg b/kokoro/windows/vs2022_amd64_debug_presubmit.cfg new file mode 100644 index 000000000..541793810 --- /dev/null +++ b/kokoro/windows/vs2022_amd64_debug_presubmit.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2025 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Presubmit build configuration. +build_file: "shaderc/kokoro/windows/build_2022_amd64_debug.bat" + +action { + define_artifacts { + regex: "install.zip" + } +} diff --git a/kokoro/windows/vs2022_amd64_release_continuous.cfg b/kokoro/windows/vs2022_amd64_release_continuous.cfg new file mode 100644 index 000000000..3237fea7f --- /dev/null +++ b/kokoro/windows/vs2022_amd64_release_continuous.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2025 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Continuous build configuration. +build_file: "shaderc/kokoro/windows/build_2022_amd64_release.bat" + +action { + define_artifacts { + regex: "install.zip" + } +} diff --git a/kokoro/windows/vs2022_amd64_release_presubmit.cfg b/kokoro/windows/vs2022_amd64_release_presubmit.cfg new file mode 100644 index 000000000..d566e9b95 --- /dev/null +++ b/kokoro/windows/vs2022_amd64_release_presubmit.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2025 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Presubmit build configuration. +build_file: "shaderc/kokoro/windows/build_2022_amd64_release.bat" + +action { + define_artifacts { + regex: "install.zip" + } +}