-
Notifications
You must be signed in to change notification settings - Fork 49
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
Umbrella framework handling #640
Comments
I didn't get around to this issue before now, but thank you so much for the detailed investigation! For completeness, I'll list all the umbrella frameworks in the macOS 14.5 SDK:
And the ones in the iPhone 17.5 SDK:
|
I think another interesting point is that the headers in sub-frameworks are not actually importable by themselves, i.e. you cannot do One more point of interest is the actual linking, i.e. when you reference a static from a sub-framework, which framework does the dynamic linker load it from? And here again, it seems like you can only link to the umbrella framework itself, the sub-frameworks are considered "private" in this sense (they do still exist in the eyes of |
I think the reason that some of these are extra weird is because they pre-date the public introduction of their sub-framework. E.g. |
So to answer your initially posed questions:
I think I'd like it to be implemented as modules inside of the crate, to make the generated code easier to read, but the modules would be private and have a
Yeah, I think that's the only viable option.
I think it's possible for us to link to it as-if? So e.g. For Maybe I'm not understanding the question right?
The "proper" way to do anything like this at all is to read the |
Hmm, I think I was a bit wrong regarding In any case, the hard part is going to be de-duplication. Both But this comes with another complication: when using the types from |
Wait, that's actually done by the linker! So we don't have to do anything here, if we just write That does beg the question of what would happen if some symbol was only available in tl;dr you can use (Of course this only works if the linker is actually configured with the correct deployment target, which it hasn't historically been, see rust-lang/rust#129369). |
The exact semantics of Cargo features in umbrella frameworks are still undecided, see #640. So for now I've gone with the solution that required the least code-changes, which is that each file still gets its own feature.
Apple has the concept of "umbrella frameworks", frameworks that include other "sub-frameworks". objc2 doesn't currently handle these, no crates are provided for any umbrella framework or any sub-framework.
I'm trying to add a crate for AVFoundation, which is such an umbrella framework, so I've done some digging into how those work, here are my observations:
Apple seems to be entirely confused here about what actually constitutes a sub-framework and what is a top-level framework in its own right, and so we can no longer rely on deriving the docs URL from the framework's name.
Here are the problems we'd need to handle to get these into objc2:
translation-config.toml
.The text was updated successfully, but these errors were encountered: