Created attachment 226210 [details] v1 (revert upstream change) In 0.3.31 update ( ports ea3170c51fd4) https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/cb6dbd165a37 made public API incompatible with consumers using _POSIX_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE: <sys/mount.h> isn't standalone but depends on BSD-specific types in <sys/types.h> which are hidden when POSIX compliance is requested. xdg-desktop-portal-wlr passes -D_POSIX_C_SOURCE=200809L via meson.build which works for its own code and all other dependencies. In file included from ../src/core/main.c:7: In file included from /usr/local/include/pipewire-0.3/pipewire/pipewire.h:35: In file included from /usr/local/include/pipewire-0.3/pipewire/client.h:35: In file included from /usr/local/include/pipewire-0.3/pipewire/proxy.h:108: In file included from /usr/local/include/pipewire-0.3/pipewire/protocol.h:48: In file included from /usr/local/include/pipewire-0.3/pipewire/utils.h:34: In file included from /usr/include/sys/mount.h:38: /usr/include/sys/ucred.h:99:2: error: unknown type name 'u_int' u_int cr_version; /* structure layout version */ ^ In file included from ../src/core/main.c:7: In file included from /usr/local/include/pipewire-0.3/pipewire/pipewire.h:35: In file included from /usr/local/include/pipewire-0.3/pipewire/client.h:35: In file included from /usr/local/include/pipewire-0.3/pipewire/proxy.h:108: In file included from /usr/local/include/pipewire-0.3/pipewire/protocol.h:48: In file included from /usr/local/include/pipewire-0.3/pipewire/utils.h:34: http://www.ipv6proxy.net/go.php?u=http://beefy18.nyi.freebsd.org/data/main-amd64-default/p8656d375678d_s6329ca325e/logs/errors/xdg-desktop-portal-wlr-0.4.0.log
Created attachment 226211 [details] v1.1 (revert upstream change) Fixed wording in patch comment. Note, xdg-desktop-portal-wlr upstream tests FreeBSD on CI. Dropping -D_POSIX_C_SOURCE=200809L requires convincing upstream first that this is *not* a bug in the dependency. https://github.com/emersion/xdg-desktop-portal-wlr/blob/master/.builds/freebsd.yml
Marking for MFH as 2021Q3 was recently branched.
Created attachment 226225 [details] v2 What do you think about this? I wait for Linux CI to complete, if it is OK to you, I'll MR this upstream. I'll write more about xdg-desktop-portal-wlr under this bug later, but I've just got home and want to fix it ASAP now, so I reply now.
(In reply to Evgeniy Khramtsov from comment #3) > If it is OK to you Nevermind: https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/815/commits
> xdg-desktop-portal-wlr passes -D_POSIX_C_SOURCE Even though Wayland depends on Linux-specific DRM and GBM, weird... > Dropping -D_POSIX_C_SOURCE=200809L requires convincing upstream first that this is *not* a bug in the dependency. I doubt xdg-desktop-portal-wlr will do it, it seems that POSIX compliance matters to them. I MR'ed a workaround for xdg-desktop-portal-wlr in PipeWire for now. Unfortunately, I can't really invest much time nowadays... (255348 somewhat related).
(In reply to Evgeniy Khramtsov from comment #5) > Linux-specific GBM nevermind, i better go have a rest
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256988 to unbreak xdg-desktop-portal-wlr for now.
(In reply to Evgeniy Khramtsov from comment #3) Why <sys/mount.h> is included in a header (namespace pollution) instead of *.c files that call statfs() ? For example, src/modules/module-protocol-pulse/utils.c has <sys/vfs.h> but not <sys/mount.h> despite both headers being used to declare statfs() on different platforms.
(In reply to Jan Beich from comment #8) > Why <sys/mount.h> is included in a header (namespace pollution) instead of *.c files that call statfs() ? For example, src/modules/module-protocol-pulse/utils.c has <sys/vfs.h> but not <sys/mount.h> despite both headers being used to declare statfs() on different platforms. I want to keep FreeBSD-specific definitions in less files, preferably. See https://github.com/PipeWire/pipewire/blob/master/src/pipewire/utils.h#L73, utils.h was claimed for FreeBSD-specific defines first by Greg V. Definitions from here get passed to the whole PipeWire, so LOCAL_PEERCRED from here should get defined for everything (if upstream refactor again, etc), but I had no idea that this utils.h gets included from public API for consumers. In short: I added FreeBSD-specific definitions to the place where they were. I agree that this is namespace pollution, these definitions should be moved somewhere else, so they are not public.
(In reply to Evgeniy Khramtsov from comment #9) > I agree that this is namespace pollution, these definitions should be moved somewhere else, so they are not public. v1.1 (revert upstream change) can be submitted upstream, I guess. You are the author of v1.1, feel free to submit upstream if you want, but I would still wait for arrowd@ to say which way would be fine.
Landed in ports 701a40c48b3b (and MFH'd in ports 4dd7d7e9db8e) to avoid pkg-fallout@ spam and unblock https://github.com/emersion/xdg-desktop-portal-wlr/pull/141#issuecomment-874822700