agi icon indicating copy to clipboard operation
agi copied to clipboard

zlib missing c function prototypes

Open rosasco-wk opened this issue 2 years ago • 7 comments

SUMMARY With fuchsia_clang, I'm getting build errors like this for libgapii target:

Use --sandbox_debug to see verbose messages from the sandbox external/net_zlib/inflate.c:105:11: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] local int inflateStateCheck(strm)

Per the commit hash, our zlib is from 2017 per: https://github.com/google/agi/blob/b12d38469611cd97380cae458c4fc3a64e0e0dcc/tools/build/workspace.bzl#L74

commit cacf7f1d4e3d44d871b605da3b647f07d718623f (tag: v1.2.11) Author: Mark Adler [email protected] Date: Sun Jan 15 09:18:46 2017 -0800

zlib 1.2.11

Updating zlib may be the remedy.

REPRO Using source from: https://github.com/rosasco-wk/agi.git branch: agis_handshake

CC=/usr/bin/gcc-8 bazel build --subcommands --config fuchsia_arm64 //gapii/fuchsia:gapii

rosasco-wk avatar Sep 03 '22 00:09 rosasco-wk

Hi,

Are you able to use GCC-9 instead?

We are currently in the process of updating many dependencies and zlib is one of them. In the meanwhile, you may try to use GCC-9 which is used by our CI.

yalcinmelihyasin avatar Sep 06 '22 14:09 yalcinmelihyasin

Thanks, yeah, I can use GCC-9. I do get the same compilation errors though e.g.:

external/net_zlib/infback.c:28:13: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)

On Tue, Sep 6, 2022 at 7:52 AM Melih Y. Yalcin @.***> wrote:

Hi,

Are you able to use GCC-9 instead?

We are currently in the process of updating many dependencies and zlib is one of them. In the meanwhile, you may try to use GCC-9 which is used by our CI.

— Reply to this email directly, view it on GitHub https://github.com/google/agi/issues/1205#issuecomment-1238263425, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYYDOPHXG5EBHEC476ZSDDV45LDHANCNFSM6AAAAAAQDVKFWA . You are receiving this because you authored the thread.Message ID: @.***>

rosasco-wk avatar Sep 07 '22 16:09 rosasco-wk

Please note that, although I've changed the command prefix to use GCC-9, fuchsia_clang is still being used for the Fuchsia target I'm building by necessity. Command for the error above is:

CC=/usr/bin/gcc-9 bazel build --subcommands --config fuchsia_arm64 //gapii/fuchsia:gapii

On Wed, Sep 7, 2022 at 9:32 AM John Rosasco @.***> wrote:

Thanks, yeah, I can use GCC-9. I do get the same compilation errors though e.g.:

external/net_zlib/infback.c:28:13: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)

On Tue, Sep 6, 2022 at 7:52 AM Melih Y. Yalcin @.***> wrote:

Hi,

Are you able to use GCC-9 instead?

We are currently in the process of updating many dependencies and zlib is one of them. In the meanwhile, you may try to use GCC-9 which is used by our CI.

— Reply to this email directly, view it on GitHub https://github.com/google/agi/issues/1205#issuecomment-1238263425, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYYDOPHXG5EBHEC476ZSDDV45LDHANCNFSM6AAAAAAQDVKFWA . You are receiving this because you authored the thread.Message ID: @.***>

rosasco-wk avatar Sep 07 '22 16:09 rosasco-wk

The missing prototypes are still in zlib ala https://github.com/madler/zlib/issues/702.

rosasco-wk avatar Sep 07 '22 18:09 rosasco-wk

Hi, we've made a major update to most of our dependencies, can you please confirm if this issue still affects you with the latest version?

kocdemir avatar Sep 27 '22 14:09 kocdemir

Yes, this is still evident. Updated build command per AGI changes: CC=clang-12 bazel build --toolchain_resolution_debug=@bazel_tools//tools/cpp:toolchain_type --subcommands --config fuchsia_arm64 //gapii/fuchsia:gapii

This error can be circumvented by suppressing this warning in .bazelrc.

rosasco-wk avatar Sep 27 '22 18:09 rosasco-wk

My branch is based off of:

Author: kocdemir @.***> Date: Fri Sep 16 00:05:07 2022 +0100

handle missing energy tracks case (#1216)

Without adding:

build:fuchsia_arm64 --copt="-Wno-deprecated-non-prototype" build:fuchsia_arm64 --copt="-Wno-unused-function"

to .bazelrc, I am still getting build errors in my branch.

Examples (amongst dozens, possibly hundreds of instances):

external/com_google_protobuf/src/google/protobuf/generated_message_tctable_lite.cc:347:14: error: unused function 'Offset' [-Werror,-Wunused-function] inline void* Offset(void* base, uint32_t offset)

external/net_zlib/adler32.c:63:15: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] u

These failures are due to fuchsia_clang being a more modern version of clang that is more rigorous about enforcing coding standards paired with older software (e.g. zlib) that no longer complies with modern coding standards.

On Tue, Sep 27, 2022 at 7:12 AM kocdemir @.***> wrote:

Hi, we've made a major update to most of our dependencies, can you please confirm if this issue still affects you with the latest version?

— Reply to this email directly, view it on GitHub https://github.com/google/agi/issues/1205#issuecomment-1259569960, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYYDOKQIVCQMULO6JVLCE3WAL6EDANCNFSM6AAAAAAQDVKFWA . You are receiving this because you authored the thread.Message ID: @.***>

rosasco-wk avatar Sep 28 '22 20:09 rosasco-wk