-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have IOSurface depend on Libsystem rather than XPC #163052
Comments
This issue is blocking me, so I started to investigate it, but I need some help. With PR #161561 applied, I can reproduce the
Because I'm not very experienced with C/C++, so I could use some opinions on how this conflict should be handled. Thank you! /cc @toonn |
Perhaps it would make sense to remove the path to /cc @cmm @Mic92, I saw both of you have worked on resolving these sorts of issues before, and I'd love your thoughts. |
Good digging. I'm not sure where the include order is determined. Would changing this order be a fix or would other programs expect libSystem's |
In theory, including libc++'s
However, I would be more surprised if something doesn't break after making this change either. I am trying to dig into this more today, but my lack of experience with debugging and developing in nixpkgs is showing. My plan is to connect to the Matrix channel and ask for some advice there. |
This fixes NixOS#163052, where the xcbuild build fails on Darwin after libSystem is added as a dependency of IOSurface. Even though cc-wrapper adds libc to NIX_CFLAGS_COMPILE using the -idirafter flag, ensuring it comes after the C++ standard library, and the clang-tools wrapper respects -idirafter when it parses arguments, it appears that "-isystem libc" can make its way onto NIX_CFLAGS_COMPILE too. In honesty, I have not been able to figure out how NIX_CFLAGS_COMPILE inherits "-isystem libSystem", or how it influences the xcbuild build itself. However: 1. This change does appear to fix the xcbuild build. 2. If NIX_CFLAGS_COMPILE does have "-isystem libSystem" added to it somehow, it _should_ probably come after the C++ standard library.
This fixes NixOS#163052, where the xcbuild build fails on Darwin after libSystem is added as a dependency of IOSurface. Even though cc-wrapper adds libc to NIX_CFLAGS_COMPILE using the -idirafter flag, ensuring it comes after the C++ standard library, and the clang-tools wrapper respects -idirafter when it parses arguments, it appears that "-isystem libc" can make its way onto NIX_CFLAGS_COMPILE too. In honesty, I have not been able to figure out how NIX_CFLAGS_COMPILE inherits "-isystem libSystem", or how it influences the xcbuild build itself. However: 1. This change does appear to fix the xcbuild build. 2. If NIX_CFLAGS_COMPILE does have "-isystem libSystem" added to it somehow, it _should_ probably come after the C++ standard library.
I think this can be closed now that #191235 is merged? |
Yes, thank you for pointing this out! Fixed in #191235 |
Describe the bug
The IOSurface framework as defined by the apple-source-releases depends on XPC. This causes redefinition errors because other frameworks get these definitions from Libsystem. There was an attempt to fix it in PR #161561, but this causes build problems due to Libsystem and libc++ being incompatible currently, so it was reverted in PR #162681.
Steps To Reproduce
The first problem:
mac-notification-sys
.The second problem:
xcbuild
.Expected behavior
The incompatibility between Libsystem and libc++ should be fixed so we can have IOSurface properly depend on Libsystem without causing problems.
The text was updated successfully, but these errors were encountered: