blob: ddff230e5fa99f144ef2bf096d0a4f5f74b9c373 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Calculation of the default job concurrency has been moved to a separate gni
# file that is only imported where the below pools are defined, as the rest of
# the tree doesn't need access to that, and other toolchains shouldn't wait to
# calculate that value within their own toolchain, as it won't be used.
#
# Principles to consider when determining concurrency:
# * If a job requires "high" memory, it should be constrained to a
# pool with fewer slots to mitigate overwhelming the host with
# other high-memory jobs.
# * If an action is executed remotely, it takes negligible local resources
# and can run with unbounded concurrency.
import("//build/toolchain/rbe.gni")
concurrent_jobs = {
# Configuration for tools that run remotely, and consume negligible local CPU
# or memory, e.g. RBE.
remote = {
# Concurrency is unbounded, and left up other controls like ninja -j.
}
# Configuration for tools that run locally
local = {
pool = "//build/config:local($default_toolchain)"
}
# To use the following configurations:
# _concurrent_jobs = concurrent_jobs.NAME
# configs += _concurrent_jobs.configs
# forward_variables_from(_concurrent_jobs.vars, "*")
# Configuration for exceptionally memory-intensive Rust jobs.
# Locally: restrict to lower concurrency pool
# Remotely: run on bigger remote worker
rust_highmem = {
if (rust_rbe_enable) {
configs = [ "//build/config:big_rbe_machine" ]
vars = {
# unbounded concurrency
}
} else {
configs = []
vars = {
pool = "//build/config:highmem($default_toolchain)"
}
}
}
# Force a memory-intensive Rust job to run locally.
rust_highmem_local_only = {
configs = [ "//build/config/rust:rbe_disable" ]
vars = {
pool = "//build/config:highmem($default_toolchain)"
disable_rbe = true
}
}
# Configuration for exceptionally memory-intensive link jobs.
# Locally: restrict to lower concurrency pool
# Remotely: run on bigger remote worker
link_highmem = {
if (link_rbe_enable) {
configs = [ "//build/config:big_rbe_machine" ]
vars = {
# unbounded concurrency
}
} else {
configs = []
vars = {
pool = "//build/config:highmem($default_toolchain)"
}
}
}
# Force a memory-intensive link job to run locally.
link_highmem_local_only = {
configs = [ "//build/config:no_remote_link" ]
vars = {
pool = "//build/config:highmem($default_toolchain)"
}
}
}