Roll dart to 470117150f34d712ee6d8c4558b3c656d973f656
Changes since last roll
```
470117150f3 Version 3.7.0-208.0.dev
10867627709 CHANGELOG: move AOT invocation bits to the end of the 3.7 section
83863711d3b Migrate NotImportedCompletionPass.
e01bbdfd1f4 Deprecate completions from plugins api.
2a2905228fb Add extension on Completer to simplify code.
05696d50ccf Migrate postfix_completion.dart, statement_completion.dart.
ed49d04e2e0 [analysis_server] Extract some shared code from editableArguments to be used by editArgument
c54255fe9db [element model] migrate `prefer_asserts_in_initializer_lists`
eaf3912b5d6 [deps] rev core, ecosystem, glob, http_multi_server, lints, markdown, package_config, pool, protobuf, pub_semver, shelf, source_maps, source_span, stack_trace, stream_channel, string_scanner, sync_http, term_glyph, test, test_descriptor, test_process, test_reflective_loader, tools, vector_math, watcher, web, web_socket_channel, webdriver, webkit_inspection_protocol, yaml, yaml_edit
11a11259724 Switch boringssl to the pre-generated GN source list.
a635ccf2f57 [analysis_server] Only mark positional arguments as editable if they wouldn't require inserting additional values
619c8511aba [analysis_server] Add tests for formatter language version for legacy protocol
a8f5e64a330 Roll Fuchsia Test Scripts from 6FgM4KTbxxmyYoiOs... to VilXq4eGH5A24wRWA...
623c574b817 [vm] Clean up few isolate fields.
bfb507a3af9 Migrate utilities.dart
06caa3fa11e [DAS] Adds new import with show option
0197beaa8e0 [flow analysis] Remove _typeContains method.
56b6e5b9f60 Json codable no type assumption in custom fromJson
e013a4c9bfa [analysis_server] Add some notes on how to use the CPU Profiler for the analysis server hosted by VS Code
0f723b3ef3c [vm] Fix build on gcc 14.2.0.
```
This is manual roll because dart_boringssl_gen_rev is no longer present
in dart sdk DEPS has to be removed from flutter engine DEPS manually.
fml::scoped_nsobject and fml::scoped_nsprotocol classes are no longer
necessary now that the entire codebase has been migrated to ARC.
This also eliminates the fml_arc_unittests target which tests that code.
All references to that target in documentation, run_tests.py have been
removed. This target was used in various `et` build/query unit tests and
has been replaced with the fml_unittests target in those cases.
Issue: https://github.com/flutter/flutter/issues/137801
Closes https://github.com/flutter/flutter/issues/157945.
```sh
% et cleanup --dry-run
Checking /Users/matanl/Developer/engine/src/out...
The following directories were accessed later than 2024-10-02:
android_debug
android_debug_arm64
android_debug_unopt
android_debug_unopt_arm64_ide
host_debug_unopt_arm64_ide
ios_debug
ios_debug_sim_unopt_arm64
ios_debug_unopt
ios_debug_unopt_arm64
license_script_output
wasm_release
web_tests
Run without --dry-run to reclaim 2.79gb.
```
```sh
flutter % et cleanup
Checking /Users/matanl/Developer/engine/src/out...
Deleted 12 output directories and reclaimed 2.79gb.
```
This attempts to reland the single-threaded Skwasm PR: https://github.com/flutter/engine/pull/56206
The main changes here are in the second commit:
* We need to actually bundle the `skwasm_st` artifacts in `flutter_web_sdk.zip`
* The `locateFile` hack no longer works since emscripten doesn't actually create a worker.js file anymore. So instead, that has been modified to use the `mainScriptUrlOrBlob` module API to do a very similar hack.
Note: I did presubmit testing with the framework CI and it appears the pertinent tests pass. See https://github.com/flutter/flutter/pull/157967
Closes https://github.com/flutter/flutter/issues/157870.
Looks a lot better - I even noticed a few places where I was doing
unnecessary (copy/pasted) configuration.
> `1 file changed, 240 insertions(+), 768 deletions(-)`
Reverts: flutter/engine#56206
Initiated by: jonahwilliams
Reason for reverting: failing to roll into framework: https://github.com/flutter/flutter/pull/157919
Original PR Author: eyebrowsoffire
Reviewed By: {harryterkelsen}
This change reverts the following previous change:
This PR creates a single-threaded version of the skwasm renderer, appropriate for non-crossOriginIsolated browsing contexts.
* The single threaded renderer is essentially the same as the multi-threaded renderer, except instead of spawning a web worker and posting messages to it, it simply schedules microtasks on the main thread in their place.
* The new renderer is vended as `skwasm_st.js` and `skwasm_st.wasm` in the same location as multithreaded skwasm. In order to properly build and function, we needed some fixes I put into emscripten that landed in version 3.1.70. That version also changed some behavior that required a few fixes to the CanvasKit build files.
* The skwasm loader in flutter.js has been modified to use the skwasm_st variants when encountering a non-crossOriginIsolated context but a browser and configuration that otherwise would allow the use of skwasm. I also added a new `forceSingleThreadedSkwasm` option to the flutter configuration so that we can override this behavior, especially so that we can accurately benchmark the single threaded renderer in a crossOriginIsolated environment.
* I also consolidated a bunch of our shards that run tests to just have one per browser/platform combination, so four total. This will address https://github.com/flutter/flutter/issues/124682
This PR creates a single-threaded version of the skwasm renderer, appropriate for non-crossOriginIsolated browsing contexts.
* The single threaded renderer is essentially the same as the multi-threaded renderer, except instead of spawning a web worker and posting messages to it, it simply schedules microtasks on the main thread in their place.
* The new renderer is vended as `skwasm_st.js` and `skwasm_st.wasm` in the same location as multithreaded skwasm. In order to properly build and function, we needed some fixes I put into emscripten that landed in version 3.1.70. That version also changed some behavior that required a few fixes to the CanvasKit build files.
* The skwasm loader in flutter.js has been modified to use the skwasm_st variants when encountering a non-crossOriginIsolated context but a browser and configuration that otherwise would allow the use of skwasm. I also added a new `forceSingleThreadedSkwasm` option to the flutter configuration so that we can override this behavior, especially so that we can accurately benchmark the single threaded renderer in a crossOriginIsolated environment.
* I also consolidated a bunch of our shards that run tests to just have one per browser/platform combination, so four total. This will address https://github.com/flutter/flutter/issues/124682
Closes https://github.com/flutter/flutter/issues/156909.
This PR adds (and implements) the `--gn-args` (extra command-line GN args) functionality by generalizing on the concept of "merged" GN args that @zanderso had special-cased for `--lto` and `--rbe`, and further testing it.
There is also a logical place for us to expand support of merged arguments at a future point in time.
Redo: https://github.com/flutter/engine/pull/55832
See the diff of diffs,
```
diff <(curl -s '1cd59a0c06.diff') <(curl -s 'ccea3b80cc.diff')
```
Or
```
48c48
< index 5258466145387..83aebdaacd9b6 100755
---
> index 5258466145387..3f74d19640d0f 100755
141,142c141,142
< + far_file = '%s_%s%s_runner-0.far' % (runner_type, mode, '_product' if product else '')
< + CopyPath('%s/%s' % (source_root, far_file), '%s/%s' % (destination, far_file))
---
> + far_file = '%s_%s%s_runner' % (runner_type, mode, '_product' if product else '')
> + CopyPath('%s/%s-0.far' % (source_root, far_file), '%s/%s.far' % (destination, far_file))
```
This change restores the files' -0 suffix which was wrongly removed in the last iteration.
=== Description of the original change:
This change removes the in-house built pm-based build rules in favor of the high level fuchsia_component / fuchsia_package in the gn-sdk.
Also the use of pm in build_fuchsia_artifacts.py is removed as the placements of the binaries changed.
https://github.com/flutter/engine/pull/55445 was a previous attempt and it generates [a malformatted cipd](https://chrome-infra-packages.appspot.com/p/flutter/fuchsia/+/vU1Op26qgO5XYs9S8AqQMvBwgITD9hq3-2dIu2H5-iwC).
Bug: http://b/353729557, http://b/368608542
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Reverts: flutter/engine#55445
Initiated by: zijiehe-google-com
Reason for reverting: This change would break the build_fuchsia_artifacts.py without https://github.com/flutter/engine/pull/55832/files. I'd merge two into one.
Original PR Author: zijiehe-google-com
Reviewed By: {jrwang}
This change reverts the following previous change:
This change removes the in-house built pm-based build rules in favor of the high level fuchsia_component / fuchsia_package in the gn-sdk.
The build_fuchsia_artifacts.py is still using pm, and it will be handled in a following change.
Bug: http://b/353729557, http://b/368608542
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Closes https://github.com/flutter/flutter/issues/156260.
Fixes the degenerate case where you specify an unrecognized target, and it falls back to rebuilding the entire engine as if you specified nothing. In addition, added recognition of `group`.
Closes https://github.com/flutter/flutter/issues/148444 (code de-duplicated).
Closes https://github.com/flutter/flutter/issues/150877 (`--build-strategy=local`).
Closes https://github.com/flutter/flutter/issues/150884 (`--build-strategy=remote`).
Replaces duplicate code across ~3 commands (query, test, build) with a class called `BuildPlan`, which encapsulates (a) concurrency, (b) build configuration, (c) RBE, (d) LTO, and (e) build strategy. I also moved all of the validation of the build plan into `build_plan_test`, which gives us better coverage at a lower cost (less things to think about in that suite of tests).
I know the diff looks scary, but 1K of the 1.4K is tests.
/cc @gaaclarke @flar
`build`, `test`, and `run` commands all support the `--exec-strategy`
flag ('auto', 'local', 'remote').
This flag controls the RBE task execution strategy (when RBE is
enabled).
Closes#150877
Work towards https://github.com/flutter/flutter/issues/147013.
I think I still need applicable metadata about the output, and then make
sure `et test` understands everything:
```sh
% et test //flutter/tools/engine_tool/...
[2024-10-03 13:26:42.657137] ERROR: No test targets found
```
Does a few things:
- Refactors `run_command_test` significantly to reduce global fixtures
- Replaced stringly-typed things with enum-like objects
- Adds a lot stronger coverage for `run_command` to make future refactors safer
- Takes advantage of `package:test` having a workable matchers system and uses it
- Changes `return 1` into `throw FatalError(...)` where it makes sense in `run_command`
As a result of the refactoring work, I also fixed a bug: Closes https://github.com/flutter/flutter/issues/147646.
The logical "part 2.5" of the work started in https://github.com/flutter/engine/pull/55540.
Test output does not change, the tests just no longer rely on the global `fixtures.dart` data.
The logical "part 2" of the work started in https://github.com/flutter/engine/pull/55540.
Test output does not change, the tests just no longer rely on the global `fixtures.dart` data.
Partial work towards https://github.com/flutter/flutter/issues/148420, unblocks https://github.com/flutter/engine/pull/55537.
These tests can now be more precise, and changing the fixtures no longer has side-effects on tests across the entire repository. There are about 11 other usages (there were ~50 in these) after this PR that I'll get to, as well as the hard-coded `gn desc` output, before retiring `fixtures.dart`
Closes https://github.com/flutter/flutter/issues/155769.
This is a variant of the approach in https://github.com/flutter/engine/pull/52241, based on feedback from @jakemac53 and @jonahwilliams (who originally sped up `dart test` significantly by using `frontend_server` under the scenes: https://github.com/dart-lang/test/pull/1399), in short:
```gn
# tools/engine_tool/BUILD.gn
import("//flutter/build/dart/internal/gen_dartcli_call.gni")
gen_dartcli_call("tests") {
args = [ "test" ]
cwd = "//flutter/tools/engine_tool"
}
```
This stanza, when built (`ninja -C ../out/host_debug flutter/tools/engine_tool:tests`) generates the following file:
```sh
# ../out/host_debug/gen/flutter/tools/engine_tool/tests
set -e
# Needed because if it is set, cd may print the path it changed to.
unset CDPATH
# Store the current working directory.
prev_cwd=$(pwd)
# Set a trap to restore the working directory.
trap 'cd "$prev_cwd"' EXIT
CD_PATH="/Users/matanl/Developer/engine/src/flutter/tools/engine_tool"
if [ -n "$CD_PATH" ]; then
cd "$CD_PATH"
fi
/Users/matanl/Developer/engine/src/flutter/prebuilts/macos-arm64/dart-sdk/bin/dart "test"
```
In turn, when executed (`../out/host_debug/gen/flutter/tools/engine_tool/tests`) it just runs `dart test`:
```sh
flutter % ../out/host_debug/gen/flutter/tools/engine_tool/tests
Building package executable...
Built test:test.
00:00 +0: test/test_command_test.dart: test command executes test
00:00 +3: test/run_command_test.dart: run command invokes flutter run
...
00:00 +117: All tests passed!
```
There is no actual compilation performed by the tool (that is handled implicitly by `dart test`), and as a result neither a `depfile` is needed, nor generating a pre-compiled artifact like a snapshot or AOT elf/assembly.
---
This work is incomplete, that is, we'd want to properly tag the executable so `et` can find it, and create a wrapper template (i.e. `dart_test`) that tightens things up a bit, but I wanted to show the work at this intermediate step to get feedback before moving forward.
/cc @jonahwilliams, @jtmcdole as well.
This turns on Metal validation for launching impeller_unittests from the tests panel. This matches the default behavior of launching tests from XCode. Without these assertions errors in Metal are completely silent. In my case I just got a black screen until I tried running the tests through xcode.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style