-
Notifications
You must be signed in to change notification settings - Fork 360
Expand file tree
/
Copy pathprotobuf.patch
More file actions
69 lines (61 loc) · 2.11 KB
/
protobuf.patch
File metadata and controls
69 lines (61 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 92fc8b1f8fe8bc095708f200fa59e7808ef55fc0 Mon Sep 17 00:00:00 2001
From: Tongxuan Liu <tongxuan.ltx@alibaba-inc.com>
Date: Thu, 20 Apr 2023 19:11:22 +0800
Subject: [PATCH] Protobuf patch for DeepRec.
---
BUILD | 4 +++-
protobuf.bzl | 2 ++
protobuf_deps.bzl | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/BUILD b/BUILD
index dbae719..87dc384 100644
--- a/BUILD
+++ b/BUILD
@@ -23,7 +23,7 @@ config_setting(
# ZLIB configuration
################################################################################
-ZLIB_DEPS = ["@zlib//:zlib"]
+ZLIB_DEPS = ["@zlib"]
################################################################################
# Protobuf Runtime Library
@@ -143,6 +143,7 @@ cc_library(
copts = COPTS,
includes = ["src/"],
linkopts = LINK_OPTS,
+ alwayslink = 1,
visibility = ["//visibility:public"],
)
@@ -213,6 +214,7 @@ cc_library(
copts = COPTS,
includes = ["src/"],
linkopts = LINK_OPTS,
+ alwayslink = 1,
visibility = ["//visibility:public"],
deps = [":protobuf_lite"] + PROTOBUF_DEPS,
)
diff --git a/protobuf.bzl b/protobuf.bzl
index e065332..92ae3b4 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -85,6 +85,8 @@ def _proto_gen_impl(ctx):
for dep in ctx.attr.deps:
import_flags += dep.proto.import_flags
deps += dep.proto.deps
+ import_flags = depset(import_flags).to_list()
+ deps = depset(deps).to_list()
if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
return struct(
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index 57509ee..00325aa 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -11,7 +11,7 @@ def protobuf_deps():
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
- urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
+ urls = ["https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz"],
)
if not native.existing_rule("six"):
--
2.37.1