01-14-2021 07:06 AM - edited 01-14-2021 08:11 AM
third_party/cares/cares/ares_init.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-invalid-source-encoding’ [-Werror]
cc1: all warnings being treated as errors
This happens on:
NAME="Red Hat Enterprise Linux" VERSION="8.2 (Ootpa)" ID="rhel" ID_LIKE="fedora" VERSION_ID="8.2" PLATFORM_ID="platform:el8" PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:8.2:GA" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.2 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.2" Red Hat Enterprise Linux release 8.2 (Ootpa) Red Hat Enterprise Linux release 8.2 (Ootpa)
Sources from v0.8.5. People says gRPC v1.22.0 should solve this issue (https://github.com/grpc/grpc/issues/18064)
Solved! Go to Solution.
01-15-2021 12:33 AM
I did few more tries. gRPC v1.22.0 didn't work. With v1.34.0 warnings are gone but I ended up into other issues. My problem is on your fork but then I experienced the same with the official repo. I'm installing YDK on UBI8 v8.2 which is Red Hat for docker containers. In the end solution was to simply run:
export CFLAGS=-Wno-error
export CXXFLAGS=-Wno-error
before install_ydk.sh.
01-14-2021 07:25 AM
Removing that option causes more issues:
third_party/cares/cares/ares_init.c: In function ‘ares_dup’:
third_party/cares/cares/ares_init.c:301:17: error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
sizeof(src->local_dev_name));
Same applies to the memcpy few lines below. Fixing those, you get:
third_party/cares/cares/ares_parse_ptr_reply.c: In function ‘ares_parse_ptr_reply’: third_party/cares/cares/ares_parse_ptr_reply.c:134:11: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ third_party/cares/cares/ares_parse_ptr_reply.c:134:47: note: length computed here strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
Fixing that you end up into this:
third_party/boringssl/crypto/bio/connect.c: In function ‘conn_callback_ctrl’: third_party/boringssl/crypto/bio/connect.c:491:29: error: cast between incompatible function types from ‘bio_info_cb’ {aka ‘long int (*)(struct bio_st *, int, const char *, int, long int, long int)’} to ‘int (*)(const struct bio_st *, int, int)’ [-Werror=cast-function-type] data->info_callback = (int (*)(const struct bio_st *, int, int))fp;
and eventually I gave up.
01-14-2021 11:43 AM
What is the platform that you are trying to install YDK? Is it supported one?
If you cloned ydk-gen from my fork master branch, in the directory ydk-gen/3d_party/grpc/ you can find modified Makefile to address the issue, which should be done automatically. You need manually copy this file into $HOME/grpc directory, replacing the original Makefile.
Regarding gRPC upgrade to version 1.22.0. Can you try manually this software and test the gNMI Service Provider to make sure it is working with real device properly. Unfortunately I do not have a sandbox with grpc enabled and therefore cannot test it fully. The testing on the dumb server that is used for unit testing is not sufficient.
01-15-2021 12:33 AM
I did few more tries. gRPC v1.22.0 didn't work. With v1.34.0 warnings are gone but I ended up into other issues. My problem is on your fork but then I experienced the same with the official repo. I'm installing YDK on UBI8 v8.2 which is Red Hat for docker containers. In the end solution was to simply run:
export CFLAGS=-Wno-error
export CXXFLAGS=-Wno-error
before install_ydk.sh.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide