-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazel_4: fix CLang 16 Werror-s on darwin
Fixing `bazel_4` after #234710 Error example https://hydra.nixos.org/build/241174862/nixlog/1 ``` Execution platform: //:default_host_platform third_party/zlib/gzwrite.c:89:20: error: call to undeclared function 'write'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] writ = write(state->fd, strm->next_in, put); ^ ``` Similar to #269481 and #269297 (cherry picked from commit 746e394)
- Loading branch information
1 parent
6b83b42
commit adc22af
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
pkgs/development/tools/build-managers/bazel/bazel_4/upb-clang16.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
diff --git a/WORKSPACE b/WORKSPACE | ||
index 2d995f095e..55fddef663 100644 | ||
--- a/WORKSPACE | ||
+++ b/WORKSPACE | ||
@@ -1232,7 +1232,7 @@ register_toolchains("//src/main/res:empty_rc_toolchain") | ||
http_archive( | ||
name = "com_github_grpc_grpc", | ||
patch_args = ["-p1"], | ||
- patches = ["//third_party/grpc:grpc_1.33.1.patch"], | ||
+ patches = ["//third_party/grpc:grpc_1.33.1.patch", "//:grpc-upb-clang16.patch"], | ||
sha256 = "58eaee5c0f1bd0b92ebe1fa0606ec8f14798500620e7444726afcaf65041cb63", | ||
strip_prefix = "grpc-1.33.1", | ||
urls = [ | ||
diff --git a/grpc-upb-clang16.patch b/grpc-upb-clang16.patch | ||
new file mode 100644 | ||
index 0000000000..ae6a7ad0e0 | ||
--- /dev/null | ||
+++ b/grpc-upb-clang16.patch | ||
@@ -0,0 +1,13 @@ | ||
+diff -r -u a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl | ||
+--- a/bazel/grpc_deps.bzl | ||
++++ b/bazel/grpc_deps.bzl | ||
+@@ -285,6 +285,8 @@ | ||
+ name = "upb", | ||
+ sha256 = "7992217989f3156f8109931c1fc6db3434b7414957cb82371552377beaeb9d6c", | ||
+ strip_prefix = "upb-382d5afc60e05470c23e8de19b19fc5ad231e732", | ||
++ patches = ["//:upb-clang16.patch"], | ||
++ patch_args = ["-p1"], | ||
+ urls = [ | ||
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/382d5afc60e05470c23e8de19b19fc5ad231e732.tar.gz", | ||
+ "https://github.com/protocolbuffers/upb/archive/382d5afc60e05470c23e8de19b19fc5ad231e732.tar.gz", | ||
+ | ||
diff --git a/upb-clang16.patch b/upb-clang16.patch | ||
new file mode 100644 | ||
index 0000000000..b799737fac | ||
--- /dev/null | ||
+++ b/upb-clang16.patch | ||
@@ -0,0 +1,18 @@ | ||
+--- a/BUILD | ||
++++ b/BUILD | ||
+@@ -34,6 +34,7 @@ | ||
+ "-Wextra", | ||
+ # "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang) | ||
+ "-Werror", | ||
++ "-Wno-gnu-offsetof-extensions", | ||
+ "-Wno-long-long", | ||
+ # copybara:strip_end | ||
+ ] | ||
+@@ -42,6 +43,7 @@ | ||
+ # copybara:strip_for_google3_begin | ||
+ "-pedantic", | ||
+ "-Werror=pedantic", | ||
++ "-Wno-gnu-offsetof-extensions", | ||
+ "-Wstrict-prototypes", | ||
+ # copybara:strip_end | ||
+ ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters