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
[TBDGen] Track unavailable declarations against the active platform for api generation #73284
Conversation
api generation This resolves the bug where apijson files recorded declarations as unavailable purely because it was unavailable on a unrelated platforms. Resolves: rdar://113552185
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.
Good find. Thanks Cyndy!
@swift-ci please test |
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.
Thanks Cyndy! I think this is the first time I'm reading this code in detail, and now that my attention has been drawn to it I see a number of issues because there's some complex logic implemented in Sema
for availability checking that doesn't appear to be taken into account here. I don't think they need to be fixed in this PR, but I'll file some radars to track the following:
- Availability declared in the enclosing scope, but not directly on the specific declaration, is not considered here.
- For some platforms, availability is inherited implicitly from the attributes for other platforms when there is no explicit availability for the target platform (e.g. iOS availability is used for macCatalyst frameworks).
- There may be some nuances with application extension availability attributes that aren't handled here.
rdar://127126725 |
Sounds good! Thanks for flagging this. My preferred approach here is to be able to query given the active target triple, if this declaration is unavailable and the serialization code does not handle any platform-specific details like implied availability. Maybe it's useful to distinguish whether it's deployment version-specific. Not sure if sdkdb generation happens strictly after |
@swift-ci please smoke test |
This resolves the bug where api json files recorded declarations as unavailable purely because it was unavailable on unrelated platforms.
Resolves: rdar://113552185