ravynsoft / ravynos

A BSD-based OS project that aims to provide source and binary compatibility with macOS® and a similar user experience.
https://www.ravynos.com
Other
5.68k stars 192 forks source link

Use CoreFoundation from Swift #381

Closed eleanxr closed 1 year ago

eleanxr commented 2 years ago

Addresses #82 .

This PR replaces the contents of Frameworks/CoreFoundation with the contents of the CoreFoundation subdirectory for the Swift 5.7.1 release (https://github.com/apple/swift-corelibs-foundation/tree/swift-5.7.1-RELEASE/CoreFoundation).

In my fork, I tagged the version corresponding to the unmodified import to serve as a branch point for future updates (https://github.com/deleanor/ravynos/tree/import-swift-cf-swift-5.7-RELEASE).

To see the specific changes to the Swift CF implementation that were required to work with the current RavynOS frameworks, it's probably easiest to view the diff in the CoreFoundation directory against the import tag: https://github.com/deleanor/ravynos/compare/import-swift-cf-swift-5.7-RELEASE...deleanor:ravynos:swift-cf-RunLoopWithKevent

Considerations:

eleanxr commented 1 year ago

I think I was probably overly optimistic opening this PR. I've been reading more documentation/code for toll-free bridging to try and figure out how to implement it correctly in a follow-on issue and I'm pretty sure the other frameworks are going to break if this were to get merged. I've found a few locations where frameworks are assuming that they can cast freely between some of the CF and Foundation types. For example, CGImageSource casts from a CFURL to a NSURL to pass into O2ImageSource. So I think this is not ready yet until I can either get bridging in or find a more complete workaround.

lin72h commented 1 year ago

Good work takes time. Thanks for your persistency