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

iOS support #1

Closed
youknowone opened this issue Jul 21, 2022 · 5 comments · Fixed by #8
Closed

iOS support #1

youknowone opened this issue Jul 21, 2022 · 5 comments · Fixed by #8

Comments

@youknowone
Copy link
Owner

No description provided.

@simlay
Copy link

simlay commented Jul 25, 2022

Hi there! This project is pretty cool. I'm glad to see the rust bindgen objective-c features.

Depending on effort, I'm up for picking up this task or a subtask. Mind writing some expectations? If you're interested in running some actual unit tests in an iOS simulator, cargo-dinghy bundles up unit tests, runs them with xcrun and lldb to get the exit status. Thoughts?

@youknowone
Copy link
Owner Author

youknowone commented Jul 25, 2022

Hi! First of all, thank you a lot! I wrote the first version of this project based on your uikit-sys build.rs!

Recently I added apple-bindgen subcrate, the bindgen-running crate. Unlike apple-sys, it is including iOS support - without bindgen rules. Well, many of them will fail. To be honest, I only tested CoreFoundation for iOS.

The primary missing connection between apple-sys and apple-bindgen is TARGET to sdk matching. Because I found apple-sdk already made great job, I sent a patch for this feature indygreg/toolchain-tools#1.

Because it was only 3 days ago, I would wait for a few more days. Depending on whether they accept it or not, I'd like use the new version of apple-sdk or adding the patch back to apple-sys to add iOS(and every other platforms) support.

Second part is configure.py to add framework names as features. The script need to take arguments to handle platforms. And blocklist for bindgen-imcompatible frameworks.

The last part is Bindgen rule. What we need for that is trying to build the generated output of iOS and add correct rules for the files. I remember you already find rules for it in uikit-sys build.rs

I am really grateful that you left comment to say you want to take any part of the project. This is the best feedback ever for my projects' first week!

dinghy looks really good. Using it looks really good idea. Thank you for introducing a nice project 😄

@youknowone
Copy link
Owner Author

Oh, you were the author of Objective-C support of bindgen! No wonder how I found uikit-sys from bindgen document. 😲

@simlay
Copy link

simlay commented Jul 26, 2022

Oh, you were the author of Objective-C support of bindgen! No wonder how I found uikit-sys from bindgen document. 😲

I'm not quite the original author. I came across the mild/broken support for it and just kinda incrementally added small stuff that made sense and a few PRs later it felt like structured rust calling into objective-c. This project and uikit-sys are some of the only projects using it.

I've also been watching objc2 with hopes of having better memory management.

There's still plenty of things I wish I had more time to add/fix. Wrote some of it down in madsmtm/objc2#85 (comment). As mentioned there, rust-lang/rust-bindgen#1784 is a feature that's pretty important but haven't gotten around to fixing or showing it's worth the performance loss.

@youknowone
Copy link
Owner Author

apple-sdk 0.2.0 is published

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 a pull request may close this issue.

2 participants