[objective_c] Fix build hook#3378
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR Health
Breaking changes
|
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| objective_c | Breaking | 9.3.0 | 9.4.1 | 10.0.0 Got "9.4.1" expected >= "10.0.0" (breaking changes) |
This check can be disabled by tagging the PR with skip-breaking-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 |
|---|
This check can be disabled by tagging the PR with skip-leaking-check.
Changelog Entry ✔️
| Package | Changed Files |
|---|
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.
| final cFlags = <String>[ | ||
| '-isysroot', | ||
| sysroot, | ||
| if (testMode) ...['-arch', 'arm64e'] else ...['-target', target], |
There was a problem hiding this comment.
This seems kind of weird right? We change the architecture based on if we run from this workspace or not. Shouldn't it be based on target device?
Maybe arm64e should actually be added to the Architecture in the code config, and then Flutter needs to pass the right architecture to the build hook. (And then Flutter can invoke the build hook for both archs if it wants and combine it into a fat lib for you.)
There was a problem hiding this comment.
To me the weird thing is that the AOT bot doesn't like arm64. I thought arm64e machines are supposed to be able to consume arm64 binaries, because arm64e is just an extension. So this line is just to get the AOT tests working on the bots. No users have reported the error that the AOT bot did. Maybe it's because of the strange way we're injecting the dylibs into the binary with an environment variable?
There was a problem hiding this comment.
- [code_assets] Add
arm64easArchitecture? #3379 - [flutter_tool] Distinguish
DarwinArch.arm64andDarwinArch.arm64e? flutter/flutter#186856
I'm fine landing a workaround for now so that we can run arm64e on our CI. But I am kind of surprised that we are somehow forced to run in e.
(And the workaround will likely have to be applied by any downstream users too to run on their CI, because the user-define is in the root package pubspec.)
There was a problem hiding this comment.
I don't think downstream users will need to worry about it. I've only seen the error on the new AOT bot, which is using this weird DYLD_INSERT_LIBRARIES workflow. Users won't run into it unless they also try to run AOT tests, at which point they're having to write some custom infra anyway.
Agreed this should probably be fixed by making arm64e a proper architecture though. Otherwise we'll run into the same issue when trying to add native assets support to dart test -c exe.
There was a problem hiding this comment.
Maybe we don't run into it with dart test -c exe because we'll use the proper native_assets.yaml mapping in the kernel file instead of DYLD_INSERT_LIBRARIES?
dcharkes
left a comment
There was a problem hiding this comment.
Okay with the workaround so that we can run on CI.
I've filed flutter/flutter#186856 to explore a proper fix.
Maybe leave a TODO on the workaround.
Also added an integration test that runs the path_provider package using the local objective_c. This reproduced flutter/flutter#186794.
Fixes flutter/flutter#186794 (confirmed)
Fixes #3374 (probably)