-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
add setup-hook to fix darwin frameworks #22571
Conversation
stdenv.lib.optional stdenv.isLinux systemd ++ | ||
stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ]; | ||
propagatedBuildInputs = stdenv.lib.optional stdenv.isLinux systemd | ||
++ stdenv.lib.optionals stdenv.isDarwin [ fixDarwinFrameworks libobjc IOKit ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be propagated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess
I don't understand how this works. A big flavor of issue is:
Now, if data gets passed inside B from A to the impure framework, you'll get a segfault. So my question: would this build hook get applied to A, B or both? If it's just B, I don't think it'll fix things. If it's both, it will, but that's equivalent to just making pure CF into an impure symlink. Just A isn't a particularly meaningful option 😄 The reason I keep suggesting |
If I understand how all this works correctly this shouldn't be used for A in that example. But there are some libraries like |
I've tried to apply this in the context of pygtk, tryton and xournal, without success. Think that I would have to apply it in the dependencies of them, but then it's kind of the same as making CF impure for everything. Starting to think that the wrapper approach for applications on a case by case base is probably the best we can do at the moment. |
Relevant: #23018 |
Transcribing my comments from IRC:
|
7ac75ab
to
1cd5e67
Compare
1cd5e67
to
97a3e7c
Compare
👍 |
Is there a reason why we force the use of impure CF? Why can't we just make sure all the programs use the pure CF? |
The pure CF doesn't really match the impure one featurewise. It will once https://github.com/apple/swift-corelibs-foundation/tree/master/CoreFoundation becomes the default and we can build it as part of our stdenv, but until then, a lot of the magic features in CF like toll-free bridging don't work on our pure one but lots of the standard Apple frameworks assume it. |
Motivation for this change
Dynamic libraries built with nix use a pure version of CF, this can cause issues when it also depends on frameworks.
Fixes #22450, #20484
Packages that are fixed by this without setting
DYLD_LIBRARY_PATH
with a wrapper.Things done
nix-shell -p nox --run "nox-review wip"
./result/bin/
)/cc @copumpkin @pikajude @johbo