Skip to content
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

build error in latest sonic mainline #4404

Closed
BaluAlluru opened this issue Apr 9, 2020 · 9 comments · Fixed by #4502
Closed

build error in latest sonic mainline #4404

BaluAlluru opened this issue Apr 9, 2020 · 9 comments · Fixed by #4502
Assignees
Labels

Comments

@BaluAlluru
Copy link

Description

Steps to reproduce the issue:

  1. make target/sonic-broadcom.bin is resulting in build error

Describe the results you received:
port.c: In function 'local_if_add_vlan':
port.c:527:5: warning: implicit declaration of function 'update_if_ipmac_on_standby' [-Wimplicit-function-declaration]
update_if_ipmac_on_standby(local_if);
^~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o scheduler.o scheduler.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o system.o system.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o iccp_consistency_check.o iccp_consistency_check.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o mlacp_link_handler.o mlacp_link_handler.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o mlacp_sync_prepare.o mlacp_sync_prepare.c
mlacp_sync_prepare.c: In function 'mlacp_prepare_for_arp_info':
mlacp_sync_prepare.c:373:13: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
ArpData = (struct mLACPMACData *)&buf[sizeof(ICCHdr) + sizeof(struct mLACPARPInfoTLV) + sizeof(struct ARPMsg) * count];
^
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o mlacp_sync_update.o mlacp_sync_update.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o mlacp_fsm.o mlacp_fsm.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I../include/ -I/usr/include/libnl3 -c -o iccp_netlink.o iccp_netlink.c
gcc -o ../iccpd app_csm.o cmd_option.o iccp_cli.o iccp_cmd_show.o iccp_cmd.o iccp_csm.o iccp_ifm.o iccp_main.o logger.o port.o scheduler.o system.o iccp_consistency_check.o mlacp_link_handler.o mlacp_sync_prepare.o mlacp_sync_update.o mlacp_fsm.o iccp_netlink.o -lnl-cli-3 -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3 -lpthread
make[3]: Leaving directory '/sonic/src/iccpd/src'
make -C src/mclagdctl
make[3]: Entering directory '/sonic/src/iccpd/src/mclagdctl'
cc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o mclagdctl.o mclagdctl.c
mclagdctl.c: In function 'mclagdctl_sock_connect':
mclagdctl.c:142:9: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]
close(mclagdctl_sock_fd);
^~~~~
mclagdctl.c: In function 'mclagdctl_sock_write':
mclagdctl.c:168:15: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
ret = write(fd, w_buf + write_len, total_len - write_len);
^~~~~
mclagdctl.c: In function 'mclagdctl_sock_read':
mclagdctl.c:207:15: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
ret = read(fd, r_buf + read_len, total_len - read_len);
^~~~
mclagdctl.c: In function 'main':
mclagdctl.c:723:21: warning: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
switch (tolower(optarg[0]))
^~~~~~~
cc -o ./mclagdctl mclagdctl.o
make[3]: Leaving directory '/sonic/src/iccpd/src/mclagdctl'
make[2]: Leaving directory '/sonic/src/iccpd'
dpkg-deb: warning: parsing file 'debian/DEBIAN/control' near line 12 package 'iccpd-0.0.5-amd64':
missing description
dpkg-deb: error: control directory has bad permissions 770 (must be >=0755 and <=0775)
Makefile:17: recipe for target '/sonic/target/debs/stretch/iccpd_0.0.5_amd64.deb' failed
make[1]: *** [/sonic/target/debs/stretch/iccpd_0.0.5_amd64.deb] Error 2
make[1]: Leaving directory '/sonic/src/iccpd'

Describe the results you expected:
build successful

Additional information you deem important (e.g. issue happens only occasionally):

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```
@ciju-juniper
Copy link
Contributor

ciju-juniper commented Apr 9, 2020

@lguohan @shine4chen The build failure reason is this:

dpkg-deb: error: control directory has bad permissions 770 (must be >=0755 and <=0775)

ciju@vlinux-5:~/sonic/commit/apr_14/sonic-buildimage/src/iccpd/debian$ ls -ld DEBIAN
drwxrwx--- 2 ciju ciju 4096 Apr 8 00:24 DEBIAN

If the permission is set to '0755' for DEBIAN directory, build will proceed.

ciju@vlinux-5:~/sonic/commit/apr_14/sonic-buildimage/src/iccpd/debian$ ls -ld DEBIAN
drwxr-xr-x 2 ciju ciju 4096 Apr 8 00:24 DEBIAN

Another workaround is to disable ICCPD docker in rules/config
ENABLE_ICCPD = n

@shine4chen Could you fix this issue?

@jianjundong
Copy link
Contributor

@lguohan @shine4chen @BaluAlluru
I just downloaded a code from GitHub on April 8, the permissions of control directory is 0755.

jianjun@nps65:/home/jianjun/git_master/sonic-buildimage/src/iccpd/debian$ ls -ld
drwxr-xr-x 3 jianjun jianjun 4096 Apr 7 23:34 .
jianjun@nps65:/home/jianjun/git_master/sonic-buildimage/src/iccpd/debian$ cd DEBIAN/
jianjun@nps65:/home/jianjun/git_master/sonic-buildimage/src/iccpd/debian/DEBIAN$ ls -ld
drwxr-xr-x 2 jianjun jianjun 4096 Apr 7 23:34 .

Is it related to the local compilation environment? Please check.

@ciju-juniper
Copy link
Contributor

@jianjundong It's not fixed. Just checked again in the mainline code.

commit 7405f8c

ciju@vlinux-5:/tmp/sonic-buildimage/src/iccpd/debian$ ls -ld DEBIAN/
drwxrwx--- 2 ciju ciju 4096 Apr 9 12:52 DEBIAN/

@jianjundong
Copy link
Contributor

@ciju-juniper

This directory does not have permission control on GitHub. It should be related to your local compilation environment.

@lguohan
Copy link
Collaborator

lguohan commented Apr 9, 2020

@jianjundong , looks like you have even bigger problem here. it is not properly debianized.

check example here. https://github.com/Azure/sonic-swss-common/tree/master/debian

https://www.debian.org/doc/manuals/maint-guide/dreq.en.html

@ciju-juniper
Copy link
Contributor

@jianjundong What do you mean by compilation environment? No one sets up SONiC compilation environment as it's created automatically. As @lguohan said, you need to organize the files properly. Look at the examples of other debian projects sourced to SONiC.

Make sure that you build all the targets from scratch and all are successfully built.

@tylerlinp
Copy link
Contributor

tylerlinp commented Apr 10, 2020

@ciju-juniper The directory is not tracked by GIT, it gets OS default access permission when created. Maybe your user account umask is not 0022 but 0007. I think it is not a good thing to chmod it when compiling.

@jianjundong
Copy link
Contributor

We will raise a PR to change ENABLE_ICCPD = n at first, and will change the debianize progress follow the example later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants