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

"StoreKit" feature depends on "AppKit", which is not available on iOS #482

Closed
wooden-worm opened this issue Aug 10, 2023 · 4 comments · Fixed by #592
Closed

"StoreKit" feature depends on "AppKit", which is not available on iOS #482

wooden-worm opened this issue Aug 10, 2023 · 4 comments · Fixed by #592
Labels
A-framework Affects the framework crates and the translator for them bug Something isn't working

Comments

@wooden-worm
Copy link

I'm trying to use icrate on iOS. My goals are simple: showing IAPs and allowing users to purchase them. However, icrate with StoreKit feature fails to build for iOS due to its dependency on AppKit https://github.com/madsmtm/objc2/blob/3d9b6864af05592fc18b1ab27b3da9ed3896bc53/crates/icrate/Cargo.toml#L4582C1-L4585C2

Proposal: remove the dependency on AppKit. Users who need it can easily enable AppKit.

@silvanshade
Copy link
Contributor

silvanshade commented Aug 22, 2023

Yeah, this is not ideal.

The goal is eventually to have the header translator that generates the Rust code from the Objective-C framework headers do a platform-specific analysis (e.g., for macOS vs iOS vs watchOS, ...) that would catch this sort of thing and only expose the correct features and sub-modules per-platform.

But right now that functionality is not really implemented and the actual backend logic for the translator is in the process of moving to a new, more robust approach, so it may be awhile before that functionality lands (probably at least another month or two, and that may be optimistic).

You can read a little about it here:

A one-off fix to address this specific case might be possible but the difficulty is in maintaining that change throughout the header generation process. There isn't really tool support for that now so it would have to be re-implemented by hand each time the generator is re-run.

Probably the most practical solution at the moment would be to maintain a local fork of your own with those changes that you need and then you could rebase your fork on top of whatever updates are released through icrate as needed.

Hopefully it will be possible to handle this more directly once the new binding generator starts to become usable.

@madsmtm madsmtm added bug Something isn't working A-framework Affects the framework crates and the translator for them labels Aug 25, 2023
@madsmtm madsmtm added this to the Rewrite header translator milestone Sep 5, 2023
@bysensa
Copy link

bysensa commented Apr 12, 2024

Any updates here?

@madsmtm
Copy link
Owner

madsmtm commented Apr 12, 2024

#592, which will hopefully land soon, will fix this by making the AppKit dependency optional

@bysensa
Copy link

bysensa commented Apr 12, 2024

#592, which will hopefully land soon, will fix this by making the AppKit dependency optional

Awesome, thank you

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 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants