[build] Enable racing mode for Dart actions.

Put local actions in a common pool, especially
 - Assembler (many run for boringssl)
 - Linker (high memory use)
 - Dart (high memory use)

This should limit the number of concurrent local actions to the number of harts available, avoiding the racing actions triggering out-of-memory failures.

Change-Id: Ifa168012d73472a3db349acc36545dd176385bbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510190
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
Ryan Macnak
2026-06-09 09:23:06 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 354a997abe
commit 0b1c0dc9c5
12 changed files with 72 additions and 17 deletions
+3
View File
@@ -7,6 +7,7 @@ import("../build/toolchain/signing.gni")
import("../sdk_args.gni")
_dart_root = get_path_info("..", "abspath")
_is_dart = _dart_root == get_path_info("//", "abspath")
template("aot_snapshot") {
assert(defined(invoker.main_dart), "Must specify 'main_dart'")
@@ -56,6 +57,8 @@ template("aot_snapshot") {
mnemonic = "GEN_KERNEL"
if (defined(invoker.pool)) {
pool = invoker.pool
} else if (_is_dart) {
pool = "//build/toolchain:local_action_pool($host_toolchain)"
} else {
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
}
+3
View File
@@ -7,6 +7,7 @@ import("../runtime/runtime_args.gni")
import("../sdk_args.gni")
_dart_root = get_path_info("..", "abspath")
_is_dart = _dart_root == get_path_info("//", "abspath")
declare_args() {
# Default to building app-jit snapshots. The simulator and cross builds
@@ -122,6 +123,8 @@ template("application_snapshot") {
mnemonic = "GEN_KERNEL"
if (defined(invoker.pool)) {
pool = invoker.pool
} else if (_is_dart) {
pool = "//build/toolchain:local_action_pool($host_toolchain)"
} else {
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
}
+3
View File
@@ -6,6 +6,7 @@ import("../build/dart/dart_action.gni")
import("../sdk_args.gni")
_dart_root = get_path_info("..", "abspath")
_is_dart = _dart_root == get_path_info("//", "abspath")
template("compile_platform") {
assert(defined(invoker.libraries_specification_uri),
@@ -29,6 +30,8 @@ template("compile_platform") {
if (defined(invoker.pool)) {
pool = invoker.pool
} else if (_is_dart) {
pool = "//build/toolchain:local_action_pool($host_toolchain)"
} else {
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
}
+3
View File
@@ -10,6 +10,7 @@ import("../application_snapshot.gni")
import("../create_timestamp.gni")
_dart_root = get_path_info("../..", "abspath")
_is_dart = _dart_root == get_path_info("//", "abspath")
if (dart_dynamic_modules) {
_kernel_service_script = "pkg/dart2bytecode/bin/kernel_service.dart"
@@ -92,6 +93,8 @@ template("kernel_service_dill") {
action("kernel_service" + target_name + "_dill") {
if (defined(invoker.pool)) {
pool = invoker.pool
} else if (_is_dart) {
pool = "//build/toolchain:local_action_pool($host_toolchain)"
} else {
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
}