chore: upgrade zlib to 1.3.1#17029
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@HerrCai0907 Thank you for the pull request, but we need to have you agree to the CLA before we can review it. |
|
Sorry, I missed that the CLA check is passing now. |
|
@acozzette I found upb failed due to
But it looks like unrelated with my change. |
|
@HerrCai0907 Sorry for the trouble. These tests are passing on main but I think were broken a few days ago. Would you mind rebasing your branch and pushing it again? That should fix the problem. |
protobuf v27.2 uses Zlib 1.2.11, which produces the error below when building on macOS with Xcode 16.4 and Clang 17. See: - madler/zlib#895 - llvm/llvm-project#74676 protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the issue. ```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... ] ```
protobuf v27.2 uses Zlib 1.2.11, which produces the error below when building on macOS with Xcode 16.4 and Clang 17. See: - madler/zlib#895 - llvm/llvm-project#74676 protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the issue. ```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... ] ```
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details. Everything builds and all tests pass using both Bazel 6.5.0 and 7.6.2 in legacy `WORKSPACE` mode.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details. Everything builds and all tests pass using both Bazel 6.5.0 and 7.6.2 in legacy `WORKSPACE` mode.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details. Everything builds and all tests pass using both Bazel 6.5.0 and 7.7.0 in legacy `WORKSPACE` mode.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details. Everything builds and all tests pass using both Bazel 6.5.0 and 7.7.0 in legacy `WORKSPACE` mode.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details.
protobuf v28.0 uses Zlib 1.3.1 via protocolbuffers/protobuf#17029, which resolves the macOS `OS_CODE` issue. See the "Bump to rules_proto 6.0.2, protobuf v21.7" commit message for details. Everything builds and all tests pass using both Bazel 6.5.0 and 7.7.0 in legacy `WORKSPACE` mode.
zlibcannot be complied in macos (madler/zlib#895).This PR wants to upgrade zlib to 1.3.1 to avoid this issue.