-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Two CoreFoundations lead to redefinition errors #189687
Comments
A related thread and workaround #160876 (comment) |
The ideal state would be for CoreFoundation to appear once when compiling and linking. Today, CoreFoundation appears once from stdenv and again when some derivation depends on linking to the (impure) system CoreFoundation. In addition, dependencies of CoreFoundation (in this case, libobjc on aarch64-darwin) can appear twice for the same reason. It is this repeating of libobjc that surfaces the redefinition errors. As an intermediate step, I currently envision removing CoreFoundation from stdenv and declaring the dependency explicitly in derivations that need it. The removed CoreFoundation is from a bootstrap stage, while the explicit one won't be, which should solve the redefinition errors because there will only be one libobjc available. The CoreFoundation in the stdenv is currently pure, so we'd need to introduce a PureCoreFoundation derivation (which exists, currently called CF by convention) for this purpose. I plan to start experimenting with this. /cc @LnL7 @thefloweringash @toonn in case they already know this won't work or have other ideas in the meantime |
Encountered a problem with this approach. Building the frameworks depends on MacOSX-SDK, which transitively depends on fetching patches using curl, but curl needs CoreFoundation to build. |
I wonder if this conditional is trying to fix the same root problem? This is coming from #189977. |
Great find. I have hopes that will resolve the errors seen in |
Closing this because #191235 was merged into |
Describe the bug
It seems that some packages, such as
cargo-watch
, depend on CoreFoundation. When they are compiled, there are two different CoreFoundations added to the compiler's path (which can be verified by observingNIX_CFLAGS_COMPILE
).One of them was built with
stdenv-darwin
. The other was built withbootstrap-stage4-stdenv-darwin
. Inapple-sdk-11.0
, CoreFoundation depends on libobjc, for which two different versions being present produce redefinition errors:I think the
bootstrap-stage4-stdenv-darwin
CoreFoundation comes fromextraBuildInputs
in stdenv-darwin. I'm not sure what to do about it, however.Steps To Reproduce
Steps to reproduce the behavior:
nix build .#cargo-watch
.Expected behavior
I don't think two versions of CoreFoundation should be added to the compile path.
Notify maintainers
/cc @NixOS/darwin-maintainers
The text was updated successfully, but these errors were encountered: