From bc2b1690c968cb5aed21b9e65c3ce87e959fa74c Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Thu, 29 Jul 2021 18:17:47 +0800 Subject: [PATCH] ci(thirdparty): add third_party cache GitOrigin-RevId: d54681f0c099a60e816a085ce77084b8957b0592 --- third_party/prepare.sh | 77 ++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/third_party/prepare.sh b/third_party/prepare.sh index bf80b7786..40d71c0e6 100755 --- a/third_party/prepare.sh +++ b/third_party/prepare.sh @@ -15,39 +15,50 @@ if [ "$(printf '%s\n' "$requiredGitVersion" "$currentGitVersion" | ${SORT} -V | echo "Please update your Git version. (foud version $currentGitVersion, required version >= $requiredGitVersion)" exit -1 fi -git submodule sync -git submodule update -f --init midout -git submodule update -f --init intel-mkl-dnn -git submodule update -f --init Halide -git submodule update -f --init protobuf -git submodule update -f --init gtest -git submodule update -f --init flatbuffers -git submodule update -f --init cutlass -git submodule update -f --init Json -git submodule update -f --init pybind11 -git submodule update -f --init llvm-project -git submodule update -f --init range-v3 -git submodule update -f --init libzmq -git submodule update -f --init cppzmq -git submodule update -f --init OpenBLAS -git submodule update -f --init cpuinfo - -name=`git config --get user.name || true` -if [ -z "$name" ]; then - name="default" -fi -email=`git config --get user.email || true` -if [ -z "$email" ]; then - email="default" -fi -source ./apply-patches.sh -apply_cpuinfo_patches ${name} ${email} +function update_cpuinfo() { + git submodule update -f --init cpuinfo + + name=`git config --get user.name || true` + if [ -z "$name" ]; then + name="default" + fi + email=`git config --get user.email || true` + if [ -z "$email" ]; then + email="default" + fi + + source ./apply-patches.sh + apply_cpuinfo_patches ${name} ${email} +} -git submodule update -f --init MegRay -pushd MegRay/third_party >/dev/null +function git_submodule_update() { git submodule sync - git submodule update -f --init nccl - git submodule update -f --init gdrcopy - git submodule update -f --init ucx -popd >/dev/null + git submodule update -f --init midout + git submodule update -f --init intel-mkl-dnn + git submodule update -f --init Halide + git submodule update -f --init protobuf + git submodule update -f --init gtest + git submodule update -f --init flatbuffers + git submodule update -f --init cutlass + git submodule update -f --init Json + git submodule update -f --init pybind11 + git submodule update -f --init llvm-project + git submodule update -f --init range-v3 + git submodule update -f --init libzmq + git submodule update -f --init cppzmq + git submodule update -f --init OpenBLAS + update_cpuinfo + + git submodule update -f --init MegRay + pushd MegRay/third_party >/dev/null + git submodule sync + git submodule update -f --init nccl + git submodule update -f --init gdrcopy + git submodule update -f --init ucx + popd >/dev/null +} + +if [[ -z "${ALREADY_UPDATE_SUBMODULES}" ]]; then + git_submodule_update +fi -- GitLab