Skip to content

@remote_java_tools fail to build on macOS 13.3 with Xcode 14.3 #17956

@fmeum

Description

@fmeum

Description of the bug:

Building @remote_java_tools from source on macOS 13.3 with Xcode 14.3 fails with:

external/remote_java_tools/java_tools/zlib/gzlib.c:254:9: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
        ^
external/remote_java_tools/java_tools/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
external/remote_java_tools/java_tools/zlib/gzlib.c:254:9: note: did you mean 'fseek'?
external/remote_java_tools/java_tools/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/stdio.h:162:6: note: 'fseek' declared here
int      fseek(FILE *, long, int);
         ^
external/remote_java_tools/java_tools/zlib/gzlib.c:260:24: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        state->start = LSEEK(state->fd, 0, SEEK_CUR);
                       ^
external/remote_java_tools/java_tools/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
external/remote_java_tools/java_tools/zlib/gzlib.c:361:9: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
        ^
external/remote_java_tools/java_tools/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
external/remote_java_tools/java_tools/zlib/gzlib.c:402:15: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
              ^
external/remote_java_tools/java_tools/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
external/remote_java_tools/java_tools/zlib/gzlib.c:498:14: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    offset = LSEEK(state->fd, 0, SEEK_CUR);
             ^
external/remote_java_tools/java_tools/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
5 errors generated.

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:

load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "NONPREBUILT_TOOLCHAIN_CONFIGURATION", "default_java_toolchain")
default_java_toolchain(
    name = "java_non_prebuilt",
    configuration = NONPREBUILT_TOOLCHAIN_CONFIGURATION,
)

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

6.1.1

If bazel info release returns development 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).

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)team-OSSIssues for the Bazel OSS team: installation, release processBazel packaging, websitetype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions