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

Move to objc2 #2427

Closed
wants to merge 6 commits into from
Closed

Move to objc2 #2427

wants to merge 6 commits into from

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Aug 12, 2022

A sneak-peak at the improvements I've been working on for iOS and macOS.

Move to objc2, my fork of objc which adds a lot of things, in particular macros for proper memory management, and a lot of fixed soundness issues.

When done, this should vastly improve the safety and ease-of-maintenance of the iOS and macOS platforms. Opening this PR to have something to refer to, but will split it up into smaller parts when I'm ready to actually get it merged.

  • Tested on all platforms changed
    • macOS 10.14
    • iOS simulator (can't get log output here though, so a bit harder)
    • iOS 9.3.6 (iPad mini 1st gen)
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

@madsmtm madsmtm added S - enhancement Wouldn't this be the coolest? DS - macos DS - ios C - in progress Implementation is proceeding smoothly S - maintenance Repaying technical debt labels Aug 12, 2022
@madsmtm madsmtm self-assigned this Aug 12, 2022
@madsmtm madsmtm mentioned this pull request Aug 12, 2022
4 tasks
@notgull
Copy link
Member

notgull commented Aug 12, 2022

Should we enable the "exception" feature? It seems unsound got exceptions to unwind into Rust.

@madsmtm
Copy link
Member Author

madsmtm commented Aug 12, 2022

Should we enable the "exception" feature? It seems unsound got exceptions to unwind into Rust.

The feature flag is called catch-all if you want every msg_send! to be wrapped in a @try/@catch.

Re soundness: That feature is just as unsound as letting exceptions unwind into Rust, since our message sending is implemented in Rust. extern "C-unwind" would need to be stable before it is sound (can be tried with objc2's unstable-c-unwind feature flag), but that makes the point moot as letting exceptions just unwind into Rust also becomes sound.

Practically, I haven't enabled it because exceptions are rare, the user-experience approximately the same, and enabling it requires running clang which is inconvenient for some users.

Note that people can still enable it if they want by depending on objc2 and enabling the feature themselves

@madsmtm
Copy link
Member Author

madsmtm commented Aug 31, 2022

This is very close to where I want it to be, so I'll start opening smaller PRs.

@madsmtm madsmtm mentioned this pull request Sep 2, 2022
1 task
@madsmtm madsmtm added this to the Version 0.28 milestone Sep 2, 2022
@mgax mgax mentioned this pull request Sep 2, 2022
4 tasks
@madsmtm madsmtm mentioned this pull request Sep 2, 2022
1 task
@madsmtm
Copy link
Member Author

madsmtm commented Sep 2, 2022

This is finished, the remaining parts are in #2465 and #2462

@madsmtm madsmtm closed this Sep 2, 2022
@madsmtm madsmtm deleted the objc2 branch September 2, 2022 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - in progress Implementation is proceeding smoothly DS - ios DS - macos S - enhancement Wouldn't this be the coolest? S - maintenance Repaying technical debt
Development

Successfully merging this pull request may close these issues.

None yet

2 participants