about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/http/envoy/protobuf.patch
blob: dc7026350316cbc582c568acdc273fadedc7416d (plain) (blame)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
diff --git a/BUILD.bazel b/BUILD.bazel
index 637882c49..2cb08f1b0 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -165,6 +165,8 @@ alias(
     visibility = ["//visibility:public"],
 )
 
+# Envoy: Patch
+
 cc_binary(
     name = "protoc",
     copts = COPTS,
@@ -173,6 +175,14 @@ cc_binary(
     deps = ["//src/google/protobuf/compiler:protoc_lib"],
 )
 
+alias(
+    name = "protobuf_python_genproto",
+    actual = "//python:well_known_types_py_pb2_genproto",
+    visibility = ["//visibility:public"],
+)
+
+# /Envoy: Patch
+
 cc_binary(
     name = "protoc_static",
     copts = COPTS,
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py
index 88de4cf8a..b3e046997 100755
--- a/python/google/protobuf/__init__.py
+++ b/python/google/protobuf/__init__.py
@@ -31,3 +31,10 @@
 # Copyright 2007 Google Inc. All Rights Reserved.
 
 __version__ = '4.23.1'
+
+
+if __name__ != '__main__':
+    try:
+        __import__('pkg_resources').declare_namespace(__name__)
+    except ImportError:
+        __path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel
index a2171c806..8aec6187f 100644
--- a/src/google/protobuf/compiler/BUILD.bazel
+++ b/src/google/protobuf/compiler/BUILD.bazel
@@ -306,7 +306,7 @@ cc_library(
     srcs = ["retention.cc"],
     hdrs = ["retention.h"],
     include_prefix = "google/protobuf/compiler",
-    visibility = ["//src/google/protobuf:__subpackages__"],
+    visibility = ["//visibility:public"],
     deps = [
         "//src/google/protobuf:protobuf_nowkt",
         "@com_google_absl//absl/types:span",
diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel
index 8f39625c2..2c2c73dcd 100644
--- a/src/google/protobuf/io/BUILD.bazel
+++ b/src/google/protobuf/io/BUILD.bazel
@@ -142,7 +142,7 @@ cc_library(
         "@com_google_absl//absl/log:absl_log",
     ] + select({
         "//build_defs:config_msvc": [],
-        "//conditions:default": ["@zlib//:zlib"],
+        "//conditions:default": ["//external:zlib"],
     }),
 )
 
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
index 869ebf100..fec92e2b1 100644
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -883,7 +883,7 @@ class KeyMapBase : public UntypedMapBase {
         TreeConvert(b);
       }
       ABSL_DCHECK(TableEntryIsTree(b))
-          << (void*)table_[b] << " " << (uintptr_t)table_[b];
+          << reinterpret_cast<void*>(table_[b]) << " " << static_cast<uintptr_t>(table_[b]);
       InsertUniqueInTree(b, node);
       index_of_first_non_null_ = (std::min)(index_of_first_non_null_, b);
     }
diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h
index 70b12b1e7..b8f46db45 100644
--- a/src/google/protobuf/map_field.h
+++ b/src/google/protobuf/map_field.h
@@ -345,7 +345,7 @@ class PROTOBUF_EXPORT MapFieldBase : public MapFieldBaseForParse {
 
  protected:
   // "protected" stops users from deleting a `MapFieldBase *`
-  ~MapFieldBase();
+  virtual ~MapFieldBase();
 
  public:
   // Returns reference to internal repeated field. Data written using
diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 1c6a24945..6186c2ad1 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -1004,7 +1004,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
 #pragma clang diagnostic ignored "-Wshorten-64-to-32"
 // Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20
 // via http://wg21.link/p1120r0.
-#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
+// #pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
 // This error has been generally flaky, but we need to disable it specifically
 // to fix https://github.com/protocolbuffers/protobuf/issues/12313
 #pragma clang diagnostic ignored "-Wunused-parameter"
@@ -1062,6 +1062,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
 #pragma warning(disable: 4125)
 #endif
 
+#pragma GCC diagnostic ignored "-Wundef"
 #if PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII
 #define PROTOBUF_DEBUG true
 #else