Skip to content

Commit 4a32d7b

Browse files
authored
[7.4.0] Fix upb build with Clang 16 (#23700)
With Xcode 16, `upb` fails its own `-Werror` check due to using Clang extensions. Closes #23667. PiperOrigin-RevId: 676957876 Change-Id: I8e038b5f879077fefdb5811aff6ae5f56fb4f762 Closes #23668
1 parent 8716f50 commit 4a32d7b

4 files changed

Lines changed: 38 additions & 0 deletions

File tree

MODULE.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ bazel_dep(name = "c-ares", version = "1.15.0")
6969
bazel_dep(name = "rules_go", version = "0.39.1")
7070
bazel_dep(name = "rules_kotlin", version = "1.9.0")
7171
bazel_dep(name = "upb", version = "0.0.0-20220923-a547704")
72+
single_version_override(
73+
module_name = "upb",
74+
patch_strip = 1,
75+
patches = [
76+
"//third_party/upb:01_remove_werror.patch",
77+
],
78+
)
7279

7380
# =========================================
7481
# Java dependencies

third_party/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ filegroup(
3535
"//third_party/py/mock:srcs",
3636
"//third_party/py/six:srcs",
3737
"//third_party/remoteapis:srcs",
38+
"//third_party/upb:srcs",
3839
"//third_party/zlib:srcs",
3940
],
4041
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl
2+
--- a/bazel/build_defs.bzl
3+
+++ b/bazel/build_defs.bzl
4+
@@ -34,13 +34,13 @@
5+
_DEFAULT_CPPOPTS.extend([
6+
"-Wextra",
7+
# "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang)
8+
- "-Werror",
9+
+ # "-Werror",
10+
"-Wno-long-long",
11+
])
12+
_DEFAULT_COPTS.extend([
13+
"-std=c99",
14+
"-pedantic",
15+
- "-Werror=pedantic",
16+
+ # "-Werror=pedantic",
17+
"-Wall",
18+
"-Wstrict-prototypes",
19+
# GCC (at least) emits spurious warnings for this that cannot be fixed

third_party/upb/BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
licenses(["notice"])
2+
3+
filegroup(
4+
name = "srcs",
5+
srcs = glob(["**"]), # glob everything to satisfy the compile.sh srcs test
6+
visibility = ["//third_party:__pkg__"],
7+
)
8+
9+
exports_files([
10+
"01_remove_werror.patch",
11+
])

0 commit comments

Comments
 (0)