Commit dd3719f
committed
Bump to rules_proto 6.0.2, protobuf v21.7
This works with Bazel 7 on Linux and Windows, but fails on macOS with
the error described in detail further below.
It also fails on macOS when using Bazel 6 with:
```txt
ERROR: external/zlib/BUILD.bazel:37:11:
Compiling trees.c [for tool] failed: (Aborted): wrapped_clang failed:
error executing command (from target @zlib//:zlib)
external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1'
-fstack-protector -fcolor-diagnostics -Wall -Wthread-safety
-Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG
'-DNS_BLOCK_ASSERTIONS=1' ... (remaining 34 arguments skipped)
dyld[78138]: missing LC_UUID load command in
external/local_config_cc/wrapped_clang
dyld[78138]: missing LC_UUID load command
```
The Bazel 6 error we can fix with a `rules_cc` update. The Bazel 7 error
we'll fix with a protobuf v28.0 update.
---
protobuf v21.7 uses Zlib 1.2.11, and versions v22.0 up until v28.0 use
Zlib 1.2.13. These Zlib versions cause the error below when building on
macOS with Xcode 16.4 and Clang 17. See:
- madler/zlib#895
- llvm/llvm-project#74676
```txt
$ bazel build //...
Starting local Bazel server and connecting to it...
INFO: Analyzed 2 targets (113 packages loaded, 2278 targets configured).
INFO: From Compiling adler32.c [for tool]:
In file included from external/zlib/adler32.c:8:
external/zlib/zutil.h:170:11: warning: 'OS_CODE' macro redefined [-Wmacro-redefined]
170 | # define OS_CODE 19
| ^
external/zlib/zutil.h:141:11: note: previous definition is here
141 | # define OS_CODE 7
| ^
1 warning generated.
[ ...snip OS_CODE warning from crc32.c:30... ]
ERROR: external/zlib/BUILD.bazel:37:11:
Compiling zutil.c [for tool] failed: (Exit 1): cc_wrapper.sh failed:
error executing CppCompile command (from target @@zlib//:zlib)
external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE
-fstack-protector -Wall -Wthread-safety -Wself-assign
-Wunused-but-set-parameter -Wno-free-nonheap-object
-fcolor-diagnostics ... (remaining 33 arguments skipped)
ERROR: external/zlib/BUILD.bazel:37:11:
Compiling zutil.c [for tool] failed: (Exit 1): wrapped_clang failed:
error executing command (from target @zlib//:zlib)
external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1'
-fstack-protector -fcolor-diagnostics -Wall -Wthread-safety
-Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG
'-DNS_BLOCK_ASSERTIONS=1' ... (remaining 35 arguments skipped)
[ ...snip OS_CODE warning from zutil.c:8... ]
In file included from external/zlib/zutil.c:10:
In file included from external/zlib/gzguts.h:21:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7:
error: expected identifier or '('
318 | FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
| ^
external/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
147 | # define fdopen(fd,mode) NULL /* No fdopen() */
| ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h:26:16:
note: expanded from macro 'NULL'
26 | #define NULL ((void*)0)
| ^
[ ...snip two more error messages pointing into __stddef_null.h:26... ]
1 warning and 3 errors generated.
ERROR: external/com_frobozz_rules_magic/src/com/frobozz/magic/BUILD:3:12
Building external/com_frobozz_rules_magic/src/com/frobozz/magic/EmitDigestsWorker.jar
(1 source file) [for tool] failed: (Exit 1): cc_wrapper.sh failed:
[ ...snip repeated CppCompile command error... ]
```1 parent ac6074e commit dd3719f
3 files changed
+47
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
38 | 51 | | |
39 | 52 | | |
40 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
22 | 32 | | |
23 | 33 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
31 | 44 | | |
32 | 45 | | |
33 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
0 commit comments