Bug 469078 - KCoreAddons does not build on macOS
Summary: KCoreAddons does not build on macOS
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kcoreaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.105.0
Platform: Compiled Sources macOS
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-27 20:51 UTC by Mikaela Szekely
Modified: 2023-05-14 12:08 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The full output of `cmake -B build && cmake --build build` on my macOS system (21.58 KB, text/plain)
2023-04-27 20:51 UTC, Mikaela Szekely
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikaela Szekely 2023-04-27 20:51:24 UTC
Created attachment 158498 [details]
The full output of `cmake -B build && cmake --build build` on my macOS system

SUMMARY

KCoreAddons uses the `SOCK_CLOEXEC` flag, which is Linux-specific and not available on macOS, causing compilation for macOS to fail with `use of undeclared identifier: 'SOCK_CLOEXEC'` in src/lib/util/ksignalhandler.cpp.


STEPS TO REPRODUCE
1. Clone https://invent.kde.org/frameworks/kcoreaddons
2. Run `cmake -B build`
3. Run `cmake --build build`

OBSERVED RESULT
Build fails with:
/Users/qyriad/code/builds/kcoreaddons/src/lib/util/ksignalhandler.cpp:37:45: error: use of undeclared identifier 'SOCK_CLOEXEC'
    if (::socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, KSignalHandlerPrivate::signalFd)) {



EXPECTED RESULT
Build completes successfully without error.

SOFTWARE/OS VERSIONS
macOS: 13.3.1 (x86_64)
KDE Frameworks Version: master, or 5.105.0
Qt Version: Qt6 and Qt5 both have the same result
Comment 1 Nicolas Fella 2023-05-14 12:08:09 UTC
Fixed with https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/341