From add17a11228770d5238b9be1dc155562fb0242f5 Mon Sep 17 00:00:00 2001 From: Damien Martin-Guillerez Date: Sun, 25 Nov 2018 13:34:46 -0500 Subject: [PATCH] Use http_archive for protobuf repository (#163) http_archive are faster and better caching support compared to git_repository. --- proto/repositories.bzl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/proto/repositories.bzl b/proto/repositories.bzl index cee12d6956..8c7f9bb5bb 100644 --- a/proto/repositories.bzl +++ b/proto/repositories.bzl @@ -13,15 +13,17 @@ # limitations under the License. load("//proto/raze:crates.bzl", _crate_deps = "raze_fetch_remote_crates") -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def rust_proto_repositories(): """Declare dependencies needed for proto compilation.""" if not native.existing_rule("com_google_protobuf"): - git_repository( + http_archive( name = "com_google_protobuf", - remote = "https://github.com/protocolbuffers/protobuf.git", - commit = "7b28271a61a3da0a37f6fda399b0c4c86464e5b3", # 2018-11-16 + # commit 7b28271a61a3da0a37f6fda399b0c4c86464e5b3 is from 2018-11-16 + urls = ["https://github.com/protocolbuffers/protobuf/archive/7b28271a61a3da0a37f6fda399b0c4c86464e5b3.tar.gz"], + strip_prefix = "protobuf-7b28271a61a3da0a37f6fda399b0c4c86464e5b3", + sha256 = "9dac7d7cf6e2c88bf92915f9338a26950531c00c05bf86764ab978344b69a45a", ) _crate_deps()