From fe2ad6db7e537838abeccb398af69fcee0da07c2 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Thu, 19 Sep 2024 09:52:59 +0200 Subject: [PATCH] Fix upb build with Clang 16 With Xcode 16, `upb` fails its own `-Werror` check due to using Clang extensions. --- MODULE.bazel | 1 + third_party/upb/01_remove_werror.patch | 19 +++++++++++++++++++ third_party/upb/BUILD | 1 + 3 files changed, 21 insertions(+) create mode 100644 third_party/upb/01_remove_werror.patch diff --git a/MODULE.bazel b/MODULE.bazel index 358c2e1aed592c..f39e3a60844c7b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -80,6 +80,7 @@ single_version_override( patch_strip = 1, patches = [ "//third_party/upb:00_remove_toolchain_transition.patch", + "//third_party/upb:01_remove_werror.patch", ], ) diff --git a/third_party/upb/01_remove_werror.patch b/third_party/upb/01_remove_werror.patch new file mode 100644 index 00000000000000..2165b14d07aa35 --- /dev/null +++ b/third_party/upb/01_remove_werror.patch @@ -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 diff --git a/third_party/upb/BUILD b/third_party/upb/BUILD index c6206bd8bc95c0..99afcb6a5a7a7e 100644 --- a/third_party/upb/BUILD +++ b/third_party/upb/BUILD @@ -8,4 +8,5 @@ filegroup( exports_files([ "00_remove_toolchain_transition.patch", + "01_remove_werror.patch", ])