GNOME Bugzilla – Bug 786763
ipcpipeline: tests and example don't build on macOS
Last modified: 2017-09-04 08:25:17 UTC
Created attachment 358350 [details] build log See attached build logs
Hopefully fixed. These fcntl() calls are supposed to be portable, but I can only test on linux here. Please let me know if something is still not working. Just for the record, the {0} initializer warnings is a compiler bug. commit 4e239a6632ca648e3bf39b120e2d15822e5540e4 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Thu Aug 31 15:07:45 2017 +0300 examples: ipcpipeline: do not use the linux-specific SOCK_NONBLOCK flag Use fcntl() instead to set O_NONBLOCK, which is portable. https://bugzilla.gnome.org/show_bug.cgi?id=786763 commit 282b682caba2fc3d932591d7842cb953ad2357f8 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Thu Aug 31 14:57:34 2017 +0300 tests: ipcpipeline: provide pipe2() on systems that don't have it https://bugzilla.gnome.org/show_bug.cgi?id=786763
(In reply to George Kiagiadakis from comment #1) > Just for the record, the {0} initializer warnings is a compiler bug. I'm not sure it make sense in this context, but I've seen code initializing the first member of the struct with proper type, and then just adding a comma, which was assumed more portable in the code I've seen. struct my_type mt = { NULL, };
make -C tests/examples/ipcpipeline/ CC ipcpipeline1-ipcpipeline1.o CCLD ipcpipeline1 CC ipc_play-ipc-play.o ipc-play.c:972:42: error: use of undeclared identifier 'SOCK_NONBLOCK' if (socketpair (AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0, pipes)) { ^ 1 error generated. make: *** [ipc_play-ipc-play.o] Error 1
Also, I wonder why ipcpipeline is in DIST_SUBDIRS but not in SUBDIRS in the Makefile.am. Is that intended?
commit 91edec25dd2a50e44b970296e55e1570c3e0d33c Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Mon Sep 4 10:39:58 2017 +0300 examples: ipcpipeline: get rid of yet another use of SOCK_NONBLOCK https://bugzilla.gnome.org/show_bug.cgi?id=786763
(In reply to Philippe Normand from comment #4) > Also, I wonder why ipcpipeline is in DIST_SUBDIRS but not in SUBDIRS in the > Makefile.am. Is that intended? No specific intention, I just followed the example of others. I'm not sure if there's a policy for SUBDIRS vs DIST_SUBDIRS usage?
It is in SUBDIRS when enabled: if USE_IPCPIPELINE IPCPIPELINE_DIR=ipcpipeline else IPCPIPELINE_DIR= endif SUBDIRS = ... $(IPCPIPELINE_DIR) ... (It's more efficient to prevent make descending into subdirs if the whole plugin is disabled)
(In reply to Tim-Philipp Müller from comment #7) > It is in SUBDIRS when enabled: > > if USE_IPCPIPELINE > IPCPIPELINE_DIR=ipcpipeline > else > IPCPIPELINE_DIR= > endif > > SUBDIRS = ... $(IPCPIPELINE_DIR) ... I believe Philippe is talking about tests/examples/Makefile.am
(In reply to George Kiagiadakis from comment #8) > I believe Philippe is talking about tests/examples/Makefile.am Oh! And looking at your reply, I just realized I should have done the same trick for tests/examples/Makefile.am Will fix.