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
This commit is contained in:
Zachary Anderson
2024-05-10 15:43:23 -07:00
committed by GitHub
parent 70b18ec727
commit a1257de605
12 changed files with 26 additions and 47 deletions

2
DEPS
View File

@@ -277,7 +277,7 @@ allowed_hosts = [
]
deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '70a42312a688890eb1435a8c2760f6cbde324531',
'src': 'https://github.com/flutter/buildroot.git' + '@' + '7840a4af027fc21161d4ae14a3d4d9c9bab049a2',
'src/flutter/third_party/depot_tools':
Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '580b4ff3f5cd0dcaa2eacda28cefe0f45320e8f7',

View File

@@ -7,17 +7,6 @@ import("//flutter/common/config.gni")
import("$dart_src/build/dart/copy_tree.gni")
declare_args() {
# Maximum number of Dart processes to run in parallel.
#
# To avoid out-of-memory errors we explicitly reduce the number of jobs.
concurrent_dart_jobs = 1
}
pool("dart_pool") {
depth = concurrent_dart_jobs
}
if (build_engine_artifacts) {
if (flutter_prebuilt_dart_sdk) {
copy_trees("_copy_trees") {

View File

@@ -84,7 +84,7 @@ template("flutter_frontend_server") {
],
[ "pool" ])
deps = common_deps
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
script = "//build/gn_run_binary.py"
inputs = [ invoker.main_dart ]
outputs = [ invoker.kernel_output ]
@@ -110,7 +110,7 @@ template("flutter_frontend_server") {
],
[ "pool" ])
deps = common_deps
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
script = "$dart_src/pkg/frontend_server/bin/frontend_server_starter.dart"
inputs = [ invoker.main_dart ]
outputs = [ invoker.kernel_output ]
@@ -359,7 +359,7 @@ template("application_snapshot") {
inputs = extra_inputs
outputs = [ output ]
depfile = depfile
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
ext = ""
if (is_win) {
@@ -380,7 +380,7 @@ template("application_snapshot") {
"visibility",
])
script = main_dart
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
deps = extra_deps
inputs = extra_inputs
outputs = [ output ]

View File

@@ -151,14 +151,23 @@ RBE builds can be slow for a few different reasons. The most common reason is
likely to be that the remote caches are cold. When the caches are warm, a
compile step consists only of downloading the compiled TU from the cache. When
the caches are cold, the remote workers must run the compilation commands,
which takes more time.
which takes more time. If the worker pool is overloaded, compile commands may
run locally instead, which will also be slower.
RBE builds can also be slow if your network connection is bandwidth constrained.
Anecdotally, even with a warm cache, I have noticed slow builds from home due
to RBE saturating my low-tier Comcast Business connection.
For Googlers on a corp macOS device, both RBE and non-RBE builds can be slow
due to various background and monitoring processes running. See
[here](https://buganizer.corp.google.com/issues/324404733#comment16) for how
to disable some of them. You should also disable Spotlight scanning of the
engine source directory as described
[here](go/building-chrome-mac#add-the-source-directory-to-the-spotlight-privacy-list).
When RBE builds are slow, non-RBE builds may be faster, especially incremental
builds.
builds. You can disable remote builds without invalidating your existing build
by setting the environment variable `RBE_exec_strategy=local`.
### Proxy status and debug logs

View File

@@ -1,19 +0,0 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/compiled_action.gni")
import("//flutter/common/config.gni")
import("//flutter/impeller/tools/malioc.gni")
import("//flutter/testing/testing.gni")
declare_args() {
# Maximum number of malioc processes to run in parallel.
#
# To avoid out-of-memory errors we explicitly reduce the number of jobs.
impeller_concurrent_malioc_jobs = 1
}
pool("malioc_pool") {
depth = impeller_concurrent_malioc_jobs
}

View File

@@ -339,6 +339,7 @@ template("impellerc") {
])
_impellerc(target_name) {
pool = "//build/toolchain:toolchain_pool"
shader_bundle = defined(invoker.shader_bundle)
# When single_invocation is true, impellerc will be invoked exactly once. When it's

View File

@@ -71,7 +71,7 @@ template("malioc_analyze_shaders") {
])
script = "//build/gn_run_malioc.py"
pool = "//flutter/impeller/tools:malioc_pool"
pool = "//build/toolchain:toolchain_pool"
# Nest all malioc output under its own subdirectory of root_gen_dir
# so that it's easier to diff it against the state before any changes.

View File

@@ -232,7 +232,7 @@ compile_platform("strong_platform") {
"$root_out_dir/flutter_patched_sdk/vm_outline_strong.dill",
]
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
is_runtime_mode_release =
flutter_runtime_mode == "release" || flutter_runtime_mode == "jit_release"

View File

@@ -108,7 +108,7 @@ template("dart_snapshot_aot") {
tool = "$dart_src/runtime/bin:gen_snapshot"
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
inputs = [ invoker.dart_kernel ]

View File

@@ -532,7 +532,7 @@ def to_gn_args(args):
else:
gn_args['dart_runtime_mode'] = runtime_mode
gn_args['concurrent_dart_jobs'] = get_concurrent_jobs('1GB', '1GB')
gn_args['concurrent_toolchain_jobs'] = get_concurrent_jobs('1GB', '100MB')
# Hardcoding this avoids invoking a relatively expensive python script from
# GN, but removes the ability to use git-worktrees in the Dart checkout from
@@ -723,7 +723,6 @@ def to_gn_args(args):
malioc_path = os.environ.get('MALIOC_PATH')
if malioc_path:
gn_args['impeller_malioc_path'] = malioc_path
gn_args['impeller_concurrent_malioc_jobs'] = get_concurrent_jobs('1GB', '100MB')
if args.use_glfw_swiftshader:
if get_host_os() == 'mac':

View File

@@ -119,7 +119,7 @@ template("_dartdevc") {
inputs = invoker.inputs
outputs = invoker.outputs
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
ext = ""
if (is_win) {
@@ -146,7 +146,7 @@ template("_dartdevc") {
script = "$dart_src/pkg/dev_compiler/bin/dartdevc.dart"
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
}
}
}
@@ -169,7 +169,7 @@ template("_kernel_worker") {
inputs = invoker.inputs
outputs = invoker.outputs
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
ext = ""
if (is_win) {
@@ -197,7 +197,7 @@ template("_kernel_worker") {
script = "$dart_src/utils/bazel/kernel_worker.dart"
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
}
}
}

View File

@@ -20,7 +20,7 @@ template("sdk_rewriter") {
prebuilt_dart_action(target_name) {
packages = dart_sdk_package_config
pool = "//flutter/build/dart:dart_pool"
pool = "//build/toolchain:toolchain_pool"
script = "//flutter/web_sdk/sdk_rewriter.dart"