1319 Commits

Author SHA1 Message Date
Zachary Anderson
93323c6d97 Don't use intel clang on arm64 macs (flutter/engine#54291)
Since gen_snapshot is lipo'd everywhere now, it should be safe to both
build with either arm64 or intel macs, and to use the arm64 native clang
toolchain on arm64 macs instead of the intel toolchain under Rosetta.

Related to https://github.com/flutter/flutter/issues/103386
2024-08-03 16:08:24 -07:00
Jason Simmons
0465c1d35a Fix a race in file I/O done by a BuildRunner test (flutter/engine#54167)
This test failure had been seen in some recent auto-roller jobs on CI.
2024-07-28 00:57:26 +00:00
Matan Lurey
498a31a6da Migrates the bulk of flutter/engine to pub workspaces. (flutter/engine#54157)
Part of https://github.com/flutter/flutter/issues/147883.

Excluding Fuchsia and the Web SDK, the remaining scripts are:

```sh
$ ./tools/find_pubspecs_to_workspacify.sh

/Users/matanl/Developer/engine/src/flutter/impeller/tessellator/dart/pubspec.yaml
/Users/matanl/Developer/engine/src/flutter/sky/packages/sky_engine/pubspec.yaml
/Users/matanl/Developer/engine/src/flutter/shell/vmservice/pubspec.yaml
/Users/matanl/Developer/engine/src/flutter/lib/snapshot/pubspec.yaml
/Users/matanl/Developer/engine/src/flutter/lib/gpu/pubspec.yaml
/Users/matanl/Developer/engine/src/flutter/lib/web_ui/pubspec.yaml
/Users/matanl/Developer/engine/src/flutter/flutter_frontend_server/pubspec.yaml
```

These could be the trickiest, so I'm doing them separately.
2024-07-27 09:58:40 -07:00
Zachary Anderson
b8ff0f4901 Split up mac_host_engine builds (flutter/engine#53571)
This PR does a few things. Mainly it makes the builds in
mac_host_engine.json each build fewer targets to increase parallelism
for post-submit and release builds. To ensure that increasing
parallelism doesn't lead to capacity issues, this change also allows the
mac_host_engine.json builds to run on either intel or arm64 macOS hosts.
Finally, when building on an arm64 macOS host to target macOS, this PR
changes the `gn` script to ensure that the arm64 native clang toolchain
will be used.

To keep mac_host_engine.json focused on builds that produce artifacts,
this PR also moves tests from that file into the ill-named
mac_unopt.json. In a subsequent PR, I'll rename all the *_unopt.json
files to *_tests.json or something similar.

The artifacts produced by these builds are passing framework presubmit
checks in https://github.com/flutter/flutter/pull/152345.
2024-07-26 15:39:46 -07:00
Matan Lurey
e301288885 Pub workspace-ify most of testing/ and parts of tools/ (flutter/engine#54124)
Replaces and closes https://github.com/flutter/engine/pull/53997.

This PR migrates the following packages to the pub workspace:
  - testing/benchmark
  - testing/dart
  - testing/litetest
  - testing/pkg_test_demo
  - testing/scenario_app
  - testing/skia_gold_client
  - testing/symbols
  - tools/golden_tests_harvester
  - tools/pkg/process_fakes

It also makes minor changes to the Dart build rules in order to resolve the root package_config, instead of per-package.

I am _not_ totally confident of the `_embedder.yaml` change, but I also can't explain what is needed to continue analyzing `lib/ui` without analysis failures that all of the symbols in `dart:nativewrappers` are missing.
2024-07-26 17:35:50 +00:00
Zachary Anderson
1bddf3416d [et] Better RBE defaults (flutter/engine#54059)
This PR adopts some RBE configuration from the way that chromium uses RBE

https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main/reclient_helper.py

These changes should bias both local and CI builds more towards using the worker pool, which we recently expanded, and should help limit the bandwidth used, which is a bottleneck for build times on a slow connection.
2024-07-24 23:15:56 +00:00
Matan Lurey
c696d2cf7b Move testing/litetest to pub workspaces. (flutter/engine#54082)
More incremental version of https://github.com/flutter/engine/pull/53997.
2024-07-24 21:02:17 +00:00
Matan Lurey
cfe0de9c8f Suggest a few common vscode extensions. (flutter/engine#53974)
For example, without the markdown preview, files in `docs/**/*.md` don't all render.
2024-07-24 18:49:05 +00:00
Camille Simon
0619de0107 Upgrade Engine Android SDK to 35 (flutter/engine#53574)
**REVIEW BUT DO NOT MERGE:** Will merge after https://github.com/flutter/buildroot/pull/870 lands.

1: Updates engine to use Android 35. Part of https://github.com/flutter/flutter/issues/150215.
Engine step of https://github.com/flutter/flutter/blob/master/docs/platforms/android/Upgrading-Engine's-Android-API-version.md.

2: Updates test runner AGP version to 8.5, engine Gradle version to 8.9 to accommodate update.

3: Fixes lint and suppresses deprecation warnings caused by the update. None of the deprecations are unknown by the team (they are handled in the code), but the tests emitted warnings.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-24 16:54:38 +00:00
Chris Bracken
08c7b8d6e2 Prepend third_party/pyyaml to python sys.path (flutter/engine#54023)
Previously we were appending Flutter's fork of third_party/pyyaml to the Python sys.path. In the case where a bot image or local install already has pyyaml installed elsewhere on the path, ours will fail to be picked up. Instead prepend to the path.

Issue spotted by jsimmons@.

Related: https://github.com/flutter/engine/pull/54001

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-22 17:38:07 +00:00
Zachary Anderson
63d8e2bbe6 [et] Plumb -j to ninja (flutter/engine#54005)
Also computes a better `-j` when RBE is enabled.

Fixes https://github.com/flutter/flutter/issues/147667
2024-07-19 20:28:47 +00:00
Chris Bracken
08c30a87bd Upgrade third_party/pyyaml to 03c67afd452cdff45b41bfe65e19a2fb5b80a0e8 (flutter/engine#54001)
We were using a very old version of this library that broke with
Python3.12. This updates to a Python 3.12 compatible SHA.

The specific breakage at the former commit was that
`collections.Hashable` was deprecated and moved to
`collections.abc.Hashable` in Python 3.7. It was removed in Python 3.8.
For anyone on newer versions of Python3, such as Python 3.9.6 which
ships with macOS 15 Sequoia, this is broken.

The error on versions of Python newer than 3.8 is:
```
________ running 'python3 src/flutter/tools/pub_get_offline.py' in '/Users/chris/Developer/flutter/engine'
Traceback (most recent call last):
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/pub_get_offline.py", line 167, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/pub_get_offline.py", line 157, in main
    if not package_uses_workspace_resolution(package):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/pub_get_offline.py", line 76, in package_uses_workspace_resolution
    return yaml.safe_load(pubspec_file).get('resolution') == 'workspace'
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/../third_party/pyyaml/lib3/yaml/__init__.py", line 75, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/../third_party/pyyaml/lib3/yaml/constructor.py", line 37, in get_single_data
    return self.construct_document(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/../third_party/pyyaml/lib3/yaml/constructor.py", line 46, in construct_document
    for dummy in generator:
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/../third_party/pyyaml/lib3/yaml/constructor.py", line 398, in construct_yaml_map
    value = self.construct_mapping(node)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/../third_party/pyyaml/lib3/yaml/constructor.py", line 204, in construct_mapping
    return super().construct_mapping(node, deep=deep)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Developer/flutter/engine/src/flutter/tools/../third_party/pyyaml/lib3/yaml/constructor.py", line 126, in construct_mapping
    if not isinstance(key, collections.Hashable):
                           ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Hashable'
Error: Command 'python3 src/flutter/tools/pub_get_offline.py' returned non-zero exit status 1 in /Users/chris/Developer/flutter/engine
```


## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [X] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I signed the [CLA].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-07-18 20:17:31 -07:00
Matan Lurey
767eb5b265 Gracefully fail when gn desc returns no targets. (flutter/engine#53999)
Closes https://github.com/flutter/flutter/issues/151990.

This is just a nice QOL change, since the `//` format we're using is not "native" to GN or Ninja.
2024-07-18 21:44:06 +00:00
Matan Lurey
50e4e12c2e Add a "pub workspace" to the root of the engine repository (flutter/engine#53539)
... and use it in `engine_tool` to prove everything is working, i.e. on CI and elsewhere.

Partial work towards https://github.com/flutter/flutter/issues/147883.
Supersedes and closes https://github.com/flutter/engine/pull/51782 (which was a prototype).

See also:
- https://flutter.dev/go/pub-workspace, the design doc on the feature.
- https://github.com/dart-lang/pub-dev/pull/7762, an example PR.

I'll probably end up moving the inline docs in `pubspec.yaml` to a `docs/*.md` once that's a thing.
2024-07-18 16:18:09 +00:00
Gray Mackall
383d7e8338 Align tools/android_sdk/packages.txt with what is uploaded to CIPD (flutter/engine#53921)
This file should always be kept in sync with what we are actually using, but it seems to currently be out of sync.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-16 00:47:56 +00:00
Matan Lurey
15becdc41e Move //third_party/java to //flutter/third_party/java (flutter/engine#53590)
... as part of buildmoot.
2024-07-12 09:25:28 -07:00
Matan Lurey
ee6b0f1b2d Move //third_party/android_embedding_dependencies to //flutter/third_party. (flutter/engine#53587)
... as part of the buildmoot effort.

I'll rebase after @gmackall's definitely-will-work-this-time bump of the dependencies.
2024-07-03 18:40:23 +00:00
Filip Filmar
06414a6725 [icu] Ignores the dir flutter/third_party/icu/patches (flutter/engine#53667)
This directory consistes of patches that Chromium's maintainers of the Chromium ICU fork have already applied to the ICU source code.

Usually these are fix-forwards that have been applied to the ICU library after it has been released.

The patch files are kept to ensure that the patches are applied if we ever need to create a new branch, or update the major ICU version.

The patch files specifically do *not* get used during the build process.

Issues: https://github.com/flutter/flutter/issues/151116

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-01 18:38:55 +00:00
Gray Mackall
8e2c560e10 Re-re-re-land "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53592)
Re-re-re-land https://github.com/flutter/engine/pull/53001.

I recreated the postsubmit failures of the [roll](https://github.com/flutter/flutter/pull/150733) of the [last land](https://github.com/flutter/engine/pull/53532), and then verified on a local branch that those same postsubmits pass with this upgrade after the land of https://github.com/flutter/flutter/pull/150873. 

So I have pretty high confidence this won't cause any problems in the framework repo. I also tested on a previous land attempt that the `all_packages` app builds on this branch, so that is also a good sign for the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-27 19:56:47 +00:00
Matan Lurey
75a2393b53 Remove otherwise unused third_party/web_dependencies. (flutter/engine#53588)
There are no usages other than the reference in the LICENSE checker.
2024-06-26 20:40:04 +00:00
Matan Lurey
0c9f812104 Move impeller-cmake-example to flutter/third_party. (flutter/engine#53589)
... as part of buildmoot.

I _think_ this is all that is needed but am not confident.
2024-06-26 18:59:18 +00:00
auto-submit[bot]
c352f44015 Reverts "Re-re-land "Upgrade all[most] androidx dependencies to latest" (#53532)" (flutter/engine#53546)
Reverts: flutter/engine#53532
Initiated by: gmackall
Reason for reverting: This breaks apps that use plugins that use compileSdk 31, some of which we use in our postsubmit (so it blocks the tree).
Original PR Author: gmackall

Reviewed By: {reidbaker, matanlurey}

This change reverts the following previous change:
Re-re-land https://github.com/flutter/engine/pull/53001

(Reland attempt was at https://github.com/flutter/engine/pull/53462)

Unblocked by https://github.com/flutter/flutter/pull/150585, but will still need a manual roll because I will need to re-generate a bunch of lockfiles.

Also, https://github.com/flutter/flutter/blob/master/docs/engine/Testing-presubmit-Engine-PRs-with-the-Flutter-framework.md doesn't work (it's blocked on https://github.com/flutter/flutter/issues/149780) so I mostly just have to pray that no new issues occur in the roll. But I believe all issues that came up in the last attempt should be addressed by the above pr and by manual lockfile generation.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-25 01:20:29 +00:00
Gray Mackall
f9b2f290ba Re-re-land "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53532)
Re-re-land https://github.com/flutter/engine/pull/53001

(Reland attempt was at https://github.com/flutter/engine/pull/53462)

Unblocked by https://github.com/flutter/flutter/pull/150585, but will still need a manual roll because I will need to re-generate a bunch of lockfiles.

Also, https://github.com/flutter/flutter/blob/master/docs/engine/Testing-presubmit-Engine-PRs-with-the-Flutter-framework.md doesn't work (it's blocked on https://github.com/flutter/flutter/issues/149780) so I mostly just have to pray that no new issues occur in the roll. But I believe all issues that came up in the last attempt should be addressed by the above pr and by manual lockfile generation.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-24 21:36:22 +00:00
Jonny Wang
c2f5afd59a [fuchsia] Update Fuchsia API level to 19 (flutter/engine#53494)
Update Fuchsia API level to 19

b/347290402

Tests: cl/645133515

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-06-24 18:56:40 +01:00
Matan Lurey
233edc0b8f Add SurfaceProducer.Callback lifecycle hooks (flutter/engine#53280)
Work towards https://github.com/flutter/flutter/issues/148417.
2024-06-24 08:06:56 -07:00
auto-submit[bot]
feefb6ebd8 Reverts "Reland "Upgrade all[most] androidx dependencies to latest" (#53462)" (flutter/engine#53468)
Reverts: flutter/engine#53462
Initiated by: gmackall
Reason for reverting: blocking roll (see https://github.com/flutter/flutter/pull/150465#issuecomment-2177329885).
Original PR Author: gmackall

Reviewed By: {reidbaker}

This change reverts the following previous change:
Relands https://github.com/flutter/engine/pull/53001.

Also pulls in @matanlurey's dependency on `androidx.lifecycle:lifecycle-process`, and upgrades it to `2.7.0`.

It is unblocked by the changes in https://github.com/flutter/flutter/pull/149204.

Tested by building the engine, and then also by building the `flutter/packages` `all_packages` app on this branch, so that hopefully it will also roll smoothly into the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-19 01:08:48 +00:00
Gray Mackall
4e98015b1e Reland "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53462)
Relands https://github.com/flutter/engine/pull/53001.

Also pulls in @matanlurey's dependency on `androidx.lifecycle:lifecycle-process`, and upgrades it to `2.7.0`.

It is unblocked by the changes in https://github.com/flutter/flutter/pull/149204.

Tested by building the engine, and then also by building the `flutter/packages` `all_packages` app on this branch, so that hopefully it will also roll smoothly into the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-18 21:14:07 +00:00
Filip Filmar
e2593bb7d9 [flatland] Handle fence overflow in flatland_connection.cc (flutter/engine#53366)
flatland_connection.cc used to allow an arbitrary number of acquire and release fences to be scheduled for each frame.

Sadly, Fuchsia has a limitation of (1) the number of total handles that can be sent per a FIDL call, but also (2) the Flatland protocol only supports sending up to 16 fences per each fence type.

Now, normally there should be very few scheduled fences per frame. But if frames get skipped, we could amass many fences which would then crash our attempts to send all of them to the Flatland `Present` endpoint.

This change introduces two fence multiplexer, which allow us to signal more than 16 fences per type, at a performance penalty. We expect to be able *not* to crash the FIDL subsystem using this approach, and may even be able to hobble along for a bit, until the fences issue is hopefully self-resolved.

That said, this issue seems to indicate there are frame scheduling problems elsewhere. But this is a fairly straightforward change to make without affecting the rest of the flatland code or integration, so we opt to do that first.

Issues: [#150136](https://github.com/flutter/engine/pull/53366)

- [] I updated/added relevant documentation (doc comments with `///`).
2024-06-17 18:10:20 +00:00
Chinmay Garde
b5bc4a3868 Remove the DBC interpreter flag. (flutter/engine#53204)
Cleanup of unused flag.
2024-06-05 23:29:16 +00:00
Filip Filmar
2b043806f5 [icu] Manual roll of icu (flutter/engine#53199)
Manual roll of the ICU library. This normally happens automatically, but this
time around, ICU folks changed their license, so that needs to be fixed up.
I wish they would stop doing that. :)

This manual change should enable us to turn the auto-roller back on.

https://github.com/flutter/flutter/issues/149684

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-05 15:11:17 +00:00
John McDole
edeabda41b Remove RBE crud compile_commands.json (flutter/engine#53135)
Removes reported errors in VSCode when using `clangd`

* Parsing a 21MB json string is not performant
* RegExp replacing all occurrences in said 21MB string is (~61ms)
* Fixes #147767
2024-05-31 21:20:51 +00:00
Reid Baker
02d2b7c8e1 Google java format relocation and formatting update (flutter/engine#53118)
Fixes https://github.com/flutter/flutter/issues/149319
Caused by https://github.com/flutter/engine/pull/52582

Follow up required to add a flag that fails on missing jar files instead of skipping missing jar files.
2024-05-31 18:09:23 +00:00
Jonny Wang
cbe5184edf Fuchsia api level 18 (flutter/engine#53115)
b/335285098
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-05-30 19:26:47 +01:00
Gray Mackall
dab310ecb8 Manual revert of #53001 (flutter/engine#53075)
Revert label failed due to conflicts

`FlutterFragmentTest.java` was the only file that had merge issues, everything else is the output of `git revert 802e5d2cd3c9e73f336e3fe43487b64a5fdf98d8`

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-28 23:00:20 +00:00
Chinmay Garde
829947077f Remove --ios-cpu flag. Only the arm64 variant is supported. (flutter/engine#53044)
We don't support 32-bit arm iOS builds anymore. But adding the --ios-cpu=arm64 appends the "_arm" to the out subdirectory. This just causes confusion since the ios_debug_unopt is still arm64.

Just remove the flag that does nothing.
2024-05-28 22:26:16 +00:00
Gray Mackall
802e5d2cd3 Upgrade all[most] androidx dependencies to latest (flutter/engine#53001)
Upgrades every `androidx` dependency in the `src/third_party/android_embedding_dependencies` bundle to the latest version, except the `lifecycle` group*. Tested running a couple of apps as well because when updating these dependencies in the past I've been able to build the engine but then flutter run fail when trying to run an app.

Fixes https://github.com/flutter/flutter/issues/129307, also unblocks a feature that will eventually be needed for Scribe.

[*]`2.8.0` is the latest there, but I ran into an issue with dexing when I tried to upgrade, due to b/336164417, an AGP bug that had its fix backported to all >`8.0.0` versions, but we still support less than that so we will have to wait on that upgrade.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-28 16:58:59 +00:00
John McCutchan
88b596ca64 Reduce rebuild times when invoking 'et run' (flutter/engine#52883)
Android only for now but this avoids rebuilding a bunch of test targets that aren't necessary to do a `flutter run` with a custom engine.

I need to fill in some blanks for other platforms before landing.
2024-05-22 17:49:05 +00:00
Chinmay Garde
4e5093707f Remove --trace-gn from ./flutter/tools/gn (flutter/engine#52964)
This flag as originally introduced to see if it made the GN step slower. It did not do so in any measurable manner and the default was flipped to true. AFAICT, no one disables and its good to have tracelogs to debug GN slowdowns. Remove the flag.
2024-05-21 19:35:46 +00:00
Chinmay Garde
d746daecc1 [Impeller] Remove unused GN flags. (flutter/engine#52962)
Removes impeller_capture, impeller_use_prebuilt_impellerc, impeller_use_prebuilt_scenec, and impeller_trace_canvas.

Also removes setting these flags from ./flutter/tools/gn.
2024-05-21 19:25:59 +00:00
Matan Lurey
b0e791fce3 et generates {out}/{buildName} if missing on et {build|test|query} (flutter/engine#52866)
Closes https://github.com/flutter/flutter/issues/148442.

This restores functionality that existed prior in https://github.com/flutter/engine/pull/52832:

- Splits `runGn` to `ensureBuildDir`, which is in practice what it does.
2024-05-16 04:03:21 +00:00
Matan Lurey
eafc52c37d Include stdout on a failed gn desc call, and test for it. (flutter/engine#52863)
Fixes https://github.com/flutter/flutter/issues/148431, in that full error output is now shown.

I also filed an additional issue for how we could do better: https://github.com/flutter/flutter/issues/148442.
2024-05-16 01:09:13 +00:00
Matan Lurey
cb19eac08e Short-circuit crawling all targets in et {build|test|query} (flutter/engine#52832)
Closes https://github.com/flutter/flutter/issues/147666.

This is a large change, I'd be happy to either review synchronously or
change commands one at a time, but I think this is overall the right
approach. I also didn't see any reason to reuse the `BuildRunner` code
for these commands, the flow is basically:

```mermaid
graph LR
    A[et targetsOrPatterns] --> B[gn desc --format=json]
    B --> C[existing code that runs ninja/workers]
```

Quick summary of changes:
- Introduced a [`Label` and `TargetPattern`][1] type to avoid awkward
string parsing/manipulation all over
- Replaced `gn_utils` (i.e. `targetsFromCommandLine` and friends) with
[an invocation of `gn desc`][2]
- Some tests were brittle in terms of expected output, I mostly left
them alone and wrote TODOs where applicable

Here is the fun part, results (and some manual integration tests):
```sh
# build, previously was 10-15s, is now ~3s
flutter % time et build -c host_debug_unopt_arm64 //flutter/impeller:impeller_unittests
[2024-05-14T19:05:55.163][macos/host_debug_unopt_arm64: GN]: OK
[2024-05-14T19:05:56.119][macos/host_debug_unopt_arm64: RBE startup]: Proxy started successfully.
[macos/host_debug_unopt_arm64: ninja] 0.0% (0/1) Regenerating ninja files[2024-05-14T19:05:57.309][macos/host_debug_unopt_arm64: ninja]: OK
[2024-05-14T19:05:57.573][macos/host_debug_unopt_arm64: RBE shutdown]: Actions completed: 0
$ENGINE/flutter/bin/et build -c host_debug_unopt_arm64   3.20s user 0.87s system 107% cpu 3.776 total

# test, also benefits from speedup, but I didn't time it
flutter % et test -c host_debug_unopt_arm64 //flutter/fml:fml_unittests
[2024-05-14T19:07:01.843][macos/host_debug_unopt_arm64: GN]: OK
[2024-05-14T19:07:02.707][macos/host_debug_unopt_arm64: RBE startup]: Proxy started successfully.
[2024-05-14T19:07:07.400][macos/host_debug_unopt_arm64: ninja]: 100.0% (3/3) LINK ./fml_unittests
[2024-05-14T19:07:07.404][macos/host_debug_unopt_arm64: ninja]: OK
[2024-05-14T19:07:07.748][macos/host_debug_unopt_arm64: RBE shutdown]: Actions completed: 1 (1 racing local)
OKAY:         7s.95ms //flutter/fml:fml_unittests

# query, also benefits from speedup
flutter % time et query targets -c host_debug_unopt_arm64
//flutter/display_list:display_list_benchmarks
//flutter/display_list:display_list_builder_benchmarks
# ... many targets omitted ...
$ENGINE/flutter/bin/et query targets -c host_debug_unopt_arm64  1.27s user 0.18s system 147% cpu 0.978 total
```

In other words, ~5x improvement on `et build` and `et query` is _much_
faster as well.

[1]:
https://github.com/flutter/engine/compare/main...matanlurey:engine:gn-label?expand=1#diff-ac008475ce9e209f4ecf6594b0cd48d12d86a1ffa0aa7d555375ff43b983eb2b
[2]:
https://github.com/flutter/engine/compare/main...matanlurey:engine:gn-label?expand=1#diff-ad116b8504dd0a500bf758a327c7052e5733a2b465d3295e35b74458d483276f
2024-05-15 12:57:02 -07:00
Zachary Anderson
cd9cf6d62b [et] Print reproxy stats when RBE shuts down (flutter/engine#52818)
```
$ bin/et build -c ci/android_release_arm64                                                                                      ─╯
[2024-05-14T11:28:40.856][ci/android_release_arm64: GN]: OK
[2024-05-14T11:28:42.527][ci/android_release_arm64: RBE startup]: Proxy started successfully.
[2024-05-14T11:31:14.869][ci/android_release_arm64: ninja]: 100.0% (1096/1096) STAMP obj/flutter/lib/snapshot/snapshot.stamp
[2024-05-14T11:31:14.871][ci/android_release_arm64: ninja]: OK
[2024-05-14T11:31:15.182][ci/android_release_arm64: RBE shutdown]: Actions completed: 1021 (569 racing locals, 452 racing remotes)
```
2024-05-14 14:15:10 -07:00
Jason Simmons
6ee57afaf3 Migrate third_party/gradle to flutter/third_party/gradle (flutter/engine#52814)
Based on https://github.com/flutter/engine/pull/52030
2024-05-14 20:51:10 +00:00
Matan Lurey
d89f54dd65 Replace json_utils with a modern extension type, add tests. (flutter/engine#52769)
I started on a refactoring of
https://github.com/flutter/flutter/issues/147666, and was frustrated
with the JSON decoding of `gn desc --format=json`, so I used a similar
pattern from my micro-json library (https://pub.dev/packages/jsonut) and
encapsulated it as an extension type.

My favorite is the `JsonObject.map` function which replaces:

```dart
/// Construct a RunTarget from a JSON map.
factory RunTarget.fromJson(Map<String, Object> map) {
  final List<String> errors = <String>[];
  final String name = stringOfJson(map, _nameKey, errors)!;
  final String id = stringOfJson(map, _idKey, errors)!;
  final String targetPlatform =
      stringOfJson(map, _targetPlatformKey, errors)!;

  if (errors.isNotEmpty) {
    throw FormatException('Failed to parse RunTarget: ${errors.join('\n')}');
  }
  return RunTarget._(name, id, targetPlatform);
}
```

... with:

```dart
/// Construct a RunTarget from a JSON map.
factory RunTarget.fromJson(Map<String, Object> map) {
  return JsonObject(map).map((JsonObject json) => RunTarget._(
    json.string(_nameKey),
    json.string(_idKey),
    json.string(_targetPlatformKey),
  ));
}
```
2024-05-13 20:03:43 -07:00
Jason Simmons
3c17cf0357 Move libcxx to //flutter/third_party (flutter/engine#52773)
Fixes https://github.com/flutter/flutter/issues/144202
2024-05-13 19:26:04 -07:00
Chinmay Garde
f20b17a2ae [Impeller] Prepare a SkiaGPU-less iOS build. (flutter/engine#52748)
The size of the LTO build of the engine with the dylib compressed is as follows:

```sh
$ du -k libFlutter*
5236	libFlutter.dylib.tar.gz
4324	libFlutterSlimpeller.dylib.tar.gz
```

Sizes are in KiB. This represents a binary size reduction of 17.41% of the compressed artifacts. The compression ratios will likely differ based on the compression scheme.

Uncompressed, the sizes are:

```sh
$ du -k libFlutter*
16920	libFlutter.dylib
14044	libFlutterSlimpeller.dylib
```

This represents a binary size reduction of 16.99% which is in the same ballpark.

The really mucky bit was backing out the raster cache and persistent cache. I want to clean that up in a later patch so that those TUs are part of a separate submodule.

Opting out of Impeller will lead to a fatal log at startup saying the opt-out is disallowed.

Fixes https://github.com/flutter/flutter/issues/126606
2024-05-13 21:43:47 +00:00
Zachary Anderson
a1257de605 Simplify GN pools, use in more places (flutter/engine#52721)
This PR changes from using a different GN pool for each non-compiler tool, to using one GN pool for everything.

Additionally, since we are no longer linking remotely in any configuration, this PR uses the pool for linking.

ObjC and impellerc tasks also do not (yet) run on RBE, so they are also now governed by the pool.

Needs https://github.com/flutter/buildroot/pull/856
2024-05-10 22:43:23 +00:00
Matan Lurey
0a503306d4 Infer --rbe based on the existence of //flutter/build/rbe (flutter/engine#52700)
Closes https://github.com/flutter/flutter/issues/148006.
2024-05-10 11:49:44 -07:00
Matan Lurey
8ce9cf6200 When et is not attached to a terminal, still split lines for status updates. (flutter/engine#52681)
For illustrative purposes:

```sh
$ et build | grep '.*'
```

... should still get line-per-line status updates, but it does not without this patch.

It's hard to write tests because of global state, so I've declined to do so at the moment.

Closes https://github.com/flutter/flutter/issues/147903.
2024-05-09 18:09:05 +00:00