From 6b5a00eb2baf0de73724777db78a5ec63128db66 Mon Sep 17 00:00:00 2001 From: David Neto Date: Wed, 21 Dec 2022 10:49:52 -0500 Subject: Kokoro CI bots use git-sync-deps to get sources (#5031) * Kokoro CI bots use git-sync-deps to get sources Update git-sync-deps to reduce the amount of data downloaded on a first checkout, while being able to checkout the specific commit specified in the DEPS file. Previously the CI bots would only clone --depth=1. But that's not enough to check out a specific commit. So clone either blobless or treeless. For a CI bot, treeless is preferable, because it downloads the least data. For interactive use, blobless is better because it prevents redundant downloads of tree data. See https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ Fixes: #5028 * --treeless decays to blob:none when git is too old * Pin googletest to an older version, to make bazel build work --- kokoro/scripts/linux/build-docker.sh | 16 ++-------------- kokoro/scripts/macos/build.sh | 7 +------ kokoro/scripts/windows/build.bat | 10 ++-------- 3 files changed, 5 insertions(+), 28 deletions(-) (limited to 'kokoro') diff --git a/kokoro/scripts/linux/build-docker.sh b/kokoro/scripts/linux/build-docker.sh index 80043b8a..7d62ee36 100755 --- a/kokoro/scripts/linux/build-docker.sh +++ b/kokoro/scripts/linux/build-docker.sh @@ -30,14 +30,6 @@ fi cd $ROOT_DIR -function clone_if_missing() { - url=$1 - dir=$2 - if [[ ! -d "$dir" ]]; then - git clone ${@:3} "$url" "$dir" - fi -} - function clean_dir() { dir=$1 if [[ -d "$dir" ]]; then @@ -46,12 +38,8 @@ function clean_dir() { mkdir "$dir" } -clone_if_missing https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers --depth=1 -clone_if_missing https://github.com/google/googletest external/googletest -pushd external/googletest; git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7; popd -clone_if_missing https://github.com/google/effcee external/effcee --depth=1 -clone_if_missing https://github.com/google/re2 external/re2 --depth=1 -clone_if_missing https://github.com/protocolbuffers/protobuf external/protobuf --branch v3.13.0.1 +# Get source for dependencies, as specified in the DEPS file +/usr/bin/python3 utils/git-sync-deps --treeless if [ $TOOL = "cmake" ]; then using cmake-3.17.2 diff --git a/kokoro/scripts/macos/build.sh b/kokoro/scripts/macos/build.sh index 3618e690..1d346e76 100644 --- a/kokoro/scripts/macos/build.sh +++ b/kokoro/scripts/macos/build.sh @@ -31,12 +31,7 @@ chmod +x ninja export PATH="$PWD:$PATH" cd $SRC -git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers -git clone https://github.com/google/googletest external/googletest -cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd .. -git clone --depth=1 https://github.com/google/effcee external/effcee -git clone --depth=1 https://github.com/google/re2 external/re2 -git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf +python3 utils/git-sync-deps --treeless mkdir build && cd $SRC/build diff --git a/kokoro/scripts/windows/build.bat b/kokoro/scripts/windows/build.bat index d5ea6d0c..89e1f018 100644 --- a/kokoro/scripts/windows/build.bat +++ b/kokoro/scripts/windows/build.bat @@ -24,14 +24,6 @@ set VS_VERSION=%2 :: Force usage of python 3.6 set PATH=C:\python36;"C:\Program Files\cmake-3.23.1-windows-x86_64\bin";%PATH% -cd %SRC% -git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers -git clone https://github.com/google/googletest external/googletest -cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd .. -git clone --depth=1 https://github.com/google/effcee external/effcee -git clone --depth=1 https://github.com/google/re2 external/re2 -git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf - :: ######################################### :: set up msvc build env :: ######################################### @@ -41,6 +33,8 @@ if %VS_VERSION% == 2017 ( ) cd %SRC% +python utils/git-sync-deps --treeless + mkdir build cd build -- cgit v1.2.3