Skip to content

Commit 70e3586

Browse files
committed
[ProtoBuf] Update zlib url in protobuf's bazel build.
Signed-off-by: Tongxuan Liu <tongxuan.ltx@alibaba-inc.com>
1 parent b2aaf0f commit 70e3586

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed
Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
1+
From 92fc8b1f8fe8bc095708f200fa59e7808ef55fc0 Mon Sep 17 00:00:00 2001
2+
From: Tongxuan Liu <tongxuan.ltx@alibaba-inc.com>
3+
Date: Thu, 20 Apr 2023 19:11:22 +0800
4+
Subject: [PATCH] Protobuf patch for DeepRec.
5+
6+
---
7+
BUILD | 4 +++-
8+
protobuf.bzl | 2 ++
9+
protobuf_deps.bzl | 2 +-
10+
3 files changed, 6 insertions(+), 2 deletions(-)
11+
112
diff --git a/BUILD b/BUILD
2-
index dbae719ff..87dc38470 100644
13+
index dbae719..87dc384 100644
314
--- a/BUILD
415
+++ b/BUILD
516
@@ -23,7 +23,7 @@ config_setting(
617
# ZLIB configuration
718
################################################################################
8-
19+
920
-ZLIB_DEPS = ["@zlib//:zlib"]
1021
+ZLIB_DEPS = ["@zlib"]
11-
22+
1223
################################################################################
1324
# Protobuf Runtime Library
1425
@@ -143,6 +143,7 @@ cc_library(
@@ -18,7 +29,7 @@ index dbae719ff..87dc38470 100644
1829
+ alwayslink = 1,
1930
visibility = ["//visibility:public"],
2031
)
21-
32+
2233
@@ -213,6 +214,7 @@ cc_library(
2334
copts = COPTS,
2435
includes = ["src/"],
@@ -28,16 +39,31 @@ index dbae719ff..87dc38470 100644
2839
deps = [":protobuf_lite"] + PROTOBUF_DEPS,
2940
)
3041
diff --git a/protobuf.bzl b/protobuf.bzl
31-
index e0653321f..253d9cbb5 100644
42+
index e065332..92ae3b4 100644
3243
--- a/protobuf.bzl
3344
+++ b/protobuf.bzl
34-
@@ -84,7 +84,9 @@ def _proto_gen_impl(ctx):
35-
45+
@@ -85,6 +85,8 @@ def _proto_gen_impl(ctx):
3646
for dep in ctx.attr.deps:
3747
import_flags += dep.proto.import_flags
3848
deps += dep.proto.deps
3949
+ import_flags = depset(import_flags).to_list()
4050
+ deps = depset(deps).to_list()
41-
51+
4252
if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
43-
return struct(
53+
return struct(
54+
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
55+
index 57509ee..00325aa 100644
56+
--- a/protobuf_deps.bzl
57+
+++ b/protobuf_deps.bzl
58+
@@ -11,7 +11,7 @@ def protobuf_deps():
59+
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
60+
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
61+
strip_prefix = "zlib-1.2.11",
62+
- urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
63+
+ urls = ["https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz"],
64+
)
65+
66+
if not native.existing_rule("six"):
67+
--
68+
2.37.1
69+

0 commit comments

Comments
 (0)