- 10 Sep, 2023 1 commit
-
-
Daco Harkes authored
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.
-
- 10 Aug, 2023 1 commit
-
-
Christopher Fujino authored
Fixes: https://github.com/flutter/flutter/issues/124970 Part of https://github.com/flutter/flutter/issues/47161 Before this change, there were two places we overrode the `Artifacts` in a Zone: 1. if/when we parse local-engine CLI options: https://github.com/flutter/flutter/blob/1cf3907407cbc91be7cec2c38b348a2d66041dd5/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart#L281 2. an additional override for fuchsia platform dill (no longer used, deleted in this PR): https://github.com/flutter/flutter/blob/1cf3907407cbc91be7cec2c38b348a2d66041dd5/packages/flutter_tools/lib/src/commands/attach.dart#L274 Note 1 above creates a new instance of `Artifacts.getLocalEngine()`. In this flow, there exist two instances of `Artifacts`: 1. The default fallback instance of `CachedArtifacts` (which gets all artifacts from flutter/bin/cache), instantiated in context_runner.dart: https://github.com/flutter/flutter/blob/1cf3907407cbc91be7cec2c38b348a2d66041dd5/packages/flutter_tools/lib/src/context_runner.dart#L137 2. An instance of `CachedLocalEngineArtifacts` created in the command runner once the CLI options have been parsed: https://github.com/flutter/flutter/blob/1cf3907407cbc91be7cec2c38b348a2d66041dd5/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart#L281 The regression happened when we direct injected the Artifacts 1 from above BEFORE we parsed the local-engine flag, and then used this in the second zone override, and then when creating the `FlutterDevice` there are multiple calls to `globals.artifacts` returned it when it should have returned Artifacts 2: https://github.com/flutter/flutter/blob/1cf3907407cbc91be7cec2c38b348a2d66041dd5/packages/flutter_tools/lib/src/resident_runner.dart#L80 Device.artifactOverrides was originally introduced in https://github.com/flutter/flutter/pull/32071, but is no longer used, so I deleted it. I also removed direct injection of `Artifacts` to the attach sub-command, because that class now no longer references artifacts. I believe the ideal true fix for this would be to: 1. Migrate all leaf calls to `globals.artifacts` to use direct injection (in this case, the offending invocations were in [`FlutterDevice.create()`](https://github.com/flutter/flutter/blob/1cf3907407cbc91be7cec2c38b348a2d66041dd5/packages/flutter_tools/lib/src/resident_runner.dart#L80-L218), but I'm not sure that something else would not have broken later) 2. Ensure we are always direct injecting the desired instance of `Artifacts`--that is, if the user desires local engine artifacts, that we are passing an instance of `CachedLocalEngineArtifacts`. a. Alternatively, and probably simpler, teach `CachedArtifacts` to know about the local engine. This would mean parsing the global CLI options BEFORE we ever construct any instance of `Artifacts`. As an overall recommendation for implementing https://github.com/flutter/flutter/issues/47161, in the overall tree of tool function calls, we should probably migrate the leaves first (that is, migrate the sub-commands last). We should also audit and reconsider any usage of `runZoned()` or `context.run()` for the purpose overriding zoneValues.
-
- 08 Jun, 2023 1 commit
-
-
Tess Strickland authored
This PR adds uses of the `--target-os` command line argument when building kernel sources for precompiled applications for supported target operating systems. The Dart CFE then: * treats `Platform.operatingSystem` as if it were defined as the constant string provided as an argument to the flag, * treats `Platform.pathSeparator` as the appropriate separator for that operating system, * attempts to constant evaluate the initializer for any field annotated with the `vm:platform-const` pragma, and * attempts to constant evaluate all calls to a method annotated with the `vm:platform-const` pragma. The `vm:platform-const` pragma can appear in either library or user code. If the attempt to constant evaluate the field initializer or method call fails, then an error is thrown at kernel compilation time. Addresses #14233. The tests in `packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart` have been adjusted properly to account for the new passed command line arguments.
-
- 07 Jun, 2023 1 commit
-
-
Alexander Aprelev authored
Roll to engine to 4f4486b00be28183b482bbb74bbed25f4db153fe pick up dart to 3.1.0-169.0.dev. Changes since last roll ``` 4f4486b00b Roll dart to 3.1.0-169.0.dev (#42602) ``` Manual roll since rolling to dart 3.1.0-169.0.dev requires patching to expression evaluation in flutter tools
-
- 19 May, 2023 1 commit
-
-
Phil Quitslund authored
The upcoming linter release notices null literals as unnecessary argument values and flags more `type_literal_in_constant_pattern` cases. See breakages: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8780744067138629361/+/u/analyze_flutter_flutter/stdout
-
- 16 May, 2023 1 commit
-
-
Michael Goderbauer authored
-
- 14 Apr, 2023 1 commit
-
-
Kevin Moore authored
flutter-tool: enum cleanup
-
- 22 Mar, 2023 1 commit
-
-
Michael Goderbauer authored
Remove 1745 decorative breaks
-
- 23 Jan, 2023 1 commit
-
-
Michael Goderbauer authored
* dart fix --apply * manual fixes * fix after merge conflicts * review
-
- 20 Jan, 2023 1 commit
-
-
Alexander Markov authored
-
- 02 Dec, 2022 1 commit
-
-
Jackson Gardner authored
You can now specify a --local-web-sdk flag to point to a wasm_release folder. This will make it so that only artifacts that pertain to the web sdk are overridden to point to the wasm_release folder. Other artifacts (such as impellerc) will pull from the cache, or from the --local-engine path if that is specified. This also uses precompiled platform kernel files for both ddc and dart2js
-
- 13 Nov, 2022 1 commit
-
-
Jonah Williams authored
Revert "[web] Add `--local-web-sdk` flag and use precompiled platform kernels for dart2js and ddc (#114639)" (#115242) This reverts commit 0e9ee367.
-
- 12 Nov, 2022 1 commit
-
-
Jackson Gardner authored
* Dart2JS build step looks for compiled platform binaries. * Use new locations of platform binaries. * Added --local-web-sdk command line flag. * Need to use the matching frontend server when doing ddc stuff. * Update packages/flutter_tools/lib/src/test/web_test_compiler.dart Co-authored-by:
Mouad Debbar <mouad.debbar@gmail.com> * Update packages/flutter_tools/lib/src/runner/flutter_command_runner.dart Co-authored-by:
Mouad Debbar <mouad.debbar@gmail.com> * Formatting issues. * Need to use URI format for platform dill. * Fix resident runner tests. * Fix analysis issue. * Fix and add unit tests. * Add some useful comments. * Refine doc comments for flags. Co-authored-by:
Mouad Debbar <mouad.debbar@gmail.com>
-
- 26 Oct, 2022 1 commit
-
-
Jackson Gardner authored
-
- 19 Aug, 2022 1 commit
-
-
Anna Gringauze authored
The flag is true by default so the behavior does not change. Next steps: Use the flag for updated debugger module names: - Frontend server: make the current behavior controlled by the flag non-conditional - Frontend server: add more debugging names changes under the same flag, false by default - Dwds: make changes required for the new module names. - Flutter tools: when matching dwds changes roll to flutter, pass the flag to the frontend server again. - Cleanup: - Frontend server: make new behavior default - Flutter tools: remove uses of the flag. - Frontend server: remove the flag. Towards: https://github.com/dart-lang/webdev/issues/1692 Helps: https://github.com/flutter/flutter/issues/106727
-
- 20 Jul, 2022 1 commit
-
-
Lau Ching Jun authored
-
- 18 Jul, 2022 1 commit
-
-
Christopher Fujino authored
Revert "Read dart_plugin_registrant path from FlutterProject to support non-standard path." (#107850)
-
- 15 Jul, 2022 1 commit
-
-
Lau Ching Jun authored
-
- 07 Jul, 2022 1 commit
-
-
Alexander Aprelev authored
* Ensure build is done in incremental mode. This allows for faster bootstrapping of the compiler from previously created dill file. Fixes https://github.com/flutter/flutter/issues/107183 * Avoid initializeFromDill in aot mode * Update tests
-
- 20 May, 2022 1 commit
-
-
Zachary Anderson authored
-
- 18 May, 2022 1 commit
-
-
Jonah Williams authored
-
- 31 Mar, 2022 1 commit
-
-
Michael Goderbauer authored
-
- 29 Mar, 2022 1 commit
-
-
gaaclarke authored
-
- 21 Mar, 2022 1 commit
-
-
gaaclarke authored
-
- 09 Mar, 2022 1 commit
-
-
Lau Ching Jun authored
-
- 02 Mar, 2022 1 commit
-
-
gaaclarke authored
* Starts using the `--source` flag to compile the dart registrant. * updated general.shard tests * Fixed the resident compiler flow * added integration test * made the integration test self contained * renamed generated_main to dart_plugin_registrant * cleaned up for review * added task runner for ci * added bringup and TESTOWNERS * updated failure message
-
- 03 Feb, 2022 1 commit
-
-
Jonah Williams authored
-
- 14 Jan, 2022 1 commit
-
-
Jonah Williams authored
-
- 08 Oct, 2021 3 commits
-
-
Ian Hickson authored
-
Zachary Anderson authored
This reverts commit 5fd259be.
-
Ian Hickson authored
-
- 06 Oct, 2021 1 commit
-
-
Jenn Magder authored
-
- 02 Oct, 2021 1 commit
-
-
Christopher Fujino authored
-
- 01 Oct, 2021 1 commit
-
-
stuartmorgan authored
Building an application for a desktop platform that transitively included any Dart-based plugins (such as path_provider) broke `flutter test`, because its compilation was overriding the provided main (in this case, the test main) with `generated_main.dart` if it was present. This PR: - Changes the `flutter test` compilation path to update `generated_main.dart`, so that the tests will work, and will include any registered Dart plugins. - Makes using `generated_main.dart` during recompile opt-in, to try to reduce the chance of a similar bug happening with other codepaths in the future. Fixes https://github.com/flutter/flutter/issues/88794
-
- 23 Aug, 2021 1 commit
-
-
Jonah Williams authored
-
- 15 Jul, 2021 1 commit
-
-
Lau Ching Jun authored
-
- 01 Jun, 2021 1 commit
-
-
Alexandre Ardhuin authored
-
- 24 May, 2021 1 commit
-
-
Jenn Magder authored
-
- 07 May, 2021 1 commit
-
-
Alexandre Ardhuin authored
-
- 23 Apr, 2021 1 commit
-
-
Emmanuel Garcia authored
-