sonic-net / sonic-sairedis

SAI object interface to Redis database, as used in the SONiC project
Other
56 stars 259 forks source link

An error occurred when compiling libsairedis_1.0.0_amd64.deb on the master branch #1376

Closed CaiBIRen closed 3 months ago

CaiBIRen commented 3 months ago

The specific reason for the error is: sai_redis_interfacequery.cpp:97:1: error: missing initializer for member '_sai_apis_t::icmp_echo_api' [-Werror=missing-field-initializers]

The full text is as follows: libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -I../SAI/inc -I../SAI/experimental -I../SAI/meta -ansi -fPIC -pipe -std=c++14 -Wall -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Werror -Wextra -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimport -Winit-self -Wno-inline -Winvalid-pch -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wno-aggregate-return -Wno-padded -Wno-switch-enum -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wstack-protector -Wstrict-aliasing=3 -Wswitch -Wswitch-default -Wunreachable-code -Wunused -Wvariadic-macros -Wwrite-strings -Wno-switch-default -Wconversion -Wno-psabi -Wcast-align=strict -g -O2 -ffile-prefix-map=/sonic/src/sonic-sairedis=. -fstack-protector-strong -Wformat -Werror=format-security -c sai_redis_ipmc_group.cpp -fPIC -DPIC -o .libs/libsairedis_la-sai_redis_ipmc_group.o sai_redis_interfacequery.cpp:97:1: error: missing initializer for member '_sai_apis_t::icmp_echo_api' [-Werror=missing-field-initializers] 97 | }; | ^ cc1plus: all warnings being treated as errors make[4]: [Makefile:1406: libsairedis_la-sai_redis_interfacequery.lo] Error 1 make[4]: Waiting for unfinished jobs.... make[4]: Leaving directory '/sonic/src/sonic-sairedis/lib' make[3]: [Makefile:460: all-recursive] Error 1 make[3]: Leaving directory '/sonic/src/sonic-sairedis' make[2]: [Makefile:392: all] Error 2 make[2]: Leaving directory '/sonic/src/sonic-sairedis' dh_auto_build: error: make -j4 returned exit code 2 make[1]: [debian/rules:49: build] Error 25 make[1]: Leaving directory '/sonic/src/sonic-sairedis' dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ FAIL LOG END ] [ target/debs/bullseye/libsairedis_1.0.0_amd64.deb ] make: [slave.mk:773: target/debs/bullseye/libsairedis_1.0.0_amd64.deb] Error 1 make[1]: [Makefile.work:627: bullseye] Error 2 make[1]: Leaving directory '/home/irving/SONIC/sonic-buildimage' make: [Makefile:46: target/sonic-vs.img.gz] Error 2

My gcc version is 9.4.0,Do you have no problem compiling using the master branch now? I don't know what's causing this error every time I compile.

CaiBIRen commented 3 months ago

OS: ubuantu 20.04

kcudnik commented 3 months ago
sai_redis_interfacequery.cpp:97:1: error: missing initializer for member '_sai_apis_t::icmp_echo_api' [-Werror=missing-field-initializers]

did you updated SAI headers ? to include ICMP change ? then this initializer will need to be explicitly populated

kcudnik commented 3 months ago

No it should not depend on vs

kcudnik commented 3 months ago

Latest commit on master was 5 days ago and it passes on GitHub I will check that locally

CaiBIRen commented 3 months ago

Thank you very much for your answer. I cleaned up the local modifications in the local master branch and the compilation passed. It should be my own problem. Thank you again! I will close this issue