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
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.
* 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.
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`.
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.
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.
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.
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`.
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.
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.
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.
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`.
- 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
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
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.
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:
```
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.
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.
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.
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.