diff --git a/kokoro/linux/build.sh b/infra/kokoro/linux/build.sh similarity index 87% rename from kokoro/linux/build.sh rename to infra/kokoro/linux/build.sh index 430f6c52a1..c8f8ff5f4e 100755 --- a/kokoro/linux/build.sh +++ b/infra/kokoro/linux/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ set -e # Fail on any error. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )" -ROOT_DIR="$( cd "${SCRIPT_DIR}/../.." >/dev/null 2>&1 && pwd )" +ROOT_DIR="$( cd "${SCRIPT_DIR}/../../.." >/dev/null 2>&1 && pwd )" # Inside the docker VM, we clone the project to a new directory. # We do this so that the docker script can be tested in a local development @@ -35,11 +35,11 @@ fi docker run --rm -i \ --privileged \ --volume "${ROOT_DIR}:${ROOT_DIR}" \ - --volume "${TMP_DIR}/kokoro/tint:/tint" \ + --volume "${TMP_DIR}/kokoro/dawn:/dawn" \ --volume "${KOKORO_ARTIFACTS_DIR}:/mnt/artifacts" \ --workdir "${ROOT_DIR}" \ - --env SRC_DIR="/tint/src" \ - --env BUILD_DIR="/tint/build" \ + --env SRC_DIR="/dawn/src" \ + --env BUILD_DIR="/dawn/build" \ --env BUILD_TYPE=$BUILD_TYPE \ --env BUILD_SYSTEM=$BUILD_SYSTEM \ --env BUILD_SANITIZER=$BUILD_SANITIZER \ diff --git a/kokoro/linux/cmake-clang-debug-asan/build.sh b/infra/kokoro/linux/cmake-clang-debug-asan/build.sh similarity index 94% rename from kokoro/linux/cmake-clang-debug-asan/build.sh rename to infra/kokoro/linux/cmake-clang-debug-asan/build.sh index 55487701f9..9be77da641 100755 --- a/kokoro/linux/cmake-clang-debug-asan/build.sh +++ b/infra/kokoro/linux/cmake-clang-debug-asan/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-clang-debug-asan/presubmit.cfg b/infra/kokoro/linux/cmake-clang-debug-asan/presubmit.cfg new file mode 100644 index 0000000000..1b231fada5 --- /dev/null +++ b/infra/kokoro/linux/cmake-clang-debug-asan/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-clang-debug-asan/build.sh" diff --git a/kokoro/linux/cmake-clang-debug-ubsan/build.sh b/infra/kokoro/linux/cmake-clang-debug-ubsan/build.sh similarity index 94% rename from kokoro/linux/cmake-clang-debug-ubsan/build.sh rename to infra/kokoro/linux/cmake-clang-debug-ubsan/build.sh index 55f4db18df..724fef0eb2 100755 --- a/kokoro/linux/cmake-clang-debug-ubsan/build.sh +++ b/infra/kokoro/linux/cmake-clang-debug-ubsan/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-clang-debug-ubsan/presubmit.cfg b/infra/kokoro/linux/cmake-clang-debug-ubsan/presubmit.cfg new file mode 100644 index 0000000000..cbf14f6cea --- /dev/null +++ b/infra/kokoro/linux/cmake-clang-debug-ubsan/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-clang-debug-ubsan/build.sh" diff --git a/kokoro/linux/cmake-clang-debug/build.sh b/infra/kokoro/linux/cmake-clang-debug/build.sh similarity index 94% rename from kokoro/linux/cmake-clang-debug/build.sh rename to infra/kokoro/linux/cmake-clang-debug/build.sh index fa4fb4cf39..ca8a325cb6 100755 --- a/kokoro/linux/cmake-clang-debug/build.sh +++ b/infra/kokoro/linux/cmake-clang-debug/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-clang-debug/presubmit.cfg b/infra/kokoro/linux/cmake-clang-debug/presubmit.cfg new file mode 100644 index 0000000000..ef352d1537 --- /dev/null +++ b/infra/kokoro/linux/cmake-clang-debug/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-clang-debug/build.sh" diff --git a/kokoro/linux/cmake-clang-release-asan/build.sh b/infra/kokoro/linux/cmake-clang-release-asan/build.sh similarity index 94% rename from kokoro/linux/cmake-clang-release-asan/build.sh rename to infra/kokoro/linux/cmake-clang-release-asan/build.sh index ed598aef01..dda32124f5 100755 --- a/kokoro/linux/cmake-clang-release-asan/build.sh +++ b/infra/kokoro/linux/cmake-clang-release-asan/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-clang-release-asan/presubmit.cfg b/infra/kokoro/linux/cmake-clang-release-asan/presubmit.cfg new file mode 100644 index 0000000000..1a0e3227db --- /dev/null +++ b/infra/kokoro/linux/cmake-clang-release-asan/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-clang-release-asan/build.sh" diff --git a/kokoro/linux/cmake-clang-release-ubsan/build.sh b/infra/kokoro/linux/cmake-clang-release-ubsan/build.sh similarity index 94% rename from kokoro/linux/cmake-clang-release-ubsan/build.sh rename to infra/kokoro/linux/cmake-clang-release-ubsan/build.sh index c476289253..6f1b79ede5 100755 --- a/kokoro/linux/cmake-clang-release-ubsan/build.sh +++ b/infra/kokoro/linux/cmake-clang-release-ubsan/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-clang-release-ubsan/presubmit.cfg b/infra/kokoro/linux/cmake-clang-release-ubsan/presubmit.cfg new file mode 100644 index 0000000000..c9311755bf --- /dev/null +++ b/infra/kokoro/linux/cmake-clang-release-ubsan/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-clang-release-ubsan/build.sh" diff --git a/kokoro/linux/cmake-clang-release/build.sh b/infra/kokoro/linux/cmake-clang-release/build.sh similarity index 94% rename from kokoro/linux/cmake-clang-release/build.sh rename to infra/kokoro/linux/cmake-clang-release/build.sh index 394f5bb427..c4da96d34c 100755 --- a/kokoro/linux/cmake-clang-release/build.sh +++ b/infra/kokoro/linux/cmake-clang-release/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-clang-release/presubmit.cfg b/infra/kokoro/linux/cmake-clang-release/presubmit.cfg new file mode 100644 index 0000000000..4892966388 --- /dev/null +++ b/infra/kokoro/linux/cmake-clang-release/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-clang-release/build.sh" diff --git a/kokoro/linux/cmake-gcc-debug/build.sh b/infra/kokoro/linux/cmake-gcc-debug/build.sh similarity index 94% rename from kokoro/linux/cmake-gcc-debug/build.sh rename to infra/kokoro/linux/cmake-gcc-debug/build.sh index 2bd68bd1e1..0fba5ea82b 100755 --- a/kokoro/linux/cmake-gcc-debug/build.sh +++ b/infra/kokoro/linux/cmake-gcc-debug/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-gcc-debug/presubmit.cfg b/infra/kokoro/linux/cmake-gcc-debug/presubmit.cfg new file mode 100644 index 0000000000..7c7794d7c0 --- /dev/null +++ b/infra/kokoro/linux/cmake-gcc-debug/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-gcc-debug/build.sh" diff --git a/kokoro/linux/cmake-gcc-release/build.sh b/infra/kokoro/linux/cmake-gcc-release/build.sh similarity index 94% rename from kokoro/linux/cmake-gcc-release/build.sh rename to infra/kokoro/linux/cmake-gcc-release/build.sh index 83af742eb4..ac3e3cf571 100755 --- a/kokoro/linux/cmake-gcc-release/build.sh +++ b/infra/kokoro/linux/cmake-gcc-release/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/infra/kokoro/linux/cmake-gcc-release/presubmit.cfg b/infra/kokoro/linux/cmake-gcc-release/presubmit.cfg new file mode 100644 index 0000000000..01e1e34744 --- /dev/null +++ b/infra/kokoro/linux/cmake-gcc-release/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/linux/cmake-gcc-release/build.sh" diff --git a/kokoro/linux/docker.sh b/infra/kokoro/linux/docker.sh similarity index 93% rename from kokoro/linux/docker.sh rename to infra/kokoro/linux/docker.sh index d0ec4c5d73..887c71b9b0 100755 --- a/kokoro/linux/docker.sh +++ b/infra/kokoro/linux/docker.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 The Tint Authors. +# Copyright 2021 The Tint and Dawn Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,16 +15,16 @@ # limitations under the License. # This is the bash script invoked inside a docker container. -# The script expects that the CWD points to a clean checkout of Tint. -# As `gclient sync` will litter the tint checkout with fetched tools and -# projects, this script will first clone the pristine tint checkout to +# The script expects that the CWD points to a clean checkout of Dawn. +# As `gclient sync` will litter the dawn checkout with fetched tools and +# projects, this script will first clone the pristine dawn checkout to # ${SRC_DIR}. This allows developers to locally run this script without having -# to worry about their local tint copy being touched. +# to worry about their local dawn copy being touched. # # This script expects the following environment variables to be set on entry: # -# SRC_DIR - Path to where the local Tint copy will be made. See above. -# BUILD_DIR - Path to where Tint will be built. +# SRC_DIR - Path to where the local Dawn copy will be made. See above. +# BUILD_DIR - Path to where Dawn will be built. # BUILD_TYPE - Either: 'Debug' or 'Release' # BUILD_SYSTEM - Must be 'cmake' # BUILD_SANITIZER - Either: '', 'asan', or 'ubstan' @@ -132,7 +132,7 @@ if [ "$BUILD_SYSTEM" == "cmake" ]; then cmake --build . --target tint-docs hide_cmds - status "Building tint in '${BUILD_DIR}'" + status "Building dawn in '${BUILD_DIR}'" show_cmds cmake ${SRC_DIR} ${CMAKE_FLAGS} ${COMMON_CMAKE_FLAGS} cmake --build . -- --jobs=$(nproc) diff --git a/kokoro/windows/build.bat b/infra/kokoro/windows/build.bat similarity index 92% rename from kokoro/windows/build.bat rename to infra/kokoro/windows/build.bat index c6df367e3b..c041c3db6a 100644 --- a/kokoro/windows/build.bat +++ b/infra/kokoro/windows/build.bat @@ -1,167 +1,167 @@ -@rem Copyright 2021 The Tint Authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. - -@echo off -SETLOCAL ENABLEDELAYEDEXPANSION - -goto :main - -:task_begin -set TASK_NAME=%~1 -echo %TASK_NAME% starting at %Time% -exit /b 0 - -:print_last_task_duration -if not "%TASK_NAME%" == "" ( - echo %TASK_NAME% completed at %Time% -) -exit /b 0 - -:status -echo. -echo. -call :print_last_task_duration -echo. -echo ***************************************************************** -echo %~1 -echo ***************************************************************** -echo. -call :task_begin "%~1" -exit /b 0 - -:main - -set ORIGINAL_SRC_DIR= %~dp0\..\.. -set TEMP_DIR=%TEMP%\tint-temp -set SRC_DIR="%TEMP_DIR%\tint-src" -set BUILD_DIR="%TEMP_DIR%\tint-build" - -cd /d %ORIGINAL_SRC_DIR% -if not exist ".git\" ( - echo "ORIGINAL_SRC_DIR should point to project root: %ORIGINAL_SRC_DIR%" - goto :error -) - -if exist %TEMP_DIR% ( - call :status "Deleting %TEMP_DIR%" - del /q/f/s %TEMP_DIR% > NUL || goto :error - rmdir /q/s %TEMP_DIR% > NUL || goto :error -) -mkdir %TEMP_DIR% || goto :error - -call :status "Fetching and installing DXC" -@echo on -set DXC_RELEASE="https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.6.2112/dxc_2021_12_08.zip" -curl -k -L %DXC_RELEASE% --output "%TEMP_DIR%\dxc_release.zip" || goto :error -powershell.exe -Command "Expand-Archive -LiteralPath '%TEMP_DIR%\dxc_release.zip' -DestinationPath '%TEMP_DIR%\dxc'" || goto :error -set DXC_PATH=%TEMP_DIR%\dxc\bin\x64 - -rem Patch with artifact build that contains fixes not present in the release build -set DXC_ARTIFACT="https://ci.appveyor.com/api/projects/dnovillo/directxshadercompiler/artifacts/build%%2FRelease%%2Fdxc-artifacts.zip?branch=master&pr=false&job=image%%3A%%20Visual%%20Studio%%202019" -curl -k -L %DXC_ARTIFACT% --output "%TEMP_DIR%\dxc_artifact.zip" || goto :error -powershell.exe -Command "Expand-Archive -Force -LiteralPath '%TEMP_DIR%\dxc_artifact.zip' -DestinationPath '%TEMP_DIR%\dxc_artifact'" || goto :error -move /Y %TEMP_DIR%\dxc_artifact\bin\* %DXC_PATH% -@echo off - -call :status "Fetching and installing Windows SDK for d3dcompiler DLL" -@echo on -set WINSDK_DLL_INSTALLER=https://go.microsoft.com/fwlink/?linkid=2164145 -set WINSDK_VERSION=10.0.20348.0 -curl -k -L %WINSDK_DLL_INSTALLER% --output "%TEMP_DIR%\winsdksetup.exe" || goto :error -start "download" /wait "%TEMP_DIR%\winsdksetup.exe" /quiet /norestart /ceip off /features OptionId.DesktopCPPx64 /layout "%TEMP_DIR%\winsdkinstall" || goto :error -start "install" /wait "%TEMP_DIR%\winsdkinstall\Installers\Windows SDK for Windows Store Apps Tools-x86_en-us.msi" || goto :error -set D3DCOMPILER_PATH=C:\Program Files (x86)\Windows Kits\10\bin\%WINSDK_VERSION%\x64 -@echo off - -call :status "Installing depot_tools" -@echo on -pushd %TEMP_DIR% -rem For Windows, we must download and extract a bundle. -rem See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/windows_build_instructions.md#install -powershell -Command "(New-Object Net.WebClient).DownloadFile('https://storage.googleapis.com/chrome-infra/depot_tools.zip', 'depot_tools.zip')" || goto :error -powershell -Command "Expand-Archive -Force 'depot_tools.zip' 'depot_tools'" || goto :error -rem Run gclient once to install deps -set PATH=%TEMP_DIR%\depot_tools;%PATH% -set DEPOT_TOOLS_UPDATE=1 -set DEPOT_TOOLS_WIN_TOOLCHAIN=0 -call gclient || goto :error -@echo off -popd - -call :status "Cloning to clean source directory" -@echo on -mkdir %SRC_DIR% || goto :error -cd /d %SRC_DIR% || goto :error -call git clone %ORIGINAL_SRC_DIR% . || goto :error -@echo off - -call :status "Fetching dependencies" -@echo on -copy standalone.gclient .gclient || goto :error -call gclient sync || goto :error -@echo off - -call :status "Configuring build system" -@echo on -mkdir %BUILD_DIR% -cd /d %BUILD_DIR% -set COMMON_CMAKE_FLAGS=-DTINT_BUILD_DOCS=O -DTINT_BUILD_BENCHMARKS=1 -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -@echo off - -call :status "Building tint" -@echo on -rem Disable msbuild "Intermediate or Output directory cannot reside in Temporary directory" -set IgnoreWarnIntDirInTempDetected=true -rem Add Python3 to path as this Kokoro image only has Python2 in it -set PATH=C:\Python37;%PATH% -rem To use ninja with CMake requires VC env vars -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" -@echo on -rem Note that we need to specify the C and C++ compiler only because Cygwin is in PATH and CMake finds GCC and picks that over MSVC -cmake %SRC_DIR% -G "Ninja" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" %COMMON_CMAKE_FLAGS% || goto :error -cmake --build . || goto :error -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" /clean_env -@echo off - -call :status "Running tint_unittests" -@echo on -tint_unittests.exe || goto :error -@echo off - -call :status "Testing test/tint/test-all.sh" -@echo on -cd /d %SRC_DIR% || goto :error -rem Run tests with DXC and Metal validation -set OLD_PATH=%PATH% -set PATH=C:\Program Files\Metal Developer Tools\macos\bin;%PATH% -where metal.exe -set PATH=%DXC_PATH%;%OLD_PATH% -where dxc.exe dxil.dll -call git bash -- ./test/tint/test-all.sh ../tint-build/tint.exe --verbose || goto :error -@echo on -set PATH=%OLD_PATH% -rem Run again to test with FXC validation -set PATH=%D3DCOMPILER_PATH%;%OLD_PATH% -where d3dcompiler_47.dll -call git bash -- ./test/tint/test-all.sh ../tint-build/tint.exe --verbose --format hlsl --fxc || goto :error -@echo on -set PATH=%OLD_PATH% -@echo off - -call :status "Done" -exit /b 0 - -:error -echo BUILD FAILED! errorlevel: %errorlevel% -exit /b %errorlevel% +@rem Copyright 2021 The Tint and Dawn Authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo off +SETLOCAL ENABLEDELAYEDEXPANSION + +goto :main + +:task_begin +set TASK_NAME=%~1 +echo %TASK_NAME% starting at %Time% +exit /b 0 + +:print_last_task_duration +if not "%TASK_NAME%" == "" ( + echo %TASK_NAME% completed at %Time% +) +exit /b 0 + +:status +echo. +echo. +call :print_last_task_duration +echo. +echo ***************************************************************** +echo %~1 +echo ***************************************************************** +echo. +call :task_begin "%~1" +exit /b 0 + +:main + +set ORIGINAL_SRC_DIR= %~dp0\..\..\.. +set TEMP_DIR=%TEMP%\dawn-temp +set SRC_DIR="%TEMP_DIR%\dawn-src" +set BUILD_DIR="%TEMP_DIR%\dawn-build" + +cd /d %ORIGINAL_SRC_DIR% +if not exist ".git\" ( + echo "ORIGINAL_SRC_DIR should point to project root: %ORIGINAL_SRC_DIR%" + goto :error +) + +if exist %TEMP_DIR% ( + call :status "Deleting %TEMP_DIR%" + del /q/f/s %TEMP_DIR% > NUL || goto :error + rmdir /q/s %TEMP_DIR% > NUL || goto :error +) +mkdir %TEMP_DIR% || goto :error + +call :status "Fetching and installing DXC" +@echo on +set DXC_RELEASE="https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.6.2112/dxc_2021_12_08.zip" +curl -k -L %DXC_RELEASE% --output "%TEMP_DIR%\dxc_release.zip" || goto :error +powershell.exe -Command "Expand-Archive -LiteralPath '%TEMP_DIR%\dxc_release.zip' -DestinationPath '%TEMP_DIR%\dxc'" || goto :error +set DXC_PATH=%TEMP_DIR%\dxc\bin\x64 + +rem Patch with artifact build that contains fixes not present in the release build +set DXC_ARTIFACT="https://ci.appveyor.com/api/projects/dnovillo/directxshadercompiler/artifacts/build%%2FRelease%%2Fdxc-artifacts.zip?branch=master&pr=false&job=image%%3A%%20Visual%%20Studio%%202019" +curl -k -L %DXC_ARTIFACT% --output "%TEMP_DIR%\dxc_artifact.zip" || goto :error +powershell.exe -Command "Expand-Archive -Force -LiteralPath '%TEMP_DIR%\dxc_artifact.zip' -DestinationPath '%TEMP_DIR%\dxc_artifact'" || goto :error +move /Y %TEMP_DIR%\dxc_artifact\bin\* %DXC_PATH% +@echo off + +call :status "Fetching and installing Windows SDK for d3dcompiler DLL" +@echo on +set WINSDK_DLL_INSTALLER=https://go.microsoft.com/fwlink/?linkid=2164145 +set WINSDK_VERSION=10.0.20348.0 +curl -k -L %WINSDK_DLL_INSTALLER% --output "%TEMP_DIR%\winsdksetup.exe" || goto :error +start "download" /wait "%TEMP_DIR%\winsdksetup.exe" /quiet /norestart /ceip off /features OptionId.DesktopCPPx64 /layout "%TEMP_DIR%\winsdkinstall" || goto :error +start "install" /wait "%TEMP_DIR%\winsdkinstall\Installers\Windows SDK for Windows Store Apps Tools-x86_en-us.msi" || goto :error +set D3DCOMPILER_PATH=C:\Program Files (x86)\Windows Kits\10\bin\%WINSDK_VERSION%\x64 +@echo off + +call :status "Installing depot_tools" +@echo on +pushd %TEMP_DIR% +rem For Windows, we must download and extract a bundle. +rem See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/windows_build_instructions.md#install +powershell -Command "(New-Object Net.WebClient).DownloadFile('https://storage.googleapis.com/chrome-infra/depot_tools.zip', 'depot_tools.zip')" || goto :error +powershell -Command "Expand-Archive -Force 'depot_tools.zip' 'depot_tools'" || goto :error +rem Run gclient once to install deps +set PATH=%TEMP_DIR%\depot_tools;%PATH% +set DEPOT_TOOLS_UPDATE=1 +set DEPOT_TOOLS_WIN_TOOLCHAIN=0 +call gclient || goto :error +@echo off +popd + +call :status "Cloning to clean source directory" +@echo on +mkdir %SRC_DIR% || goto :error +cd /d %SRC_DIR% || goto :error +call git clone %ORIGINAL_SRC_DIR% . || goto :error +@echo off + +call :status "Fetching dependencies" +@echo on +copy standalone.gclient .gclient || goto :error +call gclient sync || goto :error +@echo off + +call :status "Configuring build system" +@echo on +mkdir %BUILD_DIR% +cd /d %BUILD_DIR% +set COMMON_CMAKE_FLAGS=-DTINT_BUILD_DOCS=O -DTINT_BUILD_BENCHMARKS=1 -DCMAKE_BUILD_TYPE=%BUILD_TYPE% +@echo off + +call :status "Building dawn" +@echo on +rem Disable msbuild "Intermediate or Output directory cannot reside in Temporary directory" +set IgnoreWarnIntDirInTempDetected=true +rem Add Python3 to path as this Kokoro image only has Python2 in it +set PATH=C:\Python37;%PATH% +rem To use ninja with CMake requires VC env vars +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" +@echo on +rem Note that we need to specify the C and C++ compiler only because Cygwin is in PATH and CMake finds GCC and picks that over MSVC +cmake %SRC_DIR% -G "Ninja" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" %COMMON_CMAKE_FLAGS% || goto :error +cmake --build . || goto :error +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" /clean_env +@echo off + +call :status "Running tint_unittests" +@echo on +tint_unittests.exe || goto :error +@echo off + +call :status "Testing test/tint/test-all.sh" +@echo on +cd /d %SRC_DIR% || goto :error +rem Run tests with DXC and Metal validation +set OLD_PATH=%PATH% +set PATH=C:\Program Files\Metal Developer Tools\macos\bin;%PATH% +where metal.exe +set PATH=%DXC_PATH%;%OLD_PATH% +where dxc.exe dxil.dll +call git bash -- ./test/tint/test-all.sh ../dawn-build/tint.exe --verbose || goto :error +@echo on +set PATH=%OLD_PATH% +rem Run again to test with FXC validation +set PATH=%D3DCOMPILER_PATH%;%OLD_PATH% +where d3dcompiler_47.dll +call git bash -- ./test/tint/test-all.sh ../dawn-build/tint.exe --verbose --format hlsl --fxc || goto :error +@echo on +set PATH=%OLD_PATH% +@echo off + +call :status "Done" +exit /b 0 + +:error +echo BUILD FAILED! errorlevel: %errorlevel% +exit /b %errorlevel% diff --git a/kokoro/windows/cmake-msvc2019-debug/build.bat b/infra/kokoro/windows/cmake-msvc2019-debug/build.bat similarity index 92% rename from kokoro/windows/cmake-msvc2019-debug/build.bat rename to infra/kokoro/windows/cmake-msvc2019-debug/build.bat index 25db34775f..53bc86562a 100644 --- a/kokoro/windows/cmake-msvc2019-debug/build.bat +++ b/infra/kokoro/windows/cmake-msvc2019-debug/build.bat @@ -1,18 +1,18 @@ -@rem Copyright 2021 The Tint Authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. - -@echo on -set BUILD_TYPE=Debug -call %~dp0\..\build.bat -exit /b %errorlevel% +@rem Copyright 2021 The Tint and Dawn Authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo on +set BUILD_TYPE=Debug +call %~dp0\..\build.bat +exit /b %errorlevel% diff --git a/infra/kokoro/windows/cmake-msvc2019-debug/presubmit.cfg b/infra/kokoro/windows/cmake-msvc2019-debug/presubmit.cfg new file mode 100644 index 0000000000..8d6fe1a79c --- /dev/null +++ b/infra/kokoro/windows/cmake-msvc2019-debug/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/windows/cmake-msvc2019-debug/build.bat" diff --git a/kokoro/windows/cmake-msvc2019-release/build.bat b/infra/kokoro/windows/cmake-msvc2019-release/build.bat similarity index 92% rename from kokoro/windows/cmake-msvc2019-release/build.bat rename to infra/kokoro/windows/cmake-msvc2019-release/build.bat index a2f607216b..25b5d8cfde 100644 --- a/kokoro/windows/cmake-msvc2019-release/build.bat +++ b/infra/kokoro/windows/cmake-msvc2019-release/build.bat @@ -1,18 +1,18 @@ -@rem Copyright 2021 The Tint Authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. - -@echo on -set BUILD_TYPE=Release -call %~dp0\..\build.bat -exit /b %errorlevel% +@rem Copyright 2021 The Tint and Dawn Authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo on +set BUILD_TYPE=Release +call %~dp0\..\build.bat +exit /b %errorlevel% diff --git a/infra/kokoro/windows/cmake-msvc2019-release/presubmit.cfg b/infra/kokoro/windows/cmake-msvc2019-release/presubmit.cfg new file mode 100644 index 0000000000..4cbcba0ae9 --- /dev/null +++ b/infra/kokoro/windows/cmake-msvc2019-release/presubmit.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "dawn/infra/kokoro/windows/cmake-msvc2019-release/build.bat" diff --git a/kokoro/linux/cmake-clang-debug-asan/presubmit.cfg b/kokoro/linux/cmake-clang-debug-asan/presubmit.cfg deleted file mode 100644 index bf23a27de1..0000000000 --- a/kokoro/linux/cmake-clang-debug-asan/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-clang-debug-asan/build.sh" diff --git a/kokoro/linux/cmake-clang-debug-ubsan/presubmit.cfg b/kokoro/linux/cmake-clang-debug-ubsan/presubmit.cfg deleted file mode 100644 index 5fa246e0c4..0000000000 --- a/kokoro/linux/cmake-clang-debug-ubsan/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-clang-debug-ubsan/build.sh" diff --git a/kokoro/linux/cmake-clang-debug/presubmit.cfg b/kokoro/linux/cmake-clang-debug/presubmit.cfg deleted file mode 100644 index 0cc8654394..0000000000 --- a/kokoro/linux/cmake-clang-debug/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-clang-debug/build.sh" diff --git a/kokoro/linux/cmake-clang-release-asan/presubmit.cfg b/kokoro/linux/cmake-clang-release-asan/presubmit.cfg deleted file mode 100644 index 460c9270cd..0000000000 --- a/kokoro/linux/cmake-clang-release-asan/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-clang-release-asan/build.sh" diff --git a/kokoro/linux/cmake-clang-release-ubsan/presubmit.cfg b/kokoro/linux/cmake-clang-release-ubsan/presubmit.cfg deleted file mode 100644 index f968295bc6..0000000000 --- a/kokoro/linux/cmake-clang-release-ubsan/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-clang-release-ubsan/build.sh" diff --git a/kokoro/linux/cmake-clang-release/presubmit.cfg b/kokoro/linux/cmake-clang-release/presubmit.cfg deleted file mode 100644 index ccc9651b67..0000000000 --- a/kokoro/linux/cmake-clang-release/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-clang-release/build.sh" diff --git a/kokoro/linux/cmake-gcc-debug/presubmit.cfg b/kokoro/linux/cmake-gcc-debug/presubmit.cfg deleted file mode 100644 index eb1d4d8f3d..0000000000 --- a/kokoro/linux/cmake-gcc-debug/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-gcc-debug/build.sh" diff --git a/kokoro/linux/cmake-gcc-release/presubmit.cfg b/kokoro/linux/cmake-gcc-release/presubmit.cfg deleted file mode 100644 index 95a6cfcd89..0000000000 --- a/kokoro/linux/cmake-gcc-release/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/linux/cmake-gcc-release/build.sh" diff --git a/kokoro/windows/cmake-msvc2019-debug/presubmit.cfg b/kokoro/windows/cmake-msvc2019-debug/presubmit.cfg deleted file mode 100644 index c977aa8165..0000000000 --- a/kokoro/windows/cmake-msvc2019-debug/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/windows/cmake-msvc2019-debug/build.bat" diff --git a/kokoro/windows/cmake-msvc2019-release/presubmit.cfg b/kokoro/windows/cmake-msvc2019-release/presubmit.cfg deleted file mode 100644 index 00acdd60c4..0000000000 --- a/kokoro/windows/cmake-msvc2019-release/presubmit.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "tint/kokoro/windows/cmake-msvc2019-release/build.bat" diff --git a/tools/lint b/tools/lint index c1b727ee9d..0aa38ba1f0 100755 --- a/tools/lint +++ b/tools/lint @@ -24,7 +24,7 @@ if ! command -v cpplint.py &> /dev/null; then fi FILTER="-runtime/references" -FILES="`find src -type f` `find src/tint/cmd -type f`" +FILES="`find src/tint -type f` `find src/tint/cmd -type f`" FILES+="`find tools/src -type f` `find src/tint/cmd -type f`" if command -v go &> /dev/null; then