Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around build errors on MacOS 13.3 and XCode 14.3
After upgrading MacOS to 13.3.1 and XCode to 14.3 the gerrit build fails with the following errors apparently caused by zlib: $ bazelisk build release ... external/remote_java_tools/java_tools/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); ^ external/remote_java_tools/java_tools/zlib/gzwrite.c:89:20: note: did you mean 'fwrite'? /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/stdio.h:165:9: note: 'fwrite' declared here size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite); ^ external/remote_java_tools/java_tools/zlib/gzwrite.c:110:24: error: call to undeclared function 'write'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] writ = write(state->fd, state->x.next, put); ^ external/remote_java_tools/java_tools/zlib/gzwrite.c:661:9: error: call to undeclared function 'close'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (close(state->fd) == -1) ^ To fix this follow the advise in [1] and set C standard to C90 globally. Setting this only for zlib sources as recommended in [1] seems not to work for the bazel version we are using. [1] bazelbuild/bazel#17956 Release-Notes: skip Change-Id: If1821b7bd3ec18e8c76c6d604018e11794c256ea (cherry picked from commit bda7eac)
- Loading branch information