GNOME Bugzilla – Bug 772279
Mac OS X build failure: pipe2 not supported
Last modified: 2016-10-06 13:43:53 UTC
The latest release (3.22.0) of gnome-builder does not compile on Mac OS X due to the presence of the pipe2 syscall in libide/subprocess/ide-breakout-subprocess.c, which is not supported by Mac OS X (at least not on El Capitan and older). I managed to circumvent this by adding an implementation of pipe2 I found to the source code but clearly a better solution is required which involves configure checking for this function. Tom
I'm impressed that it compiled before! If we want to abstract this properly, we probably want to add our own wrapper for it in libide/util/ide-posix.[ch] That said, the only place it is used today is IdeBreakoutSubprocess which is only useful when running from inside a flatpak. So we could probably make that conditionally compile out (and appropriate changes in ide-subprocess-launcher.c).
should probably just use g_unix_open_pipe ?
Created attachment 337016 [details] [review] subprocess: prefer g_unix_open_pipe() over pipe2() pipe2() is apparently not available for us on Mac OS X. While that is not a major target for us, if it's easy to support we might as well do it.
Attachment 337016 [details] pushed as b980add - subprocess: prefer g_unix_open_pipe() over pipe2()
Note you need to use FD_CLOEXEC not O_CLOEXEC
Created attachment 337067 [details] [review] subprocess: use FD_CLOEXEC not O_CLOEXEC to g_unix_open_pipe One giant pitfall with g_unix_open_pipe is its flags are fcntl flags, not open flags. This commit fixes the three g_unix_open_pipe invocations in ide-breakout-subprocess to use FD_CLOEXEC.