-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@remote_java_tools
fail to build on macOS 13.3 with Xcode 14.3
#17956
Comments
@hvadehra Would applying a patch such as Blosc/c-blosc@ac72c2c to |
I just encountered this issue as well. Is it possible to use an externally installed copy of zlib instead of relying on |
Confirmed that the above patch does indeed solve the issue. Still have the above question about using externally installed dependencies though. |
for anyone else who lands here, fixes are either adding the blanket edit: changed regex to work with bzlmod as well |
@fmeum Does this also break building Bazel with the latest Xcode toolchain? (I'll also try to test it) |
@meteorcloudy I am only relaying this information from our devs on Macs, I don't have the setup to test this myself right now. I would think so though. |
Yes, it broke bazel build as well.
@hvadehra I'll fix zlib in the Bazel repo first, then will hand it over to you to have a new java tools release. |
@meteorcloudy If there will be a 5.4.1 release, maybe the fix for this should be included in that release as well? |
I got this building
|
@fmeum Oh, that makes sense, how confident are we that Blosc/c-blosc@ac72c2c is the correct fix, it's weird I don't see any upstream issue or PR mentioning this problem. @brentleyjones Yes, looks like the same error. |
@kshyanashree @keertk We should also cherry pick the fix for this issue into 5.4.1,, and 6.2.0 |
@bazel-io fork 5.4.1 |
@bazel-io fork 6.2.0 |
|
Fixes #17956 Partial commit for third_party/*, see #17987. Closes #17987 Signed-off-by: Yun Peng <[email protected]> Co-authored-by: Yun Peng <[email protected]>
Is version
And I still get
|
For fixing |
@hvadehra After having the new release, do we need to upgrade the java_tools version embedded in Bazel? |
Fixes #17956 Partial commit for third_party/*, see #17987. Closes #17987 Signed-off-by: Yun Peng <[email protected]> Co-authored-by: Yun Peng <[email protected]>
I think only for the non-prebuilt java toolchain case. |
@hvadehra I see, can you follow up with a fix and some cherry picks? |
I'm thinking we make a new java_tools release at HEAD and cherry-pick embedding that into 6.2. If waiting for 6.2 is not possible, one can override the java_tools version in WORKSPACE. @meteorcloudy WDYT? |
I guess that should be fine? Can you give some instruction here on how to do that? Given the limited impact and the existing workaround with |
The instructions are published with every java_tools release, eg: https://github.com/bazelbuild/java_tools/releases/tag/java_v12.0 @keertk @kshyanashree Would it be possible for you to make a regular release for java_tools? I'm going to be OOO soon and might not be able to finish the process. |
Sure, we can do the release. Tracked here: bazelbuild/java_tools#69 |
Thanks! Much appreciated!! |
java_tools v12.1 + instructions: https://github.com/bazelbuild/java_tools/releases/tag/java_v12.1 |
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
After upgrading MacOS to 13.3.1 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 - revert "Work around build errors on MacOS 13.3 and XCode 14.3" - and follow the advise in [1]: - update bazel to 6.1.2 - update remote_java_tools to 12.1 https://github.com/bazelbuild/java_tools/releases/tag/java_v12.1 Set new errorprone bug patterns to WARN until we fixed occurrences. Also demote the severity for these bug patterns to warning: o LiteProtoToString o MutableConstantField o ProvidesMethodOutsideOfModule Also suppress warnings for the following bug patterns: DoNotCall, MathAbsoluteNegative and Unused using @SuppressWarnings annotation. Also note that PreferredInterfaceType bug pattern is reported, but can only be demoted to warning severity using the MutableConstantField bug pattern, see also [2]. [1] bazelbuild/bazel#17956 [2] google/error-prone#3872 Release-Notes: Update bazel to 6.2.1 and remote_java_tools to 12.1 to fix build on MacOS 13.3 Change-Id: Ib9d8d8be44a58c470f712d297c39518498c43dc2
Fixes bazelbuild#17956 Partial commit for third_party/*, see bazelbuild#17987. Closes bazelbuild#17987 Signed-off-by: Yun Peng <[email protected]>
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)
Description of the bug:
Building
@remote_java_tools
from source on macOS 13.3 with Xcode 14.3 fails with:What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Try to build a Java target on macOS 13.3 with Xcode 14.3 using a non-prebuilt Java toolchain such as:
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?6.1.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
This does appear to be an unfixed portability issue in zlib.
Other repos apply patches to resolve this: Blosc/c-blosc@ac72c2c
Any other information, logs, or outputs that you want to share?
This can be worked around with
--host_conlyopt=-std=c90
(see #17956 (comment) for less intrusive workarounds).The text was updated successfully, but these errors were encountered: