<div dir="ltr">That did it, thanks.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 1, 2016 at 3:40 AM Andrew Vagin <<a href="mailto:avagin@virtuozzo.com">avagin@virtuozzo.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Jul 01, 2016 at 12:15:49AM +0000, Ross Boucher wrote:<br>
> If I checkout your branch locally and try to build (e.g. make -C scripts/travis<br>
> alpine or make -C scripts/build alpine), I end up with a ton of errors. Am I<br>
> missing a step somewhere?<br>
<br>
It's strange. It works in travis:<br>
<a href="https://travis-ci.org/avagin/criu/jobs/141267097" rel="noreferrer" target="_blank">https://travis-ci.org/avagin/criu/jobs/141267097</a><br>
<br>
Did you checkout the alpine branch? You can try to execute<br>
"git clean -dxf" before make -C scripts/build alpine.<br>
<br>
Thanks,<br>
Andrew<br>
<br>
><br>
> On Wed, Jun 29, 2016 at 8:36 PM Andrew Vagin <<a href="mailto:avagin@virtuozzo.com" target="_blank">avagin@virtuozzo.com</a>> wrote:<br>
><br>
><br>
> Here is my five cents <a href="https://github.com/avagin/criu/commits/alpine" rel="noreferrer" target="_blank">https://github.com/avagin/criu/commits/alpine</a><br>
><br>
> <a href="https://travis-ci.org/avagin/criu/jobs/141226345" rel="noreferrer" target="_blank">https://travis-ci.org/avagin/criu/jobs/141226345</a><br>
><br>
> On Tue, Jun 28, 2016 at 03:10:32PM +0200, Adrian Reber wrote:<br>
> > From: Adrian Reber <<a href="mailto:areber@redhat.com" target="_blank">areber@redhat.com</a>><br>
> ><br>
> > It seems that the different libc (musl) which Alpine Linux uses produces<br>
> > different errors than the usual glibc. This patch fixes most include<br>
> > errors. Two errors are not yet resolved on Alpine Linux's libc (musl):<br>
> ><br>
> > * proc_parse.c: In function 'parse_posix_timers':<br>
> > proc_parse.c:2125:34: error: 'SIGEV_THREAD_ID' undeclared (first use<br>
> in this function)<br>
> > timer->spt.it_sigev_notify = SIGEV_THREAD_ID;<br>
> ><br>
> > proc_parse.c:2125:34: note: each undeclared identifier is reported<br>
> only once for each function it appears in<br>
> ><br>
> > Seems difficult to fix as including <linux/signal.h>, which provides<br>
> > this #define, generates more different error messages related to<br>
> > time.h and linux/time.h collisions. It is not yet clear if additional<br>
> > guards would help in the header files.<br>
> ><br>
> > * fsnotify.c: In function 'open_by_handle':<br>
> > fsnotify.c:107:9: error: implicit declaration of function<br>
> 'open_by_handle_at' [-Werror=implicit-function-declaration]<br>
> > return open_by_handle_at(fd, arg, O_PATH);<br>
> ><br>
> > The function open_by_handle_at() is not provided by Alpine Linux's<br>
> > libc (musl).<br>
> ><br>
> > This patch resolves the following errors/warnings and has been tested on<br>
> > RHEL7(x86_64/powerpc64le) and Fedora 24:<br>
> ><br>
> > cr-service.c: In function 'cr_service':<br>
> > cr-service.c:1082:26: error: passing argument 2 of 'accept' from<br>
> incompatible pointer type [-Werror=incompatible-pointer-types]<br>
> > sk = accept(server_fd, &client_addr, &client_addr_len);<br>
> > ^<br>
> > In file included from /usr/include/fortify/sys/socket.h:20:0,<br>
> > from cr-service.c:11:<br>
> > /usr/include/sys/socket.h:301:5: note: expected 'struct sockaddr *<br>
> restrict' but argument is of type 'struct sockaddr_un *'<br>
> > int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);<br>
> > ^<br>
> > cc1: all warnings being treated as errors<br>
> ><br>
> > files.c: In function 'open_transport_fd':<br>
> > files.c:845:19: error: passing argument 2 of 'bind' from incompatible<br>
> pointer type [-Werror=incompatible-pointer-types]<br>
> > ret = bind(sock, &saddr, sun_len);<br>
> > ^<br>
> > In file included from /usr/include/fortify/sys/socket.h:20:0,<br>
> > from files.c:12:<br>
> > /usr/include/sys/socket.h:298:5: note: expected 'const struct sockaddr *'<br>
> but argument is of type 'struct sockaddr_un *'<br>
> > int bind (int, const struct sockaddr *, socklen_t);<br>
> > ^<br>
> > cc1: all warnings being treated as errors<br>
> ><br>
> > In file included from fsnotify.c:18:0:<br>
> > /usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #<br>
> include <sys/poll.h> to <poll.h> [-Werror=cpp]<br>
> > #warning redirecting incorrect #include <sys/poll.h> to <poll.h><br>
> > ^<br>
> > cc1: all warnings being treated as errors<br>
> ><br>
> > In file included from /root/criu/criu/include/timerfd.h:7:0,<br>
> > from /root/criu/criu/include/restorer.h:18,<br>
> > from arch/x86/crtools.c:16:<br>
> > /root/criu/criu/include/files.h:43:14: error: field 'stat' has incomplete<br>
> type<br>
> > struct stat stat;<br>
> ><br>
> > In file included from arch/x86/vdso-pie.c:6:0:<br>
> > /root/criu/criu/include/syscall.h:22:66: error: unknown type name<br>
> 'loff_t'<br>
> > extern long sys_pread (unsigned int fd, char *buf, size_t count, loff_t<br>
> pos) ;<br>
> > ^<br>
> > /root/criu/criu/include/syscall.h:83:31: error: unknown type name<br>
> 'clockid_t'<br>
> > extern long sys_timer_create (clockid_t which_clock, struct sigevent<br>
> *timer_event_spec, kernel_timer_t *created_timer_id<br>
> > ^<br>
> > /root/criu/criu/include/syscall.h:88:38: error: unknown type name<br>
> 'clockid_t'<br>
> > extern long sys_clock_gettime (const clockid_t which_clock, const struct<br>
> timespec *tp) ;<br>
> > ^<br>
> ><br>
> > In file included from netfilter.c:5:0:<br>
> > /usr/include/wait.h:1:2: error: #warning redirecting incorrect #include<br>
> <wait.h> to <sys/wait.h> [-Werror=cpp]<br>
> > #warning redirecting incorrect #include <wait.h> to <sys/wait.h><br>
> > ^<br>
> > cc1: all warnings being treated as errors<br>
> ><br>
> > pie/restorer.c: In function '__export_restore_task':<br>
> > pie/restorer.c:1276:23: error: 'LOCK_EX' undeclared (first use in this<br>
> function)<br>
> > ret = sys_flock(fd, LOCK_EX);<br>
> > ^<br>
> > pie/restorer.c:1276:23: note: each undeclared identifier is reported only<br>
> once for each function it appears in<br>
> > pie/restorer.c:1310:23: error: 'LOCK_UN' undeclared (first use in this<br>
> function)<br>
> > ret = sys_flock(fd, LOCK_UN);<br>
> > ^<br>
> ><br>
> > sk-unix.c: In function 'open_unixsk_standalone':<br>
> > sk-unix.c:1169:19: error: passing argument 2 of 'connect' from<br>
> incompatible pointer type [-Werror=incompatible-pointer-types]<br>
> > if (connect(sk, &addr, sizeof(addr.sun_family))) {<br>
> > ^<br>
> > In file included from /usr/include/fortify/sys/socket.h:20:0,<br>
> > from sk-unix.c:1:<br>
> > /usr/include/sys/socket.h:299:5: note: expected 'const struct sockaddr *'<br>
> but argument is of type 'struct sockaddr_un *'<br>
> > int connect (int, const struct sockaddr *, socklen_t);<br>
> > ^<br>
> > cc1: all warnings being treated as errors<br>
> ><br>
> > c/criu.c: In function 'criu_local_set_parent_images':<br>
> > c/criu.c:169:26: error: implicit declaration of function 'strdup'<br>
> [-Werror=implicit-function-declaration]<br>
> > opts->rpc->parent_img = strdup(path);<br>
> ><br>
> > Signed-off-by: Adrian Reber <<a href="mailto:areber@redhat.com" target="_blank">areber@redhat.com</a>><br>
> > ---<br>
> > criu/cr-service.c | 2 +-<br>
> > criu/files.c | 2 +-<br>
> > criu/fsnotify.c | 2 +-<br>
> > criu/include/files.h | 2 ++<br>
> > criu/include/syscall-types.h | 2 ++<br>
> > criu/netfilter.c | 2 +-<br>
> > criu/pie/restorer.c | 1 +<br>
> > criu/sk-unix.c | 2 +-<br>
> > lib/c/criu.c | 1 +<br>
> > 9 files changed, 11 insertions(+), 5 deletions(-)<br>
> ><br>
> > diff --git a/criu/cr-service.c b/criu/cr-service.c<br>
> > index 64ab8b7..797d704 100644<br>
> > --- a/criu/cr-service.c<br>
> > +++ b/criu/cr-service.c<br>
> > @@ -1103,7 +1103,7 @@ int cr_service(bool daemon_mode)<br>
> ><br>
> > pr_info("Waiting for connection...\n");<br>
> ><br>
> > - sk = accept(server_fd, &client_addr, &client_addr_len);<br>
> > + sk = accept(server_fd, (struct sockaddr *)&client_addr, &<br>
> client_addr_len);<br>
> > if (sk == -1) {<br>
> > pr_perror("Can't accept connection");<br>
> > goto err;<br>
> > diff --git a/criu/files.c b/criu/files.c<br>
> > index 719d0be..54d087c 100644<br>
> > --- a/criu/files.c<br>
> > +++ b/criu/files.c<br>
> > @@ -910,7 +910,7 @@ static int open_transport_fd(int pid, struct<br>
> fdinfo_list_entry *fle)<br>
> > pr_perror("Can't create socket");<br>
> > return -1;<br>
> > }<br>
> > - ret = bind(sock, &saddr, sun_len);<br>
> > + ret = bind(sock, (struct sockaddr *)&saddr, sun_len);<br>
> > if (ret < 0) {<br>
> > pr_perror("Can't bind unix socket %s", saddr.sun_path + 1);<br>
> > goto err;<br>
> > diff --git a/criu/fsnotify.c b/criu/fsnotify.c<br>
> > index 4035506..aafffae 100644<br>
> > --- a/criu/fsnotify.c<br>
> > +++ b/criu/fsnotify.c<br>
> > @@ -15,7 +15,7 @@<br>
> > #include <sys/vfs.h><br>
> > #include <linux/magic.h><br>
> > #include <sys/wait.h><br>
> > -#include <sys/poll.h><br>
> > +#include <poll.h><br>
> > #include <sys/mman.h><br>
> > #include <sys/mount.h><br>
> > #include <aio.h><br>
> > diff --git a/criu/include/files.h b/criu/include/files.h<br>
> > index 5e3d6dc..e0b853d 100644<br>
> > --- a/criu/include/files.h<br>
> > +++ b/criu/include/files.h<br>
> > @@ -1,6 +1,8 @@<br>
> > #ifndef __CR_FILES_H__<br>
> > #define __CR_FILES_H__<br>
> ><br>
> > +#include <sys/stat.h><br>
> > +<br>
> > #include "compiler.h"<br>
> > #include "asm/types.h"<br>
> > #include "fcntl.h"<br>
> > diff --git a/criu/include/syscall-types.h b/criu/include/syscall-types.h<br>
> > index 49798fa..db0dbc0 100644<br>
> > --- a/criu/include/syscall-types.h<br>
> > +++ b/criu/include/syscall-types.h<br>
> > @@ -11,6 +11,8 @@<br>
> > #include <sys/time.h><br>
> > #include <arpa/inet.h><br>
> > #include <sched.h><br>
> > +#include <time.h><br>
> > +#include <fcntl.h><br>
> ><br>
> > #include "asm/types.h"<br>
> ><br>
> > diff --git a/criu/netfilter.c b/criu/netfilter.c<br>
> > index a105ed7..000f167 100644<br>
> > --- a/criu/netfilter.c<br>
> > +++ b/criu/netfilter.c<br>
> > @@ -2,7 +2,7 @@<br>
> > #include <arpa/inet.h><br>
> > #include <unistd.h><br>
> > #include <string.h><br>
> > -#include <wait.h><br>
> > +#include <sys/wait.h><br>
> > #include <stdlib.h><br>
> ><br>
> > #include "asm/types.h"<br>
> > diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c<br>
> > index 5910fd0..0da167f 100644<br>
> > --- a/criu/pie/restorer.c<br>
> > +++ b/criu/pie/restorer.c<br>
> > @@ -6,6 +6,7 @@<br>
> > #include <linux/aio_abi.h><br>
> > #include <sys/types.h><br>
> > #include <sys/mman.h><br>
> > +#include <sys/file.h><br>
> > #include <sys/stat.h><br>
> > #include <sys/wait.h><br>
> > #include <sys/time.h><br>
> > diff --git a/criu/sk-unix.c b/criu/sk-unix.c<br>
> > index ca6673e..5498718 100644<br>
> > --- a/criu/sk-unix.c<br>
> > +++ b/criu/sk-unix.c<br>
> > @@ -1166,7 +1166,7 @@ static int open_unixsk_standalone(struct<br>
> unix_sk_info *ui)<br>
> > * The below is hack: we use that connect with AF_UNSPEC<br>
> > * clears socket's peer.<br>
> > */<br>
> > - if (connect(sk, &addr, sizeof(addr.sun_family))) {<br>
> > + if (connect(sk, (struct sockaddr *)&addr, sizeof<br>
> (addr.sun_family))) {<br>
> > pr_perror("Can't clear socket's peer");<br>
> > return -1;<br>
> > }<br>
> > diff --git a/lib/c/criu.c b/lib/c/criu.c<br>
> > index e75268c..5c65d9f 100644<br>
> > --- a/lib/c/criu.c<br>
> > +++ b/lib/c/criu.c<br>
> > @@ -10,6 +10,7 @@<br>
> > #include <stdlib.h><br>
> > #include <errno.h><br>
> > #include <signal.h><br>
> > +#include <string.h><br>
> ><br>
> > #include "criu.h"<br>
> > #include "rpc.pb-c.h"<br>
> > --<br>
> > 2.7.4<br>
> ><br>
> > _______________________________________________<br>
> > CRIU mailing list<br>
> > <a href="mailto:CRIU@openvz.org" target="_blank">CRIU@openvz.org</a><br>
> > <a href="https://lists.openvz.org/mailman/listinfo/criu" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
><br>
</blockquote></div>