Skip to content

Commit

Permalink
Fix upb build with Clang 16
Browse files Browse the repository at this point in the history
With Xcode 16, `upb` fails its own `-Werror` check due to using Clang extensions.

Closes bazelbuild#23667.

PiperOrigin-RevId: 676957876
Change-Id: I8e038b5f879077fefdb5811aff6ae5f56fb4f762
  • Loading branch information
fmeum authored and copybara-github committed Sep 20, 2024
1 parent f10f307 commit 13bf847
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ single_version_override(
patch_strip = 1,
patches = [
"//third_party/upb:00_remove_toolchain_transition.patch",
"//third_party/upb:01_remove_werror.patch",
],
)

Expand Down
19 changes: 19 additions & 0 deletions third_party/upb/01_remove_werror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl
--- a/bazel/build_defs.bzl
+++ b/bazel/build_defs.bzl
@@ -34,13 +34,13 @@
_DEFAULT_CPPOPTS.extend([
"-Wextra",
# "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang)
- "-Werror",
+ # "-Werror",
"-Wno-long-long",
])
_DEFAULT_COPTS.extend([
"-std=c99",
"-pedantic",
- "-Werror=pedantic",
+ # "-Werror=pedantic",
"-Wall",
"-Wstrict-prototypes",
# GCC (at least) emits spurious warnings for this that cannot be fixed
1 change: 1 addition & 0 deletions third_party/upb/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ filegroup(

exports_files([
"00_remove_toolchain_transition.patch",
"01_remove_werror.patch",
])

0 comments on commit 13bf847

Please sign in to comment.