From 7683f6995b6120b8ffcc2eedb294cc920b99eadf Mon Sep 17 00:00:00 2001 From: Wiktor Garbacz Date: Wed, 19 Jul 2023 05:19:41 -0700 Subject: [PATCH] Do not use GIT in FetchContent_Declare This causes whole repo (with history) to be fetched. Protobuf repo is especially big (>200MiB). PiperOrigin-RevId: 549285765 Change-Id: Ifb5e3a549a014adb51e6e5eef41e72abf0149558 --- cmake/abseil-cpp.cmake | 4 ++-- cmake/benchmark.cmake | 4 ++-- cmake/googletest.cmake | 4 ++-- cmake/protobuf.cmake | 4 ++-- sandboxed_api/bazel/sapi_deps.bzl | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake index feae440..f8abf64 100644 --- a/cmake/abseil-cpp.cmake +++ b/cmake/abseil-cpp.cmake @@ -13,8 +13,8 @@ # limitations under the License. FetchContent_Declare(absl - GIT_REPOSITORY https://github.com/abseil/abseil-cpp - GIT_TAG ae87791869cacbc125aa708108c4721e51ff703d # 2023-06-08 + URL https://github.com/abseil/abseil-cpp/archive/ae87791869cacbc125aa708108c4721e51ff703d.zip # 2023-06-08 + URL_HASH SHA256=fbe050daabadda2297cea9ace55ccde48e3994887bc0b1e6c7330f1a97ee071b ) set(ABSL_CXX_STANDARD ${SAPI_CXX_STANDARD} CACHE STRING "" FORCE) set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "" FORCE) diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index 10c8add..e900b17 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -13,8 +13,8 @@ # limitations under the License. FetchContent_Declare(benchmark - GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG 604f6fd3f4b34a84ec4eb4db81d842fa4db829cd # 2023-05-30 + URL https://github.com/google/benchmark/archive/604f6fd3f4b34a84ec4eb4db81d842fa4db829cd.zip # 2023-05-30 + URL_HASH SHA256=342705876335bf894147e052d0dac141fe15962034b41bef5aa59c4b279ca89c ) set(BENCHMARK_ENABLE_TESTING OFF) set(BENCHMARK_ENABLE_EXCEPTIONS OFF) diff --git a/cmake/googletest.cmake b/cmake/googletest.cmake index e79eba7..ba04c21 100644 --- a/cmake/googletest.cmake +++ b/cmake/googletest.cmake @@ -13,7 +13,7 @@ # limitations under the License. FetchContent_Declare(googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG 334704df263b480a3e9e7441ed3292a5e30a37ec # 2023-06-06 + URL https://github.com/google/googletest/archive/334704df263b480a3e9e7441ed3292a5e30a37ec.zip # 2023-06-06 + URL_HASH SHA256=a217118c2c36a3632b594af7ff98111a65bb2b980b726a7fa62305e02a998440 ) FetchContent_MakeAvailable(googletest) diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake index 71679ef..98c7fbf 100644 --- a/cmake/protobuf.cmake +++ b/cmake/protobuf.cmake @@ -13,8 +13,8 @@ # limitations under the License. FetchContent_Declare(protobuf - GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git - GIT_TAG v23.2 # 2023-05-26 + URL https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protobuf-23.4.tar.gz + URL_HASH SHA256=a700a49470d301f1190a487a923b5095bf60f08f4ae4cac9f5f7c36883d17971 ) set(protobuf_ABSL_PROVIDER "package" CACHE STRING "" FORCE) diff --git a/sandboxed_api/bazel/sapi_deps.bzl b/sandboxed_api/bazel/sapi_deps.bzl index b16ac5a..0237615 100644 --- a/sandboxed_api/bazel/sapi_deps.bzl +++ b/sandboxed_api/bazel/sapi_deps.bzl @@ -63,9 +63,9 @@ def sapi_deps(): maybe( http_archive, name = "com_google_protobuf", - sha256 = "ddf8c9c1ffccb7e80afd183b3bd32b3b62f7cc54b106be190bf49f2bc09daab5", # 2023-05-26 - strip_prefix = "protobuf-23.2", - urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protobuf-23.2.tar.gz"], + sha256 = "a700a49470d301f1190a487a923b5095bf60f08f4ae4cac9f5f7c36883d17971", # 2023-07-06 + strip_prefix = "protobuf-23.4", + urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protobuf-23.4.tar.gz"], ) # libcap