-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazel_5: fix CLang 16 Werror-s on darwin
Fixing `bazel_5` after #234710 Error example https://hydra.nixos.org/build/241240612/nixlog/1 ``` external/com_google_absl/absl/meta/type_traits.h:560:8: error: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Werror,-Wdeprecated-builtins] (__has_trivial_assign(ExtentsRemoved) || !kIsCopyOrMoveAssignable) && ``` Similar to #269297, and remaining `bazel_4` is WIP for another PR
- Loading branch information
1 parent
1a9dc0c
commit 781538c
Showing
2 changed files
with
87 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
83 changes: 83 additions & 0 deletions
83
pkgs/development/tools/build-managers/bazel/bazel_5/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,83 @@ | ||
diff --git a/distdir_deps.bzl b/distdir_deps.bzl | ||
index 9068f50537..b3f45e8653 100644 | ||
--- a/distdir_deps.bzl | ||
+++ b/distdir_deps.bzl | ||
@@ -110,6 +110,8 @@ DIST_DEPS = { | ||
"protocolbuffers": { | ||
"archive": "2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", | ||
"sha256": "6a5f67874af66b239b709c572ac1a5a00fdb1b29beaf13c3e6f79b1ba10dc7c4", | ||
+ "patches": ["//:upb-clang16.patch"], | ||
+ "patch_args": ["-p1"], | ||
"urls": [ | ||
"https://mirror.bazel.build/github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", | ||
"https://github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", | ||
@@ -131,6 +133,7 @@ DIST_DEPS = { | ||
"patches": [ | ||
"//third_party/grpc:grpc_1.41.0.patch", | ||
"//third_party/grpc:grpc_1.41.0.win_arm64.patch", | ||
+ "//:grpc-upb-clang16.patch", | ||
], | ||
"used_in": [ | ||
"additional_distfiles", | ||
diff --git a/grpc-upb-clang16.patch b/grpc-upb-clang16.patch | ||
new file mode 100644 | ||
index 0000000000..69194099db | ||
--- /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 | ||
+@@ -340,6 +340,8 @@ | ||
+ name = "upb", | ||
+ sha256 = "6a5f67874af66b239b709c572ac1a5a00fdb1b29beaf13c3e6f79b1ba10dc7c4", | ||
+ strip_prefix = "upb-2de300726a1ba2de9a468468dc5ff9ed17a3215f", | ||
++ patches = ["//:upb-clang16.patch"], | ||
++ patch_args = ["-p1"], | ||
+ urls = [ | ||
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", | ||
+ "https://github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", | ||
+ | ||
+diff -r -u a/third_party/upb/bazel/build_defs.bzl b/third_party/upb/bazel/build_defs.bzl | ||
+--- a/third_party/upb/bazel/build_defs.bzl 2021-09-25 04:33:41.000000000 +0200 | ||
++++ b/third_party/upb/bazel/build_defs.bzl 2023-11-22 22:27:39.421459688 +0100 | ||
+@@ -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 | ||
+ ], | ||
+@@ -48,6 +49,7 @@ | ||
+ "-pedantic", | ||
+ "-Werror=pedantic", | ||
+ "-Wall", | ||
++ "-Wno-gnu-offsetof-extensions", | ||
+ "-Wstrict-prototypes", | ||
+ # GCC (at least) emits spurious warnings for this that cannot be fixed | ||
+ # without introducing redundant initialization (with runtime cost): | ||
diff --git a/upb-clang16.patch b/upb-clang16.patch | ||
new file mode 100644 | ||
index 0000000000..f81855181f | ||
--- /dev/null | ||
+++ upb-clang16.patch | ||
@@ -0,0 +1,18 @@ | ||
+--- a/bazel/build_defs.bzl | ||
++++ b/bazel/build_defs.bzl | ||
+@@ -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 | ||
+ ], | ||
+@@ -48,6 +49,7 @@ | ||
+ "-pedantic", | ||
+ "-Werror=pedantic", | ||
+ "-Wall", | ||
++ "-Wno-gnu-offsetof-extensions", | ||
+ "-Wstrict-prototypes", | ||
+ # GCC (at least) emits spurious warnings for this that cannot be fixed | ||
+ # without introducing redundant initialization (with runtime cost): |