After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772279 - Mac OS X build failure: pipe2 not supported
Mac OS X build failure: pipe2 not supported
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: libide
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-01 07:10 UTC by Tom Schoonjans
Modified: 2016-10-06 13:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
subprocess: prefer g_unix_open_pipe() over pipe2() (2.00 KB, patch)
2016-10-05 21:50 UTC, Christian Hergert
committed Details | Review
subprocess: use FD_CLOEXEC not O_CLOEXEC to g_unix_open_pipe (5.43 KB, patch)
2016-10-06 13:43 UTC, Ray Strode [halfline]
committed Details | Review

Description Tom Schoonjans 2016-10-01 07:10:58 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
Comment 1 Christian Hergert 2016-10-01 07:44:18 UTC
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).
Comment 2 Ray Strode [halfline] 2016-10-05 18:38:53 UTC
should probably just use g_unix_open_pipe ?
Comment 3 Christian Hergert 2016-10-05 21:50:56 UTC
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.
Comment 4 Christian Hergert 2016-10-05 21:51:26 UTC
Attachment 337016 [details] pushed as b980add - subprocess: prefer g_unix_open_pipe() over pipe2()
Comment 5 Ray Strode [halfline] 2016-10-06 03:00:52 UTC
Note you need to use FD_CLOEXEC not O_CLOEXEC
Comment 6 Ray Strode [halfline] 2016-10-06 13:43:22 UTC
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.