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 ServiceManagement framework #546

Merged
merged 2 commits into from
Dec 29, 2023

Conversation

dongcarl
Copy link
Contributor

Ref: https://developer.apple.com/documentation/servicemanagement?language=objc

Generated PR: madsmtm/objc2-generated#9


A note: When running header-translator, I was getting a panic at:

let file = library.files.get_mut(&file_name).expect("file");

I logged the filename and found that header-translator is trying to get the ServiceManagement.h file, which didn't exist in library.files.

The reason why it's trying to get ServiceManagement.h is because unlike most "umbrella" files in frameworks, the ServiceManagement.h file has a few const CFStringRef declarations in them.

This is perhaps also reflected in ServiceManagement's modulemap, where the umbrella declaration is:

        umbrella "Headers"

Instead of something found in all other icrate supported Frameworks:

        umbrella header "CoreWLAN.h"

Since we need to skip all the declarations in ServiceManagement.h for CoreFoundation reasons, a workaround is just to delay unwrapping the file unless we parsed usable statements, which is implemented in this PR


A question: The "Service Management" framework in general is supported on earlier macOS versions than the SMAppService, so which versions should I put in crates/header-translator/translation-config.toml? Also, which unstable-frameworks-macos-* should I put it under?

@madsmtm
Copy link
Owner

madsmtm commented Dec 26, 2023

CI is failing because you're using a newer version of Xcode than icrate is currently generated with.

which versions should I put

Put the version of the framework; the supported versions of the framework will be automatically imported after we resolve #266.

modulemap

Yeah, we don't support that at all, the plan is to integrate better with clang first.

@dongcarl
Copy link
Contributor Author

Seems like things are passing now

@dongcarl
Copy link
Contributor Author

Anything else needed here?

@madsmtm madsmtm added enhancement New feature or request A-framework Affects the framework crates and the translator for them labels Dec 29, 2023
Copy link
Owner

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, looks good, thanks!

@madsmtm madsmtm merged commit 66db4a6 into madsmtm:master Dec 29, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Affects the framework crates and the translator for them enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants