Skip to content
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 backend for Darwin availability annotations. #857

Conversation

bzbarsky-apple
Copy link
Contributor

No description provided.

@tecimovic
Copy link
Collaborator

@bzbarsky-apple : what does this do? Can you describe in a short paragraph what is the purpose of this "availability" thing?

@bzbarsky-apple
Copy link
Contributor Author

@tecimovic Darwin APIs need to be annotated with macros that indicate which iOS, macOS, etc releases the APIs shipped in. These take two forms API_AVAILABLE(ios(version), macos(version), ....) and API_DEPRECATED("message", ios(introducedVersion, deprecatedVersion), ...). That way, if you are compiling against headers from version X but want your application to target an earlier version Y you can get your compiler to tell you when you use APIs not available in version Y.

This is putting in place a mechanism whereby:

  1. There is a YAML file that lists releases and for each release lists which things were introduced and deprecated in that release.
  2. In that YAML file we can associate version numbers (for ios, etc) to a release.
  3. We can then auto-generate these annotations for the APIs that we code-generate.

See project-chip/connectedhomeip#24071 for the YAML file and template changes to make use of these new helpers.

@bzbarsky-apple
Copy link
Contributor Author

@tecimovic tecimovic self-requested a review December 15, 2022 14:10
@bzbarsky-apple bzbarsky-apple merged commit a4fdb58 into project-chip:master Dec 15, 2022
@bzbarsky-apple bzbarsky-apple deleted the darwin-availability-annotations branch December 15, 2022 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants