Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 41f1027

Browse files
authored
Simplify GN pools, use in more places (#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 flutter/buildroot#856
1 parent b94215c commit 41f1027

File tree

12 files changed

+26
-47
lines changed

12 files changed

+26
-47
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ allowed_hosts = [
277277
]
278278

279279
deps = {
280-
'src': 'https://github.com/flutter/buildroot.git' + '@' + '70a42312a688890eb1435a8c2760f6cbde324531',
280+
'src': 'https://github.com/flutter/buildroot.git' + '@' + '7840a4af027fc21161d4ae14a3d4d9c9bab049a2',
281281

282282
'src/flutter/third_party/depot_tools':
283283
Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '580b4ff3f5cd0dcaa2eacda28cefe0f45320e8f7',

build/dart/BUILD.gn

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ import("//flutter/common/config.gni")
77

88
import("$dart_src/build/dart/copy_tree.gni")
99

10-
declare_args() {
11-
# Maximum number of Dart processes to run in parallel.
12-
#
13-
# To avoid out-of-memory errors we explicitly reduce the number of jobs.
14-
concurrent_dart_jobs = 1
15-
}
16-
17-
pool("dart_pool") {
18-
depth = concurrent_dart_jobs
19-
}
20-
2110
if (build_engine_artifacts) {
2211
if (flutter_prebuilt_dart_sdk) {
2312
copy_trees("_copy_trees") {

build/dart/rules.gni

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ template("flutter_frontend_server") {
8484
],
8585
[ "pool" ])
8686
deps = common_deps
87-
pool = "//flutter/build/dart:dart_pool"
87+
pool = "//build/toolchain:toolchain_pool"
8888
script = "//build/gn_run_binary.py"
8989
inputs = [ invoker.main_dart ]
9090
outputs = [ invoker.kernel_output ]
@@ -110,7 +110,7 @@ template("flutter_frontend_server") {
110110
],
111111
[ "pool" ])
112112
deps = common_deps
113-
pool = "//flutter/build/dart:dart_pool"
113+
pool = "//build/toolchain:toolchain_pool"
114114
script = "$dart_src/pkg/frontend_server/bin/frontend_server_starter.dart"
115115
inputs = [ invoker.main_dart ]
116116
outputs = [ invoker.kernel_output ]
@@ -359,7 +359,7 @@ template("application_snapshot") {
359359
inputs = extra_inputs
360360
outputs = [ output ]
361361
depfile = depfile
362-
pool = "//flutter/build/dart:dart_pool"
362+
pool = "//build/toolchain:toolchain_pool"
363363

364364
ext = ""
365365
if (is_win) {
@@ -380,7 +380,7 @@ template("application_snapshot") {
380380
"visibility",
381381
])
382382
script = main_dart
383-
pool = "//flutter/build/dart:dart_pool"
383+
pool = "//build/toolchain:toolchain_pool"
384384
deps = extra_deps
385385
inputs = extra_inputs
386386
outputs = [ output ]

docs/rbe/rbe.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,23 @@ RBE builds can be slow for a few different reasons. The most common reason is
151151
likely to be that the remote caches are cold. When the caches are warm, a
152152
compile step consists only of downloading the compiled TU from the cache. When
153153
the caches are cold, the remote workers must run the compilation commands,
154-
which takes more time.
154+
which takes more time. If the worker pool is overloaded, compile commands may
155+
run locally instead, which will also be slower.
155156

156157
RBE builds can also be slow if your network connection is bandwidth constrained.
157158
Anecdotally, even with a warm cache, I have noticed slow builds from home due
158159
to RBE saturating my low-tier Comcast Business connection.
159160

161+
For Googlers on a corp macOS device, both RBE and non-RBE builds can be slow
162+
due to various background and monitoring processes running. See
163+
[here](https://buganizer.corp.google.com/issues/324404733#comment16) for how
164+
to disable some of them. You should also disable Spotlight scanning of the
165+
engine source directory as described
166+
[here](go/building-chrome-mac#add-the-source-directory-to-the-spotlight-privacy-list).
167+
160168
When RBE builds are slow, non-RBE builds may be faster, especially incremental
161-
builds.
169+
builds. You can disable remote builds without invalidating your existing build
170+
by setting the environment variable `RBE_exec_strategy=local`.
162171

163172
### Proxy status and debug logs
164173

impeller/tools/BUILD.gn

Lines changed: 0 additions & 19 deletions
This file was deleted.

impeller/tools/impeller.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ template("impellerc") {
339339
])
340340

341341
_impellerc(target_name) {
342+
pool = "//build/toolchain:toolchain_pool"
342343
shader_bundle = defined(invoker.shader_bundle)
343344

344345
# When single_invocation is true, impellerc will be invoked exactly once. When it's

impeller/tools/malioc.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ template("malioc_analyze_shaders") {
7171
])
7272

7373
script = "//build/gn_run_malioc.py"
74-
pool = "//flutter/impeller/tools:malioc_pool"
74+
pool = "//build/toolchain:toolchain_pool"
7575

7676
# Nest all malioc output under its own subdirectory of root_gen_dir
7777
# so that it's easier to diff it against the state before any changes.

lib/snapshot/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ compile_platform("strong_platform") {
232232
"$root_out_dir/flutter_patched_sdk/vm_outline_strong.dill",
233233
]
234234

235-
pool = "//flutter/build/dart:dart_pool"
235+
pool = "//build/toolchain:toolchain_pool"
236236

237237
is_runtime_mode_release =
238238
flutter_runtime_mode == "release" || flutter_runtime_mode == "jit_release"

testing/testing.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ template("dart_snapshot_aot") {
108108

109109
tool = "$dart_src/runtime/bin:gen_snapshot"
110110

111-
pool = "//flutter/build/dart:dart_pool"
111+
pool = "//build/toolchain:toolchain_pool"
112112

113113
inputs = [ invoker.dart_kernel ]
114114

tools/gn

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ def to_gn_args(args):
532532
else:
533533
gn_args['dart_runtime_mode'] = runtime_mode
534534

535-
gn_args['concurrent_dart_jobs'] = get_concurrent_jobs('1GB', '1GB')
535+
gn_args['concurrent_toolchain_jobs'] = get_concurrent_jobs('1GB', '100MB')
536536

537537
# Hardcoding this avoids invoking a relatively expensive python script from
538538
# GN, but removes the ability to use git-worktrees in the Dart checkout from
@@ -723,7 +723,6 @@ def to_gn_args(args):
723723
malioc_path = os.environ.get('MALIOC_PATH')
724724
if malioc_path:
725725
gn_args['impeller_malioc_path'] = malioc_path
726-
gn_args['impeller_concurrent_malioc_jobs'] = get_concurrent_jobs('1GB', '100MB')
727726

728727
if args.use_glfw_swiftshader:
729728
if get_host_os() == 'mac':

0 commit comments

Comments
 (0)