Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1730)

Unified Diff: build/toolchain/mac/BUILD.gn

Issue 2018553003: [GN] Configure a pool for copy_bundle_data and compile_xcassets tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-pool
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/mac/BUILD.gn
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index 1fdc1eef3175805485521607d667a19981de86e3..eb3dc1881ac49bf879ce01f16c970da11e329236 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -23,6 +23,28 @@ if (use_goma) {
goma_prefix = ""
}
+declare_args() {
+ # Control the number of copy_bundle_data and compile_xcassets tasks to run
+ # simultaneously. As the tasks are doing lots of I/O, some limit is required
+ # to prevent I/O starvation when ninja is run with a large number of parallel
+ # jobs (e.g. when using distributed build like goma).
+ bundle_pool_depth = -1
+}
+
+if (current_toolchain == default_toolchain) {
+ # Reduce the number of tasks using the copy_bundle_data and compile_xcassets
+ # tools as they can cause lots of I/O contention when invoking ninja with a
+ # large number of parallel jobs (e.g. when using distributed build like goma).
+ pool("bundle_pool") {
+ if (bundle_pool_depth == -1) {
Dirk Pranke 2016/06/07 22:17:46 Can we just use the value of concurrent_links here
sdefresne 2016/06/08 08:04:27 Done.
+ depth =
+ exec_script("//build/toolchain/get_concurrent_links.py", [], "value")
+ } else {
+ depth = bundle_pool_depth
+ }
+ }
+}
+
# This will copy the gyp-mac-tool to the build directory. We pass in the source
# file of the mac tool.
gyp_mac_tool_source =
@@ -271,6 +293,7 @@ template("mac_toolchain") {
root_build_dir)
command = "python $_tool {{source}} {{output}}"
description = "COPY_BUNDLE_DATA {{source}} {{output}}"
+ pool = ":bundle_pool($default_toolchain)"
}
tool("compile_xcassets") {
_tool = rebase_path("//build/toolchain/mac/compile_xcassets.py",
@@ -287,6 +310,7 @@ template("mac_toolchain") {
"-o {{output}} {{inputs}}"
description = "COMPILE_XCASSETS {{output}}"
+ pool = ":bundle_pool($default_toolchain)"
}
toolchain_args() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698