This PR creates a new test type for `run_tests.py` called `dart-host`.
The tests remaining under the `dart` type are tests that run in
`flutter_tester`. The `dart-host` tests run in the Dart CLI. This allows
`run_tests.py` to be simplified a bit, and while doing this I spotted a
couple of mistakes that were causing some tests not to run.
This PR also makes a couple of small style fixes to the build config
json files, converting tabs to spaces, and moving some "script" fields
before the "parameters" fields.
Using `engine_repo_tools`, provide a default `--target-variant` for the `clang_tidy` tool.
Mostly test code added below, the major change is that `--target-variant` now has a default other than `host_debug` if we're running inside of an engine root (which we ~always are). I didn't make any other changes (i.e. to the pre-commit hook) to keep this change smallish.
Also rewrote the `README.md` to represent the current state as best I could.
Partial work towards https://github.com/flutter/flutter/issues/133190.
Some context, from @zanderso on chat:
@matanlurey:
> For
[`clang_tidy_test.dart`](c020936303/tools/clang_tidy/test/clang_tidy_test.dart),
what is your vision there? I remember we ran into problems with it
actually executing `clang.run()` in too many of the test cases, but I
don't remember (or seem to have written down) what we decided to do 🙂
@zanderso:
> The existing tests are calling `computeFilesOfInterest` and
`getLintCommandsForFiles` and inspecting the results for positive tests
instead of hitting a real clang-tidy invocation. Tests of command line
flags that call `clangTidy.run()` are also testing cases that
short-circuit or fail before making a real invocation. Making it harder
to do a real invocation from a unit test probably requires plumbing a
fake-able ProcessRunner or ProcessManager object through to the
ClangTidy constructor.
---
All this PR does is allow providing a `ProcessManager` (defaults to
`LocalProcessManager`, i.e. `dart:io`) throughout the tool. Then, for
tests, I've implemented a _very_ minimal fake of both `ProcessManager`
and `Process` (it would be nice to share code w/ say, `flutter_tool`,
but lots of work/overhead for very little surface area).
After this CL, no tests in `clang_tidy_test.dart` actually run a
process. This should unblock adding new features (i.e. original intent
of https://github.com/flutter/flutter/issues/133190) without causing
headaches for others/CI?
This PR lands changes to `tools/gn` to use Flutter's RBE instance
instead of Goma. It is initially supported only for builds from a Linux
host.
1. Authenticate with `gcloud`
```
engine/src$ ./buildtools/linux-x64/gcloud/bin/gcloud auth application-default login --disable-quota-project
```
2. GN
```
engine/src$ ./flutter/tools/gn --android --android-cpu arm64 --no-lto --runtime-mode debug --rbe
```
3. Build
```
engine/src$ ninja -C out/android_debug_arm64 -j200
```
As discussed offline, this is best deleted when Skia-gold is used for
all of our engine tests.
However, this will be useful for unblocking some PRs until then :)
See README.md for details!
Partial work towards re-landing #44936.
Both the `clang_tidy` and `githooks` passage could benefit from being
able to automatically find the latest `compile_commands.json` output,
which means that some common code should exist in the `tools/`
directory.
This is a very minimal (but tested) library for doing exactly that.
This implements platform views in Skwasm. There are a number of substantial changes rolled up in this change, including:
* Reworked the rendering system to use multiple canvases with a single WebGL context, via ImageBitmap rendering.
* Reworked our object management and bindings to use the `__externref_t` construct in C code.
* Upgraded emscripten to a much newer version
* Generified skwasm's scene builder to be able to work with any renderer that can produce `ImageBitmap` objects from Pictures, and whose `Canvas`, `Picture` and `ImageFilter` objects conform to `SceneCanvas`/`ScenePicture`/`SceneImageFilter`
For platform views themselves, most stuff is implemented except for clipping. I plan on doing that in a subsequent change.
Reverts flutter/engine#45029
It appears this is causing a regression in the length of time some of our integration tests are taking, causing them to take twice as long, which is causing timeouts in CI. We should revert while we investigate.
This flag removes some code from CanvasKit to reduce size by a little bit. I went ahead and did a run of the benchmarks (https://github.com/flutter/flutter/pull/133208) to see if it negatively affected anything, and there was no difference beyond noise between the current benchmark numbers and the benchmarks with this flag enabled.
The size differences are as follows:
Before the change:
```
total 30616
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:33 .
drwxr-xr-x 7 jacksongardner primarygroup 224 Aug 10 18:14 ..
-rw-r--r--@ 1 jacksongardner primarygroup 6148 May 12 17:41 .DS_Store
-rw-r--r-- 2 jacksongardner primarygroup 94899 Aug 23 14:23 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 6631693 Aug 23 14:23 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 2102151 Aug 23 14:23 canvaskit.wasm.br
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:33 chromium
-rw-r--r-- 2 jacksongardner primarygroup 161478 Aug 23 14:28 skwasm.js
-rwxr-xr-x 2 jacksongardner primarygroup 3296038 Aug 23 14:28 skwasm.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1101502 Aug 23 14:28 skwasm.wasm.br
-rw-r--r-- 2 jacksongardner primarygroup 3095 Aug 23 14:28 skwasm.worker.js
./chromium:
total 15520
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:33 .
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:33 ..
-rw-r--r-- 2 jacksongardner primarygroup 94545 Aug 23 14:25 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 5223378 Aug 23 14:25 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1492433 Aug 23 14:25 canvaskit.wasm.br
```
After the change:
```
total 28568
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:42 .
drwxr-xr-x 7 jacksongardner primarygroup 224 Aug 10 18:14 ..
-rw-r--r--@ 1 jacksongardner primarygroup 6148 May 12 17:41 .DS_Store
-rw-r--r-- 2 jacksongardner primarygroup 94899 Aug 23 14:37 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 6401703 Aug 23 14:37 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 2038390 Aug 23 14:37 canvaskit.wasm.br
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:42 chromium
-rw-r--r-- 2 jacksongardner primarygroup 161478 Aug 23 14:41 skwasm.js
-rwxr-xr-x 2 jacksongardner primarygroup 3143431 Aug 23 14:41 skwasm.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1050854 Aug 23 14:41 skwasm.wasm.br
-rw-r--r-- 2 jacksongardner primarygroup 3095 Aug 23 14:41 skwasm.worker.js
./chromium:
total 15392
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:42 .
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:42 ..
-rw-r--r-- 2 jacksongardner primarygroup 94545 Aug 23 14:39 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 4993586 Aug 23 14:39 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1427979 Aug 23 14:39 canvaskit.wasm.br
```
The brotli-compressed wasm modules save about 50-70kb each with this flag.
Closes https://github.com/flutter/flutter/issues/132687.
Zach, this is a pretty naive attempt, so feel free to suggest alternatives. I considered for example just using `--checks=-{{LINT}}` as well, but figured that might be less discoverable (especially for non-core folks) than just a file called `.clang-tidy-for-githooks`.
/cc @jonahwilliams
## Description
This turns off the Doxyfile option `CREATE_SUBDIRS` because it prevents deep link URLs from being stable. It means that thousands of files will be in the main directory, but the filesystem should be able to handle that.
I got rid of the header/footer files for doxygen (because Doxygen will generate them anyhow) and fixed where it was looking for the Flutter logo.
I also ran Doxygen on the Doxyfile template and Doxyfile and updated all the options to correspond with the latest Doxygen.
Example usage:
```shell
$ dart tools/clang_tidy/bin/main.dart --lint-all --enable-check-profile
```
I plan to use this to help triage why clang_tidy takes so long, and if
particular rules are contributing to most of the cost.
This PR updates the gradle build file for the android_embedding_bundle
cipd package to fetch license information about the dependencies listed
under `tools/androidx/files.json`. The README file for the
android_embedding_bundle now explains how to fetch the license
information and make sure it's correct in the cipd package.
This PR also pulls a new version of android_embedding_dependencies that
includes a `LICENSE` file.
It turns out that Flutter does not re-ship anything from the embedding
bundle to Flutter end-users. These dependencies are only used to create
a classpath against which we build the Android embedder and in-tree
tests. I've updated docs/comments to clarify that since I was initially
confused about how these were used.
I'm not adding a test that compares the license info fetched from maven
against a checked-in golden, yet. Still thinking about the most
effective way to do that in combination with the steps in the README.
iOS extensions forbids the usage of UIApplication.sharedApplication. This PR refactors the engine to use UISceneAPI when darwin_extension_safe flag is on. Using UISceneAPI can help avoid the usage of `UIApplication.sharedApplication` as much as possible.
This PR also added a new `_extension_safe` variant for the engine build so all the logic with the `darwin_extension_safe` flag is on can be tested separately.
This PR doesn't enable the engine to build for the extension even when darwin_extension_safe is true.
part of https://github.com/flutter/flutter/issues/124289
There are several issues related to UIApplication life cycle and I manually tested they still work with the scene API:
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Stop using the special fuchsia headers, as they are contributing to
undefined behavior when building with LTO.
They are also no longer needed. All relevant fuchsia extensions were
upstreamed some time ago.
In the process, engage in some cleanup which means the "vulkan_config"
is also no longer needed. Rely on GN "public_deps" to provide the vulkan
include paths to various source sets.
See b/291462180 for more details on why this fix was neccesary.
The Vulkan validation layer headers will not build if the Android API level is 23 or lower.
Currently the engine buildroot's default Android API level is 23. The API level must be overridden for any configuration where Vulkan validation is enabled.
Context:
> @matanlurey:
> Would it make sense for `--unopt` to imply
`--enable-vulkan-validation-layers` if `--enable-vulkan` is set?
> The reason I ask is because it does seem to imply `glGetError` checks,
which (I could be wrong) is roughly similar?
> @chinmaygarde:
> Makes sense.
... so uh, here it is (let me know if we prefer anything different).
fixes https://github.com/flutter/flutter/issues/130682
This patch makes all zip files created via the zip_bundle rule have an embedded LICENSE that points to a permalink to the LICENSE for that SDK commit hash. Previously we only did this for a few tools, but it was pointed out that some of the zip files we generate that are meant for consumption in the tool are otherwise missing a stand-alone license file (the tool downloads the full license file separately from the individual zips, as it would be costly to include it with each and every one).
Partial revert of https://github.com/flutter/engine/pull/43743
Setting the optimization level to `-Oz` reduced compressed binary size by 200KB, but regressed performance by 10-15% across the board (frame build time, gen_snapshot runtime, hot reload time, etc.)