From 44d801da6e94dec939bd5b98cc3e8fec3574f42b Mon Sep 17 00:00:00 2001 From: "zijiehe@" <68449066+zijiehe-google-com@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:27:04 -0700 Subject: [PATCH] [fuchsia] Update fuchsia instruction in Compiling-the-engine.md (flutter/engine#55365) Behavior of `gclient config --custom-var` got changed, modifying the instruction to edit the raw `.gclient` file to avoid unexpected gclient behavior. Rich diff: https://github.com/flutter/engine/pull/55365/files?short_path=355a854#diff-355a854159c6f6da4e4e296d0cceb1e7e32ef26af1598aa6cdfaafbdbc656b57 Or rendered md: https://github.com/flutter/engine/blob/b375b805f9bbf478c1618dd0d03a02a11d4e65ab/docs/contributing/Compiling-the-engine.md#compiling-for-fuchsia Bug: http://b/368770157 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../docs/contributing/Compiling-the-engine.md | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/docs/contributing/Compiling-the-engine.md b/engine/src/flutter/docs/contributing/Compiling-the-engine.md index e970754857..3fa7f79834 100644 --- a/engine/src/flutter/docs/contributing/Compiling-the-engine.md +++ b/engine/src/flutter/docs/contributing/Compiling-the-engine.md @@ -200,18 +200,28 @@ Also, be sure that Python27 is before any other python in your Path. ### Build components for Fuchsia -1. Building fuchsia is only supported on linux. You need to run `gclient config --custom-var=download_fuchsia_deps=True` then `gclient sync`. +1. Building fuchsia is only supported on linux. You need to update `engine/.gclient`, or `../.gclient` if current directory is `engine/src`, with `custom_vars`. -It will set `"download_fuchsia_deps": True` in `"custom_vars"` section in `.gclient` file, and download necessary binaries to build fuchsia components. +``` +solutions = [ + { + # ... + "custom_vars": { + "download_fuchsia_deps": True, + "run_fuchsia_emu": True, + }, + }, +] +``` -2. If you'd like to run tests locally, also run `gclient config --custom-var=run_fuchsia_emu=True` then `gclient sync`. +> You may ignore `"run_fuchsia_emu": True` if you won't run tests locally. -It will set `"run_fuchsia_emu": True` in `"custom_vars"` section in `.gclient` file, and download necessary binaries and images to run tests on fuchsia emulators. -You can set both `custom_vars` and run `gclient sync` only once. +Run `gclient sync`. -You will also need kvm enabled, or nested virtualization on the gcloud VMs. Fuchsia and the tests will all be executed on the qemu. +> [!WARNING] +> When running tests locally, you will also need kvm enabled, or nested virtualization on the gcloud VMs. Fuchsia and the tests will all be executed on the qemu. -3. Prepare and build +2. Prepare and build ``` ./flutter/tools/gn --fuchsia --no-lto @@ -238,7 +248,7 @@ fuchsia_tests * Use `autoninja` if it's available. * `-C out/fuchsia_release_x64` for release build; other configurations are similar with a different folder name in `out/`. -4. Run all tests locally +3. Run all tests locally ``` python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py @@ -247,6 +257,10 @@ python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py * It runs the tests in `out/fuchsia_debug_x64` by default. According to the configuration, it may take 5 minutes with regular gtest output to the terminal. * Add `fuchsia_release_x64` at the end of the command for release build; other configurations are similar with a different folder name in `out/`. +``` +python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py fuchsia_release_x64 +``` + ## Compiling for the Web For building the engine for the Web we use the [felt](https://github.com/flutter/engine/blob/main/lib/web_ui/README.md) tool.