1180 Commits

Author SHA1 Message Date
Dan Field
98485b3f82 Revert "Bump everything to Android 21" (flutter/engine#51056)
Reverts flutter/engine#51032

Probably causing some of the failures in https://github.com/flutter/flutter/pull/144326

@johnmccutchan fyi
2024-02-28 19:15:04 +00:00
Dan Field
6efee79357 Bump everything to Android 21 (flutter/engine#51032)
Followed the linter, got rid of a bunch of version check/guards we don't need anymore.
2024-02-28 15:56:40 +00:00
John McCutchan
cdeb8166a2 Rename some classes in the engine_build_configs package (flutter/engine#51016)
- BuildConfig -> BuilderConfig
- GlobalBuild -> Build
2024-02-27 15:12:10 -08:00
Zachary Anderson
e7b97723ec Remove rewrapper prefix from compiler commands for clang-tidy (flutter/engine#51001)
This PR also enables RBE for builds for clang-tidy.
2024-02-27 14:57:51 -08:00
Jason Simmons
e017114099 Move vulkan-deps to //flutter/third_party/vulkan-deps (flutter/engine#51013)
See https://github.com/flutter/flutter/issues/144205
2024-02-27 21:59:00 +00:00
zijiehe@
c274921fa6 [Fuchsia] Use shared gn-sdk from chromium (flutter/engine#50855)
Fuchsia team is working on getting rid of non-versioned libraries and sysroot (see b/40935282), but flutter is using a fairly old version of in-house gn-sdk. It's hard to maintain it anymore.
So this change removes the in-house gn-sdk and replaces it with the gn-sdk from chromium.
This is a prerequisite to select the idk / sdk lib version according to the api-level.

This change contains three parts:
1) Replacing gn-sdk/ with gn-sdk/src/ since the chromium needs a README.chromium in gn-sdk/ folder.
2) Making the existing build rules work with the newer gn-sdk.
3) Drive-by replacing "gtest_runner.shard.cml" with "sys/testing/gtest_runner.shard.cml", it's in fuchsia sdk already.

Bug: [b/40935282](https://issues.chromium.org/issues/40935282?pli=1&authuser=0)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-27 17:30:05 +00:00
Zachary Anderson
827e920f48 Move protobuf to //flutter/third_party (flutter/engine#50997)
For https://github.com/flutter/flutter/issues/67373

Currently the files in the secondary buildroot for protobuf are checked
out from their own git repo. Flutter owns a mirror of that repo. To move
protobuf to `//flutter/third_party`, we can land a change in that repo,
and then revert it after we're done with the buildmoot. Alternately, in
this PR, I've just copied the files into the flutter/engine repo under
the secondary buildroot and made the changes.
2024-02-27 08:37:21 -08:00
Zachary Anderson
cae1c8dc3a Run engine unit tests on mac host_debug_unopt_arm64 (flutter/engine#50327)
Related https://github.com/flutter/flutter/issues/142868
2024-02-26 13:39:05 -08:00
Zachary Anderson
8a4feb869c [et] Improve the logger for the ninja build, adds a spinner (flutter/engine#50952)
For https://github.com/flutter/flutter/issues/132807

The spinner is mostly copied from the flutter_tool.
2024-02-26 09:31:15 -08:00
Zachary Anderson
9f1ed38ee0 Shift //third_party/icu to //flutter/third_party (flutter/engine#50924)
For https://github.com/flutter/flutter/issues/67373
2024-02-23 23:23:27 +00:00
John McCutchan
82dd6cd6e3 Add an initial 'build' command to engine_tool (flutter/engine#50681)
* Adds a 'build' command to `et`.
* Renamed `query builds` to `query builders` because that seemed to be
more precise(?)

Some extra requests during review:
1. I've left some questions I'd like answers to at the top of
`build_command.dart` I suspect @zanderso and @loic-sharma can give me
(some?) answers.
2. I suspect I'm holding the FakeProcessManager wrong or there is a
better way to write the tests in `build_command_test.dart`. Pointers to
good examples are appreciated.
2024-02-23 10:02:34 -08:00
Matan Lurey
b357d7a45e Remove/reduce unused or private methods and add tests to SkiaGoldClient (flutter/engine#50844)
@Piinks correctly pointed out we had to make a number of changes to the engine's `SkiaGoldClient` and we had no test coverage (https://github.com/flutter/engine/pull/50829, https://github.com/flutter/engine/pull/50826).

This corrects the problem.

I am not in _love_ with these tests (they could be less snapshot-y), but the mechanisms I need to write better tests is beyond what I can spend ~1-2 hours on (https://github.com/flutter/flutter/issues/133569).

/cc @dnfield @mdebbar
2024-02-22 00:16:57 +00:00
Zachary Anderson
e6d9dca1b7 Shift some deps to //flutter/third_party (flutter/engine#50830)
Part of https://github.com/flutter/flutter/issues/67373
2024-02-21 23:51:16 +00:00
Zachary Anderson
701be200cd Starts a .ci.yaml parser (flutter/engine#50783)
Towards https://github.com/flutter/flutter/issues/132807.

This is needed so the engine tool can map the names of CI builders
listed in `.ci.yaml` to the names of the configurations in the build
config json files in `ci/builders`.
2024-02-21 14:56:07 -08:00
Matan Lurey
05fedd7c11 Ignore EOF newline characters and added tests to dir_contents_diff tool (flutter/engine#50805)
No issue filed, but was [discussed on discord](https://discord.com/channels/608014603317936148/608021010377080866/1209568840644567091).
2024-02-21 19:05:26 +00:00
Zachary Anderson
f6629ffe5c Use 'et format' in CI. Check formatting of all files in CI (flutter/engine#50810)
This PR changes the format check on CI to use the command added in
https://github.com/flutter/engine/pull/50747.

Additionally, while making this change, I noticed that the CI check was
not checking the formatting of all files, and that as a result, files
were present in the repo with incorrect formatting. I have fixed the
formatting and fixed the check to always check all files.
2024-02-21 09:38:08 -08:00
Jason Simmons
fa635a5b27 Add pub.dev to the hosted package URIs checked by the pub_get_offline script (flutter/engine#50811)
pub get --offline may fetch packages that are in the local package cache but were previously downloaded from a hosted source.  The script needs to check for packages that came from either the old or new locations of the Dart hosted package repository.
2024-02-21 04:45:53 +00:00
Zachary Anderson
6ebbce07e7 Make global builds uniquely named per platform (flutter/engine#50764)
This is expected to help with
https://github.com/flutter/flutter/issues/132807
2024-02-20 19:41:40 -08:00
Zachary Anderson
6a936a530c [et] Adds a format command (flutter/engine#50747)
For https://github.com/flutter/flutter/issues/132807
2024-02-20 19:40:47 -08:00
Zachary Anderson
77cbd54c43 [et] Adds a .bat entrypoint for Windows (flutter/engine#50784)
For https://github.com/flutter/flutter/issues/132807
2024-02-20 18:48:18 +00:00
gaaclarke
8515af7ee9 Pulled out dir contents golden tool (flutter/engine#50703)
fixes https://github.com/flutter/flutter/issues/143459

This also starts using it as part of scenario_app.

Testing: Is part of the testing infrastructure.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-16 22:18:05 +00:00
Jason Simmons
ea6b80144d Add the web package to the set of Dart third_party packages in DEPS (flutter/engine#50714)
Dart is rolling the http package to a version that depends on the web package. (see https://dart.googlesource.com/http/+/d8b237d273f49bada2aa7feaa0e7795e2541fe83)
2024-02-16 06:54:49 +00:00
Zachary Anderson
80076b93fb [et] Adds a logger (flutter/engine#50693) 2024-02-16 00:22:54 +00:00
gaaclarke
fcbd40e8e4 Added tool to easily check golden diffs locally. (flutter/engine#50654)
This addresses the problem where people feel like they have to upload a PR to get diffs from Skia Gold.  This should work for most workflows.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-15 17:50:06 +00:00
Chinmay Garde
6c17d7bf9d Use a GN variable (dart_src) to reference the location of the Dart checkout. (flutter/engine#50624)
Towards https://github.com/flutter/flutter/issues/143335
2024-02-14 21:12:23 -08:00
Matan Lurey
53ab3dc4b4 Move boringssl to flutter/third_party. (flutter/engine#50601)
As ready as it's ever going to be.
2024-02-14 17:17:28 -08:00
Zachary Anderson
82d5e3784f Starts a command line tool for assisting engine dev workflows (flutter/engine#50642)
This is mostly just trying to get some structure in place. I suspect
that the implementation of the `query` command in this PR will get
entirely replaced through improvements.
2024-02-14 12:39:16 -08:00
Zachary Anderson
9f2ff32022 [engine_build_configs] Use dart:ffi Abi to determine the host cpu (flutter/engine#50604)
Follow-up on https://github.com/flutter/engine/pull/50543#discussion_r1486546946
2024-02-13 19:19:27 +00:00
Zachary Anderson
f202a1fdce Move libpng to //flutter/third_party/libpng (flutter/engine#50571)
This is an example of moving a dependency to `//flutter/third_party`
that requires forward/aliasing through the secondary build directory.
Without forwarding, and only making changes to the `DEPS` file and
rewriting paths in the engine repo, a `gn` invocation gets the following
error:
```
ERROR at //third_party/freetype2/BUILD.gn:85:5: Can't load input file.
    "//third_party/libpng",
    ^---------------------
Unable to load:
  /Users/zra/flutter/engine/src/third_party/libpng/BUILD.gn
I also checked in the secondary tree for:
  /Users/zra/flutter/engine/src/flutter/build/secondary/third_party/libpng/BUILD.gn
```

Another dependency, with a `BUILD.gn` file outside of the engine repo,
is still referring to `libpng` by the old path. However, `gn` tells us
that it is also checking under the secondary tree. We can put whatever
we want in that `BUILD.gn` file to make `freetype2` happy. In this case
it's easy, we just add a build rule there that forwards to `libpng`'s
new location. There's only one wrinkle, which is that the dependency in
the `group` target has to be `public_deps` rather than a simple `deps`.
This is so that `public_deps` and `public_configs` of
`//flutter/third_party/libpng` are correctly inherited by dependents of
`//third_party/libpng`.
2024-02-13 07:08:45 -08:00
Jason Simmons
fb48b918b9 Roll vulkan-deps to 014f44e134a1de387791bffacc32ff9d8db71176 (flutter/engine#50515)
Fixes https://github.com/flutter/flutter/issues/141277
See https://github.com/flutter/flutter/issues/138117
2024-02-12 20:22:40 +00:00
Zachary Anderson
72f4969bfc Initializes RBE in the build config runner (flutter/engine#50543)
Unlike Goma, the local RBE server must be manually started and stopped
between each `ninja` build.

This PR adds the startup and shutdown before and after `ninja` is run in
the build config runner. It also removes the RBE startup logic from the
`gn` script, which was the wrong place for it since there was no
opportunity for it to shutdown the service. Removing this logic from the
`gn` script will not affect CI since the recipes already do the right
startup and shutdown, and logic in the `gn` script skipped the now
deleted section of code.
2024-02-12 09:37:37 -08:00
Zachary Anderson
5a34bc8fa5 Adds a runner to engine_build_configs (flutter/engine#50342)
This PR adds an API to the `engine_build_configs` package that executes
an engine build config locally . This API is a building block for an
eventual command line tool to streamline workflows in the engine repo.
In particular, it will allow the command line tool to execute the same
config, build, and test commands that are run on CI.
2024-02-09 18:42:22 -08:00
Chinmay Garde
ecebcc1704 [Impeller] Add --enable-impeller-vulkan-playgrounds to ./flutter/tools/gn (flutter/engine#50477)
One has to manually `gn args` to add this flag (usually on macOS) now.
2024-02-09 22:44:34 +00:00
Zachary Anderson
3874808898 Make .style.yapf and .pylintrc agree on line length (flutter/engine#50510)
For https://github.com/flutter/flutter/issues/143243

yapf and pylint check different things, but occasionally overlap. I
think we'll just have to make them agree when we catch them fighting.
2024-02-09 14:07:57 -08:00
Zachary Anderson
f1a490179b Supports building with RBE on a Windows host. (flutter/engine#49877)
Requires https://github.com/flutter/buildroot/pull/820
2024-02-09 09:22:22 -08:00
Jonny Wang
eb4b07ee1d [fuchsia] Bump Fuchsia's API level to 16 (flutter/engine#50358)
Update Fuchsia's API level to 16.

b/322503140


## 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.
2024-02-06 15:34:37 +00:00
Jason Simmons
d174418e2f Remove the skia_fontmgr_factory argument from the Web GN configuration (flutter/engine#50183)
This was removed in Skia (see https://skia.googlesource.com/skia/+/38e85e85079f4140158a8f83c7bbceb7a1ac5ca5)
2024-02-02 22:30:18 +00:00
Zachary Anderson
55d79af527 Moves impeller/golden_tests_harvester to tools/golden_tests_harvester (flutter/engine#50211)
The tool is not Impeller specific, so moving it to the `tools/`
directory.
2024-02-01 08:38:52 -08:00
Matan Lurey
bf073d4352 Ignore CRLF endings when determining the names of header guards. (flutter/engine#50227)
Reported by @loic-sharma.

The tl;dr is it should be OK to have `\r\n` (CRLF) endings if the header
guard is otherwise correct.

This minor refactor (and test) discounts the existence of `\r` when
determining the name of a header guard, i.e.:
```h
#ifndef FLUTTER_MATAN_WHY_H_
```

... is now (correctly) considered a value of `FLUTTER_MATAN_WHY_H_` not
`FLUTTER_MATAN_WHY_H_\r`.
2024-01-31 17:58:22 -08:00
gaaclarke
c35dbe26fc [Impeller] implemented golden image tests for opengles (flutter/engine#50146)
fixes https://github.com/flutter/flutter/issues/142354

This sets up impeller_golden_tests to run with ANGLE.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-31 20:49:40 +00:00
Ivan Inozemtsev
ed5346b40a Support running sound null safe kernels from flutter_jit_runner (flutter/engine#50002)
- use core vm snapshot instead of core-jit, which does not seem to support sound null safety agnostic mode
- remove hardcoded `--no-sound-null-safety` flags from native code and ninja args
- add `sound_null_safety` attribute to `flutter_component` in ninja, which propagates to `dart_kernel`
- migrate one integration test to sound null safety, so that there are integration tests in both modes

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-30 21:12:16 +00:00
Michael Brase
c4608bbfd1 Use structured logging on Fuchsia (flutter/engine#49918)
This change migrates off of the old fuchsia logging apis to use the
structured logging apis. The initial FIDL connection is made during
global initialization (before main()) and the initial minimum log level
is queried from the system. Later on, once the main loop is initialized,
we setup an async task to listen for additional log interest changes
from the system. The advantage of doing this on the main loop is that we
avoid spawning an additional background thread in the process (the
legacy logging apis use the background thread approach).

One added benefit of this change is it reduces the size of the
dart/flutter runner far packages by about 250kb in release mode, because
libsyslog.so and libbackend_fuchsia_globals.so are no longer needed.

flutter/flutter#141924

## 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-01-29 22:26:47 -06:00
Matan Lurey
a50711f4f4 Enable header_guard_check (and --fix) in ci/format (flutter/engine#50102)
Closes https://github.com/flutter/flutter/issues/133415.

This includes a performance optimization for the runner itself, where
`--include=...`s are used as a base to check, versus checking _every_
file and seeing if it exists in a list. This works better with what is
expected in `ci/bin/format.dart` without any contract change.

Also added a few more functional tests of the system.
2024-01-26 16:32:14 -08:00
Matan Lurey
74d78673d9 Introduce a prototype of a "header guard enforcement" tool (flutter/engine#48903)
Closes https://github.com/flutter/flutter/issues/133415.

---

This is a prototype I threw together in about 1-2 hours. It enforces and
automatically fixes header guards that don't match the [the Google C++
style
guide](https://google.github.io/styleguide/cppguide.html#The__define_Guard).
For example, here is (trimmed) output at HEAD:

```txt
line 5, column 1 of impeller/aiks/picture.h: Unexpected #pragma once
  ╷
5 │ #pragma once
  │ ^^^^^^^^^^^^
  ╵
line 5, column 1 of flow/stopwatch.h: Expected #ifndef FLUTTER_FLOW_STOPWATCH_H_
  ╷
5 │ #ifndef FLUTTER_FLOW_INSTRUMENTATION_H_
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
The following 731 files have invalid header guards:
```
2024-01-26 13:15:56 -08:00
zijiehe@
538d967f7c [Fuchsia] Redo - Use chromium test-scripts to download images and execute tests (flutter/engine#49940)
This change is a redo of https://github.com/flutter/engine/pull/49847.

https://github.com/zijiehe-google-com/engine/compare/4530942..main
should show the diff between this and the original change; mainly fixes
the https://github.com/flutter/flutter/issues/141907.

Following paragraph is copied from the original change.

This change can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

- [V] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description
above.
- [V] 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.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
2024-01-25 11:58:03 +00:00
John Stiles
cd6d342e31 Use top-level GN arg for Skottie instead of CanvasKit-specific arg. (flutter/engine#50019)
The GN flag `skia_canvaskit_enable_skottie` is being retired at http://review.skia.org/805336
2024-01-25 03:43:05 +00:00
Jason Simmons
e870bf885a Exclude the Dart SDK sdk/lib/svg/dart2js directory from the license crawl (flutter/engine#49977)
This directory contains a file that is generated from other sources.

It is causing problems for the license script because it contains multiple copyright messages and one of the messages is partially included in the header region parsed by the script.
2024-01-23 21:25:47 +00:00
auto-submit[bot]
07034d9f1d Reverts "[Fuchsia] Redo - Use chromium test-scripts to download images and execute tests" (flutter/engine#49908)
Reverts flutter/engine#49847
Initiated by: zanderso
This change reverts the following previous change:
Original Description:
This change is a redo of https://github.com/flutter/engine/pull/49650.

https://github.com/zijiehe-google-com/engine/compare/de5c713..main should show the diff between this and the original change.

Following paragraph is copied from the original change.

This change requires https://github.com/flutter/buildroot/pull/811, and can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

- [V] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description above.
- [V] 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.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
2024-01-19 22:22:25 +00:00
zijiehe@
0f1211b660 [Fuchsia] Redo - Use chromium test-scripts to download images and execute tests (flutter/engine#49847)
This change is a redo of https://github.com/flutter/engine/pull/49650.

https://github.com/zijiehe-google-com/engine/compare/de5c713..main
should show the diff between this and the original change.

Following paragraph is copied from the original change.

This change requires https://github.com/flutter/buildroot/pull/811, and
can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

## Pre-launch Checklist

- [V] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description
above.
- [V] 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.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
2024-01-19 09:36:56 -08:00
Zachary Anderson
74eb0981de Relands: Refactors RBE support (flutter/engine#49660)
Relands https://github.com/flutter/engine/pull/49416
2024-01-12 13:25:58 -08:00