dart-sdk/build/toolchain/rbe.gni

50 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Defines the configuration of RBE.
Reland "[infra] RBE all the things." This is a reland of commit b3253d9c8b2436060096234b69860caac67efbac Fix the gn rules so the RBE offloading only happens in the Dart build and the conflicting RBE configuration is not included otherwise. This ensures this change can roll into Flutter while we design a better solution to compose the projects' RBE usages. Original change's description: > [infra] RBE all the things. > > This change offloads all Dart actions during the build to RBE using > the new rewrapper_dart.py script that understands all the different > command line invocations of Dart programs and translates it into the > appropriate rewrapper invocation, with a full list of input and output > files and no absolute paths. > > The dart actions are all considered to be expensive RBE compilation > steps that may be much slower on RBE than locally due to the low > parallelism of the build during these stages and the comperatively > slower bots in the RBE pools. The build uses the racing strategy by > default for these compilations, such that cache hits are still used > if available, and otherwise a local build is transparently used if it > happens to be faster. The bots will use the remote strategy by default > unlike developers, such that the rewrapper_dart.py script does not fail. > > rewrapper_dart.py contains a tiny dart import proprocessor written > in python and a big argument parser that understands every command > invoked during the build and the semantic meaning of every option. > > The absolute paths used during the Dart SDK build is not solved in > this changelist, which just works around them initially, but these > will be fixed in follow up changes with the appropriate teams now > that this change proves they are not needed. > > Bug: b/333595242 > Change-Id: I36603ec1bf16f4ac87d56635cc1c98e8686a4028 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335827 > Reviewed-by: William Hesse <whesse@google.com> > Commit-Queue: Jonas Termansen <sortie@google.com> Bug: b/333595242 Change-Id: I43bec2e7fcad375e972ca447aa13ae65b0ce09ae Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362661 Reviewed-by: William Hesse <whesse@google.com> Commit-Queue: Jonas Termansen <sortie@google.com>
2024-04-12 22:06:32 +00:00
_dart_root = get_path_info("../..", "abspath")
declare_args() {
# Set to true to enable distributed compilation using RBE.
use_rbe = false
# Set to the operating system to use in the RBE pool
rbe_os = "linux"
# Set to the architecture used in the RBE pool.
rbe_cpu = "x64"
# Set to the docker image to use in the RBE.
rbe_image = "docker://gcr.io/cloud-marketplace/google/debian11@sha256:69e2789c9f3d28c6a0f13b25062c240ee7772be1f5e6d41bb4680b63eae6b304"
Reland "[infra] RBE all the things." This is a reland of commit b3253d9c8b2436060096234b69860caac67efbac Fix the gn rules so the RBE offloading only happens in the Dart build and the conflicting RBE configuration is not included otherwise. This ensures this change can roll into Flutter while we design a better solution to compose the projects' RBE usages. Original change's description: > [infra] RBE all the things. > > This change offloads all Dart actions during the build to RBE using > the new rewrapper_dart.py script that understands all the different > command line invocations of Dart programs and translates it into the > appropriate rewrapper invocation, with a full list of input and output > files and no absolute paths. > > The dart actions are all considered to be expensive RBE compilation > steps that may be much slower on RBE than locally due to the low > parallelism of the build during these stages and the comperatively > slower bots in the RBE pools. The build uses the racing strategy by > default for these compilations, such that cache hits are still used > if available, and otherwise a local build is transparently used if it > happens to be faster. The bots will use the remote strategy by default > unlike developers, such that the rewrapper_dart.py script does not fail. > > rewrapper_dart.py contains a tiny dart import proprocessor written > in python and a big argument parser that understands every command > invoked during the build and the semantic meaning of every option. > > The absolute paths used during the Dart SDK build is not solved in > this changelist, which just works around them initially, but these > will be fixed in follow up changes with the appropriate teams now > that this change proves they are not needed. > > Bug: b/333595242 > Change-Id: I36603ec1bf16f4ac87d56635cc1c98e8686a4028 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335827 > Reviewed-by: William Hesse <whesse@google.com> > Commit-Queue: Jonas Termansen <sortie@google.com> Bug: b/333595242 Change-Id: I43bec2e7fcad375e972ca447aa13ae65b0ce09ae Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362661 Reviewed-by: William Hesse <whesse@google.com> Commit-Queue: Jonas Termansen <sortie@google.com>
2024-04-12 22:06:32 +00:00
# Do expensive RBE compilations both locally and remotely, whatever is faster.
rbe_expensive_exec_strategy = "racing"
rbe_exec_root = rebase_path("//", root_build_dir)
Reland "[infra] RBE all the things." This is a reland of commit b3253d9c8b2436060096234b69860caac67efbac Fix the gn rules so the RBE offloading only happens in the Dart build and the conflicting RBE configuration is not included otherwise. This ensures this change can roll into Flutter while we design a better solution to compose the projects' RBE usages. Original change's description: > [infra] RBE all the things. > > This change offloads all Dart actions during the build to RBE using > the new rewrapper_dart.py script that understands all the different > command line invocations of Dart programs and translates it into the > appropriate rewrapper invocation, with a full list of input and output > files and no absolute paths. > > The dart actions are all considered to be expensive RBE compilation > steps that may be much slower on RBE than locally due to the low > parallelism of the build during these stages and the comperatively > slower bots in the RBE pools. The build uses the racing strategy by > default for these compilations, such that cache hits are still used > if available, and otherwise a local build is transparently used if it > happens to be faster. The bots will use the remote strategy by default > unlike developers, such that the rewrapper_dart.py script does not fail. > > rewrapper_dart.py contains a tiny dart import proprocessor written > in python and a big argument parser that understands every command > invoked during the build and the semantic meaning of every option. > > The absolute paths used during the Dart SDK build is not solved in > this changelist, which just works around them initially, but these > will be fixed in follow up changes with the appropriate teams now > that this change proves they are not needed. > > Bug: b/333595242 > Change-Id: I36603ec1bf16f4ac87d56635cc1c98e8686a4028 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335827 > Reviewed-by: William Hesse <whesse@google.com> > Commit-Queue: Jonas Termansen <sortie@google.com> Bug: b/333595242 Change-Id: I43bec2e7fcad375e972ca447aa13ae65b0ce09ae Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362661 Reviewed-by: William Hesse <whesse@google.com> Commit-Queue: Jonas Termansen <sortie@google.com>
2024-04-12 22:06:32 +00:00
rbe_dir = rebase_path(_dart_root + "/buildtools/reclient", root_build_dir)
}
declare_args() {
if (rbe_os == "linux") {
rbe_os_family = "Linux"
} else if (rbe_os == "win") {
rbe_os_family = "Windows"
} else if (rbe_os == "mac") {
rbe_os_family = "Mac"
} else {
rbe_os_family = rbe_os
}
# Set to the desired fully qualified RBE platform.
rbe_platform = "container-image=$rbe_image,OSFamily=$rbe_os_family"
}
rewrapper_args = [
"$rbe_dir/rewrapper",
"--exec_root=$rbe_exec_root",
"--platform=$rbe_platform",
]