Support for FFI calls with `@Native external` functions through Native assets on Linux. This enables bundling native code without any build-system boilerplate code.
For more info see:
* https://github.com/flutter/flutter/issues/129757
### Implementation details for Linux.
Mainly follows the design of https://github.com/flutter/flutter/pull/130494.
Some differences are:
* Linux does not support cross compiling or compiling for multiple architectures, so this has not been implemented.
* Linux has no add2app.
The assets copying is done in the install-phase of the CMake build of a flutter app.
CMake requires the native assets folder to exist, so we create it also when the feature is disabled or there are no assets.
### Tests
This PR adds new tests to cover the various use cases.
* packages/flutter_tools/test/general.shard/linux/native_assets_test.dart
* Unit tests the Linux-specific part of building native assets.
It also extends various existing tests:
* packages/flutter_tools/test/integration.shard/native_assets_test.dart
* Runs (incl hot reload/hot restart), builds, builds frameworks for Linux and flutter-tester.
Xcode uses the CONFIGURATION_BUILD_DIR build setting to determine the location of the bundle to build and install. When launching an app via Xcode with the Xcode debug workflow (for iOS 17 physical devices), temporarily set the CONFIGURATION_BUILD_DIR to the location of the bundle so Xcode can find it.
Also, added a Xcode Debug version of the `microbenchmarks_ios` integration test since it uses `flutter run --profile` without using `--use-application-binary`.
Fixes https://github.com/flutter/flutter/issues/134186.
<!-- meta-tags: To be used by the automation script only, DO NOT MODIFY.
{
"name": "Windows module_custom_host_app_name_test"
}
-->
Issue link: https://github.com/flutter/flutter/issues/134644
<!-- meta-tags: To be used by the automation script only, DO NOT MODIFY.
{
"name": "Windows_android channels_integration_test_win"
}
-->
Issue link: https://github.com/flutter/flutter/issues/134636
Support for FFI calls with `@Native external` functions through Native assets on MacOS and iOS. This enables bundling native code without any build-system boilerplate code.
For more info see:
* https://github.com/flutter/flutter/issues/129757
### Implementation details for MacOS and iOS.
Dylibs are bundled by (1) making them fat binaries if multiple architectures are targeted, (2) code signing these, and (3) copying them to the frameworks folder. These steps are done manual rather than via CocoaPods. CocoaPods would have done the same steps, but (a) needs the dylibs to be there before the `xcodebuild` invocation (we could trick it, by having a minimal dylib in the place and replace it during the build process, that works), and (b) can't deal with having no dylibs to be bundled (we'd have to bundle a dummy dylib or include some dummy C code in the build file).
The dylibs are build as a new target inside flutter assemble, as that is the moment we know what build-mode and architecture to target.
The mapping from asset id to dylib-path is passed in to every kernel compilation path. The interesting case is hot-restart where the initial kernel file is compiled by the "inner" flutter assemble, while after hot restart the "outer" flutter run compiled kernel file is pushed to the device. Both kernel files need to contain the mapping. The "inner" flutter assemble gets its mapping from the NativeAssets target which builds the native assets. The "outer" flutter run get its mapping from a dry-run invocation. Since this hot restart can be used for multiple target devices (`flutter run -d all`) it contains the mapping for all known targets.
### Example vs template
The PR includes a new template that uses the new native assets in a package and has an app importing that. Separate discussion in: https://github.com/flutter/flutter/issues/131209.
### Tests
This PR adds new tests to cover the various use cases.
* dev/devicelab/bin/tasks/native_assets_ios.dart
* Runs an example app with native assets in all build modes, doing hot reload and hot restart in debug mode.
* dev/devicelab/bin/tasks/native_assets_ios_simulator.dart
* Runs an example app with native assets, doing hot reload and hot restart.
* packages/flutter_tools/test/integration.shard/native_assets_test.dart
* Runs (incl hot reload/hot restart), builds, builds frameworks for iOS, MacOS and flutter-tester.
* packages/flutter_tools/test/general.shard/build_system/targets/native_assets_test.dart
* Unit tests the new Target in the backend.
* packages/flutter_tools/test/general.shard/ios/native_assets_test.dart
* packages/flutter_tools/test/general.shard/macos/native_assets_test.dart
* Unit tests the native assets being packaged on a iOS/MacOS build.
It also extends various existing tests:
* dev/devicelab/bin/tasks/module_test_ios.dart
* Exercises the add2app scenario.
* packages/flutter_tools/test/general.shard/features_test.dart
* Unit test the new feature flag.
Fixes https://github.com/flutter/flutter/issues/89683.
The changes to `getFlutterView` in `FlutterDeviceScreenshot` are the fix that was required, everything else was done to get tests running (such as re-generating some lockfiles and modifying the android manifest).
The code was all currently not unit tested, and there were no other easy examples to base these java unit tests off in flutter/flutter, so let me know if this approach to testing is wrong.
Adds the first Windows Arm64 devicelab test. The builder for this test won't be created until after this lands on master, so we can't actually test this until this is merged.
Enable Impeller benchmarks for drawAtlas/drawVertices on iOS/Metal, Android/GLES, and Android/Vulkan.
Enable impeller tessellation benchmarks on iOS/Metal and Android/Vulkan - not GLES as this is measuring backend agnostic performance.
Temporarily removes Xcode debug tests.
Xcode tests are currently failing in CI for some infra-related issues. I have a fix for it (https://github.com/flutter/flutter/pull/132318) that I confirmed worked in presubmit, but I think the logic is better suited to live in recipes. However, it's going to be a bit of a learning curve to update recipes and might take me a couple days so disabling them in the meantime.
Tracking issue to readd when ready: https://github.com/flutter/flutter/issues/132309
This PR includes the following changes. These changes only apply to iOS 17 physical devices.
| Command | Change Description | Changes to User Experience |
| ------------- | ------------- | ------------- |
| `flutter run --release` | Uses `devicectl` to install and launch application in release mode. | No change. |
| `flutter run` | Uses Xcode via automation scripting to run application in debug and profile mode. | Xcode will be opened in the background. Errors/crashes may be caught in Xcode and therefore may not show in terminal. |
| `flutter run --use-application-binary=xxxx` | Creates temporary empty Xcode project and use Xcode to run via automation scripting in debug and profile. | Xcode will be opened in the background. Errors/crashes may be caught in Xcode and therefore may not show in terminal. |
| `flutter install` | Uses `devicectl` to check installed apps, install app, uninstall app. | No change. |
| `flutter screenshot` | Will return error. | Will return error. |
Other changes include:
* Using `devicectl` to get information about the device
* Using `idevicesyslog` and Dart VM logging for device logs
Note:
Xcode automation scripting (used in `flutter run` for debug and profile) does not work in a headless (without a UI) interface. No known workaround.
Fixes https://github.com/flutter/flutter/issues/128827, https://github.com/flutter/flutter/issues/128531.
In order to avoid new tasks from not being scheduled we are not going to backfill the autoroller because it can sometimes play transactions out of order causing issues with tasks that are scheduled but not known.
*List which issues are fixed by this PR. You must list at least one issue.*
Part of https://github.com/flutter/flutter/issues/127063
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
I deleted the target mentioned in the issue listed below. This is my first time contributing to open source please explain if I did anything wrong in the process or wrong with the changes.
Best
*List which issues are fixed by this PR. You must list at least one issue.*
Resolves [#126278](https://github.com/flutter/flutter/issues/126278)
Fixes:
- https://github.com/flutter/flutter/issues/131327
It was observed that the tests would hit their 30 minute timeout so this PR adds another shard to reduce how many tests are run per shard to reduce test run time
`ios_app_with_extensions_test` only builds the artifact, it does not need a device to run.
This PR adds the copies of these tests to run hostonly. When the new tests pass in post submit, we should remove the old ones.
We've decided to use the `--omit-type-checks` flag for our dart2wasm benchmarks. Right now, many of the benchmark results are dominated by type checks and most of what we are actually trying to measure get drowned out in the noise.
Alternative to https://github.com/flutter/flutter/pull/130868
Oriole is the Pixel 6, Panther is the Pixel 7. Panther is more available in FTL at this point.
There's less value in running this on presubmit, since those can spawn many jobs multiple times over as people push new commits to branches. Let's just run it post submit to avoid overloading the capacity of FTL.
MInor cleanup to remove the use_emulator flag as adding the virtual device is enough to signal use of an emulator.
Land after https://flutter-review.googlesource.com/c/recipes/+/47341
*List which issues are fixed by this PR. You must list at least one issue.*
Fixes https://github.com/flutter/flutter/issues/130522
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
Fixes https://github.com/flutter/flutter/issues/129744
This change:
1. re-enables the Linux packages_autoroller
2. ensures we redact the token from appearing in any logs (in local testing I realized some failure logs might still expose the token)
What actually fixed authentication however was creating and uploading a new GitHub personal access token, not this change.
It's currently failing post-submit because being marked `bringup` it is running in the try pool, which does not have permissions to access the cloud KMS. However, I ran a LED build in the prod pool that succeeded:
3a8f128c35/+/build.proto?server=chromium-swarm.appspot.com
Even after updating the account (and the cloudKMS GitHub token), when
the bot tries to push to
https://github.com/flutter-pub-roller-bot/flutter, it gets a 403, which
probably means authentication failed. I will have to investigate next
week.
```
Exception: GitException: Exception on command "push https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git packages-autoroller-branch-1:packages-autoroller-branch-1": Command "git push https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git packages-autoroller-branch-1:packages-autoroller-branch-1" failed in directory "/b/s/w/ir/x/w/flutter_conductor_checkouts/framework" to update the release branch with the commit. Git exited with error code 128.
stderr from git:
16:33:21.199510 exec-cmd.c:90 trace: resolved executable path from procfs: /b/s/w/ir/cipd_bin_packages/bin/git
16:33:21.199587 exec-cmd.c:237 trace: resolved executable dir: /b/s/w/ir/cipd_bin_packages/bin
16:33:21.200155 git.c:460 trace: built-in: git push https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git packages-autoroller-branch-1:packages-autoroller-branch-1
16:33:21.200542 run-command.c:655 trace: run_command: GIT_DIR=.git git remote-https https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git
16:33:21.201787 exec-cmd.c:90 trace: resolved executable path from procfs: /b/s/w/ir/cipd_bin_packages/libexec/git-core/git
16:33:21.201845 exec-cmd.c:237 trace: resolved executable dir: /b/s/w/ir/cipd_bin_packages/libexec/git-core
16:33:21.202175 git.c:750 trace: exec: git-remote-https https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git
16:33:21.202195 run-command.c:655 trace: run_command: git-remote-https https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git https://[GitHub TOKEN]@github.com/flutter-pub-roller-bot/flutter.git
16:33:21.203510 exec-cmd.c:90 trace: resolved executable path from procfs: /b/s/w/ir/cipd_bin_packages/libexec/git-core/git-remote-http
16:33:21.203567 exec-cmd.c:237 trace: resolved executable dir: /b/s/w/ir/cipd_bin_packages/libexec/git-core
remote: Permission to flutter-pub-roller-bot/flutter.git denied to flutter-pub-roller-bot.
fatal: unable to access 'https://github.com/flutter-pub-roller-bot/flutter.git/': The requested URL returned error: 403
```
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20packages_autoroller/6031/overview
This is still being tracked in
https://github.com/flutter/flutter/issues/129744
This enables benchmarks for the Skwasm renderer, compiled with
dart2wasm.
Platform views aren't supported in Skwasm yet, so we are skipping those
benchmarks for now.
This is a follow-up to aa0a1a7ae1. I was forced to mark these targets bringup in that PR because the targets were technically new (since each name changed 3 -> 4), so this is marking them non-bringup.
With https://flutter-review.googlesource.com/c/recipes/+/42160, we are
ready to make all tests consistent with xcode 14c18.
> auto label is removed for flutter/flutter, pr: 125211, due to This PR has not met approval requirements for merging. Changes were requested by {jmagman}, please make the needed changes and resubmit this PR. You have project association MEMBER and need 1 more review(s) in order to merge this PR.
>
> * Merge guidelines: You need at least one approved review if you are already a MEMBER or two member reviews if you are not a MEMBER before re-applying the autosubmit label. **Reviewers**: If you left a comment approving, please use the "approve" review action instead.
Sounds an auto-submit bug. Manually submit.
Adds a macOS implementation of the platform_channel example,
demonstrating method channels and event channels with a battery power
plugin.
Adds platform_channel_sample_test_macos macOS host test to verify the
sample works.
Issue: https://github.com/flutter/flutter/issues/79204
* Add Linux unit tests to plugin template
Adds an example native unit test to the plugin template for Linux,
matching the structure we use for our 1P plugin unit tests. Once these
have been added for all platforms+languages, they will be documented on
a new plugin development page to explain their use.
While ideally we would adjust the engine APIs first to allow for testing
the method call handler directly, it's unclear when we will have time
for that work, and for a complex plugin most of the testing wouldn't be
at that layer anyway, so having the structure in place with the
limitations documented is still a significant improvement over having
nothing in the template.
Part of https://github.com/flutter/flutter/issues/82458
* Add creation test
* Add integration tests
* Missing newlines
* test owner
* Typo
* Added integration test for wide gamut support.
* cleaned up
* deleted files that can be generated
* switched back to standard flutter in the shell script
* added devicelab task
* removed analysis options
* analyzer
* Fixed task
* made local_run.sh not executable
* analyzer
* removed the logo asset
* added task to ci
* updated pubspec
* analysis errors fixed
* updated pubspec
These tests try to use a commit contemporary to the framework commit in
customer repositories. This won't work because a CP to the framework
release candidate branch may be recent even though the release candidate
branch can be months old.
* Round 2 with dimensions
* Try with stringified keys
* Forgot a comma
* trying a list of maps.
* Try key value pairs
* Try with kvm only
* try with swarming_dimensions
* Updated with fix in swarming.star
* Attempting to remove the bring up property to verify test is running.
* Remove android from target tags to avoid adb command automatically running in test_utils call.
* Remove the duplicated dependencies in the defines target that exist in the platform
* Run Mac hostonly presubmit tests on any available arch
* Force all Mac tests to run on arm64 to validate in presubmit
* Go back to web tests on x64
* Run plugin_test_ios on x64
* Try Chrome 110 on arm
* Revert chrome bump, remove forcing arm64
* Update issue number
* Add Windows unit tests to plugin template
Adds an example native unit test to the plugin template for Windows,
matching the format we use for our 1P plugin example app unit tests.
Once these have been added for all platforms+languages, they will be
documented on a new plugin development page to explain their use.
Since we don't appear to be running our current plugin e2e tests for
Windows, this adds a new configuration to run them. I haven't
`led`-tested this, so it may not work, but this will give a starting
point for getting them running.
Part of https://github.com/flutter/flutter/issues/82458
* Minor fix
* Add test owner
* Fix typo
* Fix test feature flag
* Round 2 with dimensions
* Try with stringified keys
* Forgot a comma
* trying a list of maps.
* Try key value pairs
* Try with kvm only
* try with swarming_dimensions
* Updated with fix in swarming.star
* Update android defines test to use emulator
* Need strings in dimensions.
* put dimensions in the wrong spot.
* Add bringup.
* See if the test runs with Linux_android
* Adjusting dimensions
* Dimension fields must be strings.
* Making dimensions a dict.
* Try with swarming.dimension
* The dimension set does not appear to do anything.
* Device type none
* Made target presubmit
* Dimensions again
* Fixed formatting.
* Update since flutter roller fails
* Add new macos target configured for flavors
* Rename Free App copy-Info.plist to Free App Info.plist
* Remove bogus entitlements
* Remove Generated.xcconfig
* Audit project.pbxproj
* Remove unused configs
* share one info.plist
* Modify scheme so that paid app works
* Codesign automatic
* Pipe flavor as scheme into xcodebuild
* Ignore incoming flavor string
* pipe flavor for flutter run to work
* Add devicelab tests
* Error if host and target device are same for flutter install desktop
* Avoid bang (!) by promoting a local.
Co-authored-by: Jenn Magder <magder@google.com>
* Add supportsInstall property
* Override in test classes
* Add install test on macOS
* Refactor application_package and add tests for package directory
Co-authored-by: a-wallen <stephenwallen@google.com>
Co-authored-by: Jenn Magder <magder@google.com>
* Add new task runner for impeller enabled complex layout test
* Add new target in .ci.yaml
* Claim ownership of complex_layout_scroll_perf_impeller_macos__timeline_summary
* Task runner for non-impeller enabled scroll test
* Add test target for non impeller complex layout scroll
* claim ownership of the last target
* mark as bringup
Co-authored-by: a-wallen <stephenwallen@google.com>
* Add new task runner for animated_complex_opacity_perf_impeller e2e_summary on macos
* Register new target for macos e2e_summary task
* Claim ownership in TESTOWNERS
* Add task runner for animated complex opacity without impeller
* Register new target in .ci.yaml for non-impeller test
* Claim ownership of non-impeller task
Co-authored-by: a-wallen <stephenwallen@google.com>
* Testing whether emulator is possible.
* Adding changes to see if emulator can be used from recipe.
* adding emulator support.
* Add the emulator flag for testing.
* Using string for boolean since it cannot be parsed in properties
* Checking to see if these changes are being used.
* Updated bool back to string
* Remove trailing whitespace from file.