-
Notifications
You must be signed in to change notification settings - Fork 83
[objective_c] Migrate to native assets #2329
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
base: main
Are you sure you want to change the base?
Conversation
PR Health
License Headers
|
| Files |
|---|
| pkgs/objective_c/example/lib/main.dart |
| pkgs/objective_c/lib/src/ns_input_stream.dart |
All source files should start with a license header.
This check can be disabled by tagging the PR with skip-license-check.
API leaks ⚠️
The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
| Package | Leaked API symbol | Leaking sources |
|---|---|---|
| objective_c | _FinalizablePointer | internal.dart::_ObjCReference::new::_finalizable |
This check can be disabled by tagging the PR with skip-leaking-check.
Breaking changes ⚠️
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| objective_c | Breaking | 9.0.0 | 9.0.0 | 10.0.0 Got "9.0.0" expected >= "10.0.0" (breaking changes) |
This check can be disabled by tagging the PR with skip-breaking-check.
Changelog Entry ❗
| Package | Changed Files |
|---|---|
| package:objective_c | pkgs/objective_c/example/README.md pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md pkgs/objective_c/example/pubspec.yaml pkgs/objective_c/lib/objective_c.dart pkgs/objective_c/lib/src/autorelease.dart pkgs/objective_c/lib/src/c_bindings_generated.dart pkgs/objective_c/lib/src/globals.dart pkgs/objective_c/lib/src/internal.dart pkgs/objective_c/lib/src/ns_input_stream.dart pkgs/objective_c/lib/src/ns_string.dart pkgs/objective_c/lib/src/objective_c_bindings_exported.dart pkgs/objective_c/lib/src/objective_c_bindings_generated.dart pkgs/objective_c/lib/src/protocol_builder.dart pkgs/objective_c/lib/src/runtime_bindings_generated.dart pkgs/objective_c/lib/src/selector.dart pkgs/objective_c/pubspec.yaml |
Changes to files need to be accounted for in their respective changelogs.
This check can be disabled by tagging the PR with skip-changelog-check.
|
Still working on fixing CI, but this is ready for review. |
| // ignore_for_file: always_specify_types | ||
| // ignore_for_file: camel_case_types | ||
| // ignore_for_file: non_constant_identifier_names | ||
| // ignore_for_file: unused_element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fly-by comment: Do you need all these specific ignores given that ffigen generates a generic ignore for all lints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these ignores snug back in? Or are they for some reason actually needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding: Is it expected that stuff in the temp sub directory is checked in? If so, should the directory be named something else?
(There are some other temp directories further down as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there's supposed to be gitignores preventing these from being added. Not sure how this was missed.
That is tracked in:
That sounds like something we should fix before build hooks get to stable! Let me know if you need any help with this. |
dcharkes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice to see all the flutter boiler plate removed!
| - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e | ||
| with: | ||
| channel: 'stable' | ||
| channel: master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be beta?
Or do you intend to wait to merge this PR until the next stable is out, and merge it as stable?
Maybe add a todo to flip it back to stable as soon as the next stable is released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is a temporary change so I can test on CI. I'll wait for stable and revert these changes before landing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you removed the other temp files just double-checking: Is this file and pkgs/swiftgen/test/integration/temp/classes_output.dart supposed to be here?
Notes
@Nativeannotations to load all the ffi symbols. Previously this worked because I loaded the dylib into the executable first, then relied on the@Nativefallback behavior to load the symbols from the exe. Now I'm explicitly setting the asset name to the built dylib, which appears to disable that fallback behavior. But all the core ObjC runtime symbols (egobjc_msgSend) are linked into the exe, not the dylib. So I had to split the C bindings into a set that loads from the dylib, and a set that loads from the exe. There are now 3 sets of ffigen created bindings: the objective C bindings (loads from the dylib), the bindings for my C code (loads from the dylib), and the bindings for the built in ObjC runtime's C code (loads from the exe).Pointer<ObjCObject>, so I had to manually wrap them inNSStrings in globals.dart. I tried splitting the ObjC bindings like I split the C bindings, but this caused all sorts of other problems.TODO: Mac CI failures are due to running the tests through package:coverage (dart-lang/tools#2237). Need to investigate why that's not finding the dylib. The mac tests not running through test_with_coverage are working. If this isn't a quick fix I can temporarily disable coverage collection for these tests.